diff --git a/.github/workflows/publish-latest.yml b/.github/workflows/publish-latest.yml index 3e41fd5a4d..e4c7c474c1 100644 --- a/.github/workflows/publish-latest.yml +++ b/.github/workflows/publish-latest.yml @@ -28,10 +28,10 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2.6.1 + uses: goreleaser/goreleaser-action@v4 with: distribution: goreleaser - version: v1.8.3 + version: v1.19 args: -f .goreleaser.latest.yml --rm-dist --skip-validate env: GITHUB_TOKEN: ${{ secrets.GO_RELEASER_TOKEN }} @@ -59,4 +59,4 @@ jobs: run: | git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" - yarn deploy + yarn deploy \ No newline at end of file diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index b0c6713149..6b9a77ed78 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -33,12 +33,12 @@ jobs: go-version: '1.19' - name: test binaries run: make test-ci - - name: Install goveralls - run: go install github.com/mattn/goveralls@latest - - name: Send coverage - env: - COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: goveralls -coverprofile=coverage.txt -service=github + # - name: Install goveralls + # run: go install github.com/mattn/goveralls@latest + # - name: Send coverage + # env: + # COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: goveralls -coverprofile=coverage.txt -service=github integration-test: runs-on: ubuntu-latest services: diff --git a/.golangci.yml b/.golangci.yml index 61b214484a..40360a3bb5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -60,30 +60,30 @@ linters-settings: rules: - name: atomic - name: context-as-argument -# - name: context-keys-type #perf issue + # - name: context-keys-type #perf issue - name: defer - name: dot-imports - name: empty-block - name: error-naming - name: error-return -# - name: error-strings + # - name: error-strings - name: early-return -# - name: errorf #perf issue -# - name: exported + # - name: errorf #perf issue + # - name: exported - name: if-return - name: increment-decrement - name: indent-error-flow -# - name: flag-parameter + # - name: flag-parameter - name: modifies-parameter -# - name: modifies-value-receiver #perf issue + # - name: modifies-value-receiver #perf issue - name: package-comments - name: range - name: receiver-naming - name: redefines-builtin-id - name: superfluous-else -# - name: time-naming #perf issue + # - name: time-naming #perf issue - name: unexported-naming -# - name: var-declaration #perf issue + # - name: var-declaration #perf issue - name: var-naming - name: unused-receiver - name: unused-parameter @@ -95,18 +95,18 @@ linters-settings: numbers: true gomnd: ignored-numbers: # Why we have a big range of file permissions - - '0o600' - - '0o644' - - '0o655' - - '0o666' - - '0o770' - - '0o755' - - '0o765' - - '0o777' + - "0o600" + - "0o644" + - "0o655" + - "0o666" + - "0o770" + - "0o755" + - "0o765" + - "0o777" ignored-functions: - - 'survey.MinLength' - - 'survey.MaxLength' - - 'args.Error' + - "survey.MinLength" + - "survey.MaxLength" + - "args.Error" gosec: excludes: - G101 @@ -121,20 +121,20 @@ linters-settings: - "all" - "-SA1019" goimports: - local-prefixes: github.com/odpf/optimus + local-prefixes: github.com/raystack/optimus gci: sections: - standard # Captures all standard packages if they do not match another section. - default # Contains all imports that could not be matched to another section type. - - prefix(github.com/odpf/optimus) # Groups all imports with the specified Prefix. + - prefix(github.com/raystack/optimus) # Groups all imports with the specified Prefix. gocritic: disabled-checks: - ifElseChain - singleCaseSwitch enabled-tags: - diagnostic -# - style -# - opinionated + # - style + # - opinionated - performance unparam: # Inspect exported functions. @@ -154,4 +154,4 @@ issues: - unparam - testpackage severity: - default-severity: error \ No newline at end of file + default-severity: error diff --git a/.goreleaser.latest.yml b/.goreleaser.latest.yml index e0e8b41ae1..2503877bd6 100644 --- a/.goreleaser.latest.yml +++ b/.goreleaser.latest.yml @@ -10,7 +10,7 @@ builds: flags: - -a ldflags: - - -s -w -X github.com/odpf/optimus/config.BuildVersion=latest -X github.com/odpf/optimus/config.BuildCommit={{.FullCommit}} -X github.com/odpf/optimus/config.BuildDate={{.Date}} + - -s -w -X github.com/raystack/optimus/config.BuildVersion=latest -X github.com/raystack/optimus/config.BuildCommit={{.FullCommit}} -X github.com/raystack/optimus/config.BuildDate={{.Date}} goos: - linux - darwin @@ -21,12 +21,12 @@ builds: env: - CGO_ENABLED=0 archives: - - name_template: "{{ .ProjectName }}_latest_{{ .Os }}_{{ .Arch }}" - replacements: - darwin: macos - linux: linux - windows: windows - amd64: x86_64 + - name_template: >- + {{ .ProjectName }}_latest_ + {{- if eq .Os "darwin" }}macos + {{- else }}{{ .Os }}{{ end }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else }}{{ .Arch }}{{ end }} format_overrides: - goos: windows format: zip @@ -34,26 +34,25 @@ release: disable: true name_template: "{{.ProjectName}}-latest" checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" snapshot: name_template: "latest" changelog: sort: asc filters: exclude: - - '^docs' - - '^test' - - '^build' - - '^chore' + - "^docs" + - "^test" + - "^build" + - "^chore" dockers: - - - goos: linux + - goos: linux goarch: amd64 ids: - optimus dockerfile: Dockerfile image_templates: - - 'docker.io/odpf/{{.ProjectName}}:latest' - - 'docker.io/odpf/{{.ProjectName}}:latest-amd64' + - "docker.io/raystack/{{.ProjectName}}:latest" + - "docker.io/raystack/{{.ProjectName}}:latest-amd64" extra_files: - - entrypoint_init_container.sh \ No newline at end of file + - entrypoint_init_container.sh diff --git a/.goreleaser.yml b/.goreleaser.yml index 395d412e23..7d7394b2d5 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -10,7 +10,7 @@ builds: flags: - -a ldflags: - - -s -w -X github.com/odpf/optimus/config.BuildVersion={{ .Version }} -X github.com/odpf/optimus/config.BuildCommit={{.FullCommit}} -X github.com/odpf/optimus/config.BuildDate={{.Date}} + - -s -w -X github.com/raystack/optimus/config.BuildVersion={{ .Version }} -X github.com/raystack/optimus/config.BuildCommit={{.FullCommit}} -X github.com/raystack/optimus/config.BuildDate={{.Date}} goos: - linux - darwin @@ -33,37 +33,36 @@ release: draft: true prerelease: auto checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" snapshot: name_template: "{{ .Tag }}-next" changelog: sort: asc filters: exclude: - - '^docs' - - '^test' - - '^build' - - '^chore' + - "^docs" + - "^test" + - "^build" + - "^chore" dockers: - - - goos: linux + - goos: linux goarch: amd64 ids: - optimus dockerfile: Dockerfile image_templates: - - 'docker.io/odpf/{{.ProjectName}}:{{ .Version }}' - - 'docker.io/odpf/{{.ProjectName}}:{{ .Version }}-amd64' + - "docker.io/raystack/{{.ProjectName}}:{{ .Version }}" + - "docker.io/raystack/{{.ProjectName}}:{{ .Version }}-amd64" extra_files: - entrypoint_init_container.sh brews: - name: optimus tap: - owner: odpf + owner: raystack name: homebrew-tap license: "Apache 2.0" description: "Optimus helps your organization to build & manage data pipelines with ease." - homepage: https://odpf.github.io/optimus + homepage: https://raystack.github.io/optimus folder: Formula skip_upload: auto dependencies: @@ -71,5 +70,5 @@ brews: install: |- bin.install "optimus" commit_author: - name: github-actions[bot] - email: 41898282+github-actions[bot]@users.noreply.github.com \ No newline at end of file + name: Ravi Suhag + email: suhag.ravi@gmail.com diff --git a/Makefile b/Makefile index 09936e02db..4990784960 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ .ONESHELL: .DELETE_ON_ERROR: MAKEFLAGS += --no-builtin-rules -NAME = "github.com/odpf/optimus" +NAME = "github.com/raystack/optimus" LAST_COMMIT := $(shell git rev-parse --short HEAD) LAST_TAG := "$(shell git rev-list --tags --max-count=1)" OPMS_VERSION := "$(shell git describe --tags ${LAST_TAG})-next" -PROTON_COMMIT := "31ac9046d1a8c95a2f4645b87bf0620a3e6bb8bc" +PROTON_COMMIT := "1c39e65e529d573a1cd422e44f019c62d65fd10b" .PHONY: build test test-ci generate-proto unit-test-ci integration-test vet coverage clean install lint @@ -30,9 +30,9 @@ scheduler-resource-test: cd ./ext/scheduler/airflow2/tests && pip3 install -r requirements.txt && python3 -m unittest discover . generate-proto: ## regenerate protos - @echo " > generating protobuf from odpf/proton" + @echo " > generating protobuf from raystack/proton" @echo " > [info] make sure correct version of dependencies are installed using 'make install'" - @buf generate https://github.com/odpf/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path odpf/optimus + @buf generate https://github.com/raystack/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path raystack/optimus @echo " > protobuf compilation finished" unit-test-ci: @@ -53,9 +53,6 @@ bench: coverage: ## print code coverage go test -race -coverprofile coverage.txt -covermode=atomic ./... -tags=unit_test && go tool cover -html=coverage.txt -clean: - rm -rf ./optimus ./dist ./api/proto/* ./api/third_party/odpf/* - lint: golangci-lint run --fix diff --git a/README.md b/README.md index d322fccc58..21e61e1c2c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Optimus -[![verify workflow](https://github.com/odpf/optimus/actions/workflows/verify.yml/badge.svg)](verification) -[![publish latest workflow](https://github.com/odpf/optimus/actions/workflows/publish-latest.yml/badge.svg)](build) -[![Coverage Status](https://coveralls.io/repos/github/odpf/optimus/badge.svg?branch=main)](https://coveralls.io/github/odpf/optimus?branch=main) +[![verify workflow](https://github.com/raystack/optimus/actions/workflows/verify.yml/badge.svg)](verification) +[![publish latest workflow](https://github.com/raystack/optimus/actions/workflows/publish-latest.yml/badge.svg)](build) +[![Coverage Status](https://coveralls.io/repos/github/raystack/optimus/badge.svg?branch=main)](https://coveralls.io/github/raystack/optimus?branch=main) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?logo=apache)](LICENSE) -[![Version](https://img.shields.io/github/v/release/odpf/optimus?logo=semantic-release)](Version) +[![Version](https://img.shields.io/github/v/release/raystack/optimus?logo=semantic-release)](Version) Optimus is an easy-to-use, reliable, and performant workflow orchestrator for data transformation, data modeling, pipelines, and data quality management. It enables data analysts and engineers to transform their data by writing simple SQL queries and YAML configuration while Optimus handles dependency management, scheduling and all other aspects of running transformation jobs at scale. @@ -29,7 +29,7 @@ Discover why users choose Optimus as their main data transformation tool. Optimus has two components, Optimus service that is the core orchestrator installed on server side, and a CLI binary used to interact with this service. You can install Optimus CLI using homebrew on macOS: ```shell -$ brew install odpf/tap/optimus +$ brew install raystack/tap/optimus $ optimus --help Optimus is an easy-to-use, reliable, and performant workflow orchestrator for @@ -67,10 +67,10 @@ Use "optimus [command] --help" for more information about a command. Explore the following resources to get started with Optimus: -- [Guides](https://odpf.github.io/optimus/docs/guides/create-job/) provides guidance on using Optimus. -- [Concepts](https://odpf.github.io/optimus/docs/concepts/overview/) describes all important Optimus concepts. -- [Reference](https://odpf.github.io/optimus/docs/reference/api/) contains details about configurations, metrics and other aspects of Optimus. -- [Contribute](https://odpf.github.io/optimus/docs/contribute/contributing/) contains resources for anyone who wants to contribute to Optimus. +- [Guides](https://raystack.github.io/optimus/docs/guides/create-job/) provides guidance on using Optimus. +- [Concepts](https://raystack.github.io/optimus/docs/concepts/overview/) describes all important Optimus concepts. +- [Reference](https://raystack.github.io/optimus/docs/reference/api/) contains details about configurations, metrics and other aspects of Optimus. +- [Contribute](https://raystack.github.io/optimus/docs/contribute/contributing/) contains resources for anyone who wants to contribute to Optimus. ## Running locally @@ -82,7 +82,7 @@ Optimus requires the following dependencies: Run the following commands to compile `optimus` from source ```shell -$ git clone git@github.com:odpf/optimus.git +$ git clone git@github.com:raystack/optimus.git $ cd optimus $ make ``` @@ -99,7 +99,7 @@ Optimus service can be started with $ ./optimus serve ``` -`serve` command has few required configurations that needs to be set for it to start. Read more about it in [getting started](https://odpf.github.io/optimus/docs/getting-started/configuration). +`serve` command has few required configurations that needs to be set for it to start. Read more about it in [getting started](https://raystack.github.io/optimus/docs/getting-started/configuration). ## Compatibility @@ -109,9 +109,9 @@ Optimus is currently undergoing heavy development with frequent, breaking API ch Development of Optimus happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Optimus. -Read our [contributing guide](https://odpf.github.io/optimus/docs/contribute/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Optimus. +Read our [contributing guide](https://raystack.github.io/optimus/docs/contribute/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Optimus. -To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first issues](https://github.com/odpf/optimus/labels/good%20first%20issue) that contain bugs which have a relatively limited scope. This is a great place to get started. +To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first issues](https://github.com/raystack/optimus/labels/good%20first%20issue) that contain bugs which have a relatively limited scope. This is a great place to get started. ## License diff --git a/buf.gen.yaml b/buf.gen.yaml index a46d1c1099..dc908e7349 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -7,7 +7,7 @@ plugins: # proto file should be. # This is necessary while importing a proto file foo/a.proto from another # directory, e.g. bar/b.proto - opt: paths=source_relative,Modpf/optimus/core/v1beta1/job_run.proto=github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1,Modpf/optimus/core/v1beta1/project.proto=github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1,Modpf/optimus/core/v1beta1/namespace.proto=github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1,Modpf/optimus/core/v1beta1/job_spec.proto=github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1,Modpf/optimus/core/v1beta1/scheduler.proto=github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1,Modpf/optimus/core/v1beta1/status.proto=github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1,Modpf/optimus/core/v1beta1/resource.proto=github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1 + opt: paths=source_relative,Mraystack/optimus/core/v1beta1/job_run.proto=github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1,Mraystack/optimus/core/v1beta1/project.proto=github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1,Mraystack/optimus/core/v1beta1/namespace.proto=github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1,Mraystack/optimus/core/v1beta1/job_spec.proto=github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1,Mraystack/optimus/core/v1beta1/scheduler.proto=github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1,Mraystack/optimus/core/v1beta1/status.proto=github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1,Mraystack/optimus/core/v1beta1/resource.proto=github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1 - name: go-grpc out: protos opt: paths=source_relative,require_unimplemented_servers=true @@ -15,4 +15,4 @@ plugins: out: protos opt: paths=source_relative - name: openapiv2 - out: protos \ No newline at end of file + out: protos diff --git a/client/cmd/backup/create.go b/client/cmd/backup/create.go index 86f3e80809..0b9f739411 100644 --- a/client/cmd/backup/create.go +++ b/client/cmd/backup/create.go @@ -7,20 +7,22 @@ import ( "fmt" "strings" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/progressbar" - "github.com/odpf/optimus/client/cmd/internal/survey" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/progressbar" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type createCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string isConfigExist bool @@ -128,6 +130,7 @@ func (c *createCommand) fillAttributes(conf *config.ClientConfig) error { } } } + c.connection = connection.New(c.logger, conf) return nil } @@ -150,13 +153,13 @@ func (c *createCommand) RunE(_ *cobra.Command, _ []string) error { } func (c *createCommand) runBackupRequest() error { - conn, err := connectivity.NewConnectivity(c.host, backupTimeout) + conn, err := c.connection.Create(c.host) if err != nil { return err } defer conn.Close() - backup := pb.NewBackupServiceClient(conn.GetConnection()) + backup := pb.NewBackupServiceClient(conn) spinner := progressbar.NewProgressBar() spinner.Start("please wait...") @@ -169,7 +172,11 @@ func (c *createCommand) runBackupRequest() error { Description: c.description, Config: c.dsBackupConfigUnmarshaled, } - backupResponse, err := backup.CreateBackup(conn.GetContext(), backupRequest) + + ctx, dialCancel := context.WithTimeout(context.Background(), backupTimeout) + defer dialCancel() + + backupResponse, err := backup.CreateBackup(ctx, backupRequest) spinner.Stop() if err != nil { diff --git a/client/cmd/backup/list.go b/client/cmd/backup/list.go index 3974cf0866..5c55cba65f 100644 --- a/client/cmd/backup/list.go +++ b/client/cmd/backup/list.go @@ -8,17 +8,17 @@ import ( "strings" "time" - "github.com/odpf/salt/log" "github.com/olekukonko/tablewriter" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/progressbar" - "github.com/odpf/optimus/client/cmd/internal/survey" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/progressbar" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( @@ -26,7 +26,9 @@ const ( ) type listCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string namespaceSurvey *survey.NamespaceSurvey @@ -93,6 +95,8 @@ func (l *listCommand) PreRunE(cmd *cobra.Command, _ []string) error { l.namespaceName = namespace.Name } + l.connection = connection.New(l.logger, conf) + return nil } @@ -103,7 +107,7 @@ func (l *listCommand) RunE(_ *cobra.Command, _ []string) error { NamespaceName: l.namespaceName, } - conn, err := connectivity.NewConnectivity(l.host, backupTimeout) + conn, err := l.connection.Create(l.host) if err != nil { return err } @@ -111,8 +115,12 @@ func (l *listCommand) RunE(_ *cobra.Command, _ []string) error { spinner := progressbar.NewProgressBar() spinner.Start("please wait...") - backup := pb.NewBackupServiceClient(conn.GetConnection()) - listBackupsResponse, err := backup.ListBackups(conn.GetContext(), listBackupsRequest) + backup := pb.NewBackupServiceClient(conn) + + ctx, dialCancel := context.WithTimeout(context.Background(), backupTimeout) + defer dialCancel() + + listBackupsResponse, err := backup.ListBackups(ctx, listBackupsRequest) spinner.Stop() if err != nil { if errors.Is(err, context.DeadlineExceeded) { diff --git a/client/cmd/backup/status.go b/client/cmd/backup/status.go index 941515d88f..8b6e42a560 100644 --- a/client/cmd/backup/status.go +++ b/client/cmd/backup/status.go @@ -8,20 +8,22 @@ import ( "strings" "time" - "github.com/odpf/salt/log" "github.com/olekukonko/tablewriter" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/progressbar" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/progressbar" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type statusCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string projectName string @@ -76,6 +78,8 @@ func (s *statusCommand) PreRunE(cmd *cobra.Command, _ []string) error { if s.host == "" { s.host = conf.Host } + + s.connection = connection.New(s.logger, conf) return nil } @@ -86,17 +90,21 @@ func (s *statusCommand) RunE(_ *cobra.Command, args []string) error { Id: args[0], } - conn, err := connectivity.NewConnectivity(s.host, backupTimeout) + conn, err := s.connection.Create(s.host) if err != nil { return err } defer conn.Close() - backup := pb.NewBackupServiceClient(conn.GetConnection()) + backup := pb.NewBackupServiceClient(conn) spinner := progressbar.NewProgressBar() spinner.Start("please wait...") - backupDetailResponse, err := backup.GetBackup(conn.GetContext(), getBackupRequest) + + ctx, dialCancel := context.WithTimeout(context.Background(), backupTimeout) + defer dialCancel() + + backupDetailResponse, err := backup.GetBackup(ctx, getBackupRequest) spinner.Stop() if err != nil { if errors.Is(err, context.DeadlineExceeded) { diff --git a/client/cmd/commands.go b/client/cmd/commands.go index 23c4e8fea0..9530775199 100644 --- a/client/cmd/commands.go +++ b/client/cmd/commands.go @@ -2,22 +2,22 @@ package cmd import ( "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/cmdx" + "github.com/raystack/salt/cmdx" cli "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/backup" - "github.com/odpf/optimus/client/cmd/extension" - "github.com/odpf/optimus/client/cmd/initialize" - "github.com/odpf/optimus/client/cmd/job" - "github.com/odpf/optimus/client/cmd/namespace" - "github.com/odpf/optimus/client/cmd/playground" - "github.com/odpf/optimus/client/cmd/plugin" - "github.com/odpf/optimus/client/cmd/project" - "github.com/odpf/optimus/client/cmd/replay" - "github.com/odpf/optimus/client/cmd/resource" - "github.com/odpf/optimus/client/cmd/scheduler" - "github.com/odpf/optimus/client/cmd/secret" - "github.com/odpf/optimus/client/cmd/version" + "github.com/raystack/optimus/client/cmd/backup" + "github.com/raystack/optimus/client/cmd/extension" + "github.com/raystack/optimus/client/cmd/initialize" + "github.com/raystack/optimus/client/cmd/job" + "github.com/raystack/optimus/client/cmd/namespace" + "github.com/raystack/optimus/client/cmd/playground" + "github.com/raystack/optimus/client/cmd/plugin" + "github.com/raystack/optimus/client/cmd/project" + "github.com/raystack/optimus/client/cmd/replay" + "github.com/raystack/optimus/client/cmd/resource" + "github.com/raystack/optimus/client/cmd/scheduler" + "github.com/raystack/optimus/client/cmd/secret" + "github.com/raystack/optimus/client/cmd/version" ) // New constructs the 'root' command. It houses all other sub commands @@ -45,10 +45,10 @@ func New() *cli.Command { "group:core": "true", "help:learn": heredoc.Doc(` Use 'optimus --help' for more information about a command. - Read the manual at https://odpf.github.io/optimus/ + Read the manual at https://raystack.github.io/optimus/ `), "help:feedback": heredoc.Doc(` - Open an issue here https://github.com/odpf/optimus/issues + Open an issue here https://github.com/raystack/optimus/issues `), }, } diff --git a/client/cmd/extension/activate.go b/client/cmd/extension/activate.go index 8a4adecfb0..0ef827bc51 100644 --- a/client/cmd/extension/activate.go +++ b/client/cmd/extension/activate.go @@ -3,10 +3,10 @@ package extension import ( "errors" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) type activateCommand struct { diff --git a/client/cmd/extension/clean.go b/client/cmd/extension/clean.go index aa35043116..fcccf90e38 100644 --- a/client/cmd/extension/clean.go +++ b/client/cmd/extension/clean.go @@ -1,11 +1,11 @@ package extension import ( - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/survey" - "github.com/odpf/optimus/client/extension" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/client/extension" ) type cleanCommand struct { diff --git a/client/cmd/extension/describe.go b/client/cmd/extension/describe.go index 05e159c226..93b7621c2e 100644 --- a/client/cmd/extension/describe.go +++ b/client/cmd/extension/describe.go @@ -4,11 +4,11 @@ import ( "bytes" "fmt" - "github.com/odpf/salt/log" "github.com/olekukonko/tablewriter" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) type describeCommand struct { diff --git a/client/cmd/extension/extension.go b/client/cmd/extension/extension.go index fe7961b419..191aabd796 100644 --- a/client/cmd/extension/extension.go +++ b/client/cmd/extension/extension.go @@ -4,12 +4,12 @@ import ( "fmt" "os" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/extension" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/extension" + "github.com/raystack/optimus/client/extension/model" ) // UpdateWithExtension updates input command with the available extensions diff --git a/client/cmd/extension/install.go b/client/cmd/extension/install.go index f44096e955..9c3ce594dc 100644 --- a/client/cmd/extension/install.go +++ b/client/cmd/extension/install.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" ) diff --git a/client/cmd/extension/rename.go b/client/cmd/extension/rename.go index 7ff5342f81..4b58c5b4d0 100644 --- a/client/cmd/extension/rename.go +++ b/client/cmd/extension/rename.go @@ -3,10 +3,10 @@ package extension import ( "errors" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) type renameCommand struct { diff --git a/client/cmd/extension/uninstall.go b/client/cmd/extension/uninstall.go index f11df1142e..c89577a8f8 100644 --- a/client/cmd/extension/uninstall.go +++ b/client/cmd/extension/uninstall.go @@ -1,11 +1,11 @@ package extension import ( - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/survey" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/client/extension/model" ) type uninstallCommand struct { diff --git a/client/cmd/extension/upgrade.go b/client/cmd/extension/upgrade.go index 55a8f6dccc..88bfc0cca5 100644 --- a/client/cmd/extension/upgrade.go +++ b/client/cmd/extension/upgrade.go @@ -3,10 +3,10 @@ package extension import ( "context" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) type upgradeCommand struct { diff --git a/client/cmd/initialize/initialize.go b/client/cmd/initialize/initialize.go index 91c8b2cf1b..fe06db6e26 100644 --- a/client/cmd/initialize/initialize.go +++ b/client/cmd/initialize/initialize.go @@ -6,14 +6,14 @@ import ( "os" "path" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" "gopkg.in/yaml.v2" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/survey" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/utils" ) type initializeCommand struct { diff --git a/client/cmd/internal/auth/auth.go b/client/cmd/internal/auth/auth.go new file mode 100644 index 0000000000..6a8406807b --- /dev/null +++ b/client/cmd/internal/auth/auth.go @@ -0,0 +1,59 @@ +package auth + +import ( + "context" + + "github.com/raystack/salt/log" + "github.com/raystack/salt/oidc" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + + "github.com/raystack/optimus/config" +) + +type Auth struct { + logger log.Logger + cfg *oauth2.Config +} + +func NewAuth(logger log.Logger, authConfig config.Auth) *Auth { + return &Auth{ + logger: logger, + cfg: toAuthConfig(authConfig), + } +} + +func (a Auth) GetToken(ctx context.Context) (*oauth2.Token, error) { + token, err := RetrieveFromKeyring(a.cfg.ClientID) + if err == nil { + return token, nil + } + + token, err = a.getTokenFromServer(ctx, a.cfg) + if err == nil { + err = StoreInKeyring(a.cfg.ClientID, token) + if err != nil { + a.logger.Debug("not able to save token in keyring") + } + return token, nil + } + return nil, err +} + +func (Auth) getTokenFromServer(ctx context.Context, cfg *oauth2.Config) (*oauth2.Token, error) { + source := oidc.NewTokenSource(ctx, cfg, cfg.ClientID) + return source.Token() +} + +func toAuthConfig(authConfig config.Auth) *oauth2.Config { + callbackURL := "http://localhost:9090/auth/callback" + cfg := &oauth2.Config{ + ClientID: authConfig.ClientID, + ClientSecret: authConfig.ClientSecret, + Endpoint: google.Endpoint, + RedirectURL: callbackURL, + Scopes: []string{"openid email"}, + } + + return cfg +} diff --git a/client/cmd/internal/auth/keyring.go b/client/cmd/internal/auth/keyring.go new file mode 100644 index 0000000000..298fea3f9f --- /dev/null +++ b/client/cmd/internal/auth/keyring.go @@ -0,0 +1,41 @@ +package auth + +import ( + "encoding/json" + "errors" + + "github.com/zalando/go-keyring" + "golang.org/x/oauth2" +) + +const ( + keyringService = "optimus" +) + +func RetrieveFromKeyring(clientID string) (*oauth2.Token, error) { + tokenStr, err := keyring.Get(keyringService, clientID) + if err != nil { + return nil, err + } + + var token oauth2.Token + if err := json.Unmarshal([]byte(tokenStr), &token); err != nil { + return nil, err + } + + if !token.Valid() { + return nil, errors.New("token is not valid") + } + + return &token, err +} + +func StoreInKeyring(clientID string, t *oauth2.Token) error { + tokenBytes, err := json.Marshal(t) + if err != nil { + return err + } + + tokenStr := string(tokenBytes) + return keyring.Set(keyringService, clientID, tokenStr) +} diff --git a/client/cmd/internal/connection/connection.go b/client/cmd/internal/connection/connection.go new file mode 100644 index 0000000000..545f688eed --- /dev/null +++ b/client/cmd/internal/connection/connection.go @@ -0,0 +1,77 @@ +package connection + +import ( + "errors" + "os" + "time" + + "github.com/MakeNowJust/heredoc" + grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" + grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" + grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" + "github.com/raystack/salt/log" + "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + "google.golang.org/grpc" + + "github.com/raystack/optimus/config" +) + +const ( + grpcMaxClientSendSize = 128 << 20 // 128MB + grpcMaxClientRecvSize = 128 << 20 // 128MB + grpcMaxRetry uint = 3 + + optimusDialTimeout = time.Second * 2 + backoffDuration = 100 * time.Millisecond +) + +var errServerNotReachable = func(host string) error { + return errors.New(heredoc.Docf(`Unable to reach optimus server at %s, this can happen due to following reasons: + 1. Check if you are connected to internet + 2. Is the host correctly configured in optimus config + 3. Is Optimus server currently unreachable`, host)) +} + +type Connection interface { + Create(host string) (*grpc.ClientConn, error) +} + +func New(l log.Logger, cfg *config.ClientConfig) Connection { + if useInsecure() { + return NewInsecure(l) + } + + return NewSecure(l, cfg) +} + +func useInsecure() bool { + if insecure := os.Getenv("OPTIMUS_INSECURE"); insecure != "" { + return true + } + return false +} + +func defaultDialOptions() []grpc.DialOption { + retryOpts := []grpc_retry.CallOption{ + grpc_retry.WithBackoff(grpc_retry.BackoffExponential(backoffDuration)), + grpc_retry.WithMax(grpcMaxRetry), + } + var opts []grpc.DialOption + opts = append(opts, + grpc.WithBlock(), + grpc.WithDefaultCallOptions( + grpc.MaxCallSendMsgSize(grpcMaxClientSendSize), + grpc.MaxCallRecvMsgSize(grpcMaxClientRecvSize), + ), + grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient( + grpc_retry.UnaryClientInterceptor(retryOpts...), + otelgrpc.UnaryClientInterceptor(), + grpc_prometheus.UnaryClientInterceptor, + )), + grpc.WithStreamInterceptor(grpc_middleware.ChainStreamClient( + otelgrpc.StreamClientInterceptor(), + grpc_prometheus.StreamClientInterceptor, + )), + ) + return opts +} diff --git a/client/cmd/internal/connection/insecure.go b/client/cmd/internal/connection/insecure.go new file mode 100644 index 0000000000..1aad043ae6 --- /dev/null +++ b/client/cmd/internal/connection/insecure.go @@ -0,0 +1,34 @@ +package connection + +import ( + "context" + "errors" + + "github.com/raystack/salt/log" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +type Insecure struct { + l log.Logger +} + +func NewInsecure(l log.Logger) *Insecure { + return &Insecure{ + l: l, + } +} + +func (*Insecure) Create(host string) (*grpc.ClientConn, error) { + ctx, dialCancel := context.WithTimeout(context.Background(), optimusDialTimeout) + defer dialCancel() + + opts := append(defaultDialOptions(), grpc.WithTransportCredentials(insecure.NewCredentials())) + + conn, err := grpc.DialContext(ctx, host, opts...) + if errors.Is(err, context.DeadlineExceeded) { + err = errServerNotReachable(host) + } + + return conn, err +} diff --git a/client/cmd/internal/connection/secure.go b/client/cmd/internal/connection/secure.go new file mode 100644 index 0000000000..db32541eaa --- /dev/null +++ b/client/cmd/internal/connection/secure.go @@ -0,0 +1,95 @@ +package connection + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "time" + + "github.com/raystack/salt/log" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + + "github.com/raystack/optimus/client/cmd/internal/auth" + "github.com/raystack/optimus/config" +) + +const authTimeout = time.Minute * 1 + +type Secure struct { + l log.Logger + authConfig config.Auth +} + +func NewSecure(l log.Logger, cfg *config.ClientConfig) *Secure { + return &Secure{ + l: l, + authConfig: cfg.Auth, + } +} + +func (s *Secure) Create(host string) (*grpc.ClientConn, error) { + ctx, dialCancel := context.WithTimeout(context.Background(), optimusDialTimeout) + defer dialCancel() + + opts, err := s.getOptionsWithAuth() + if err != nil { + return nil, err + } + + conn, err := grpc.DialContext(ctx, host, opts...) + if errors.Is(err, context.DeadlineExceeded) { + err = errServerNotReachable(host) + } + + return conn, err +} + +func (s *Secure) getOptionsWithAuth() ([]grpc.DialOption, error) { + if s.authConfig.ClientID == "" || s.authConfig.ClientSecret == "" { + return nil, errors.New("invalid auth configuration, clientID or clientSecret is empty") + } + + // setup https connection + tlsCredentials, err := loadTLSCredentials() + if err != nil { + return nil, err + } + + opts := append(defaultDialOptions(), grpc.WithTransportCredentials(tlsCredentials)) + + // add the token for authentication + a := auth.NewAuth(s.l, s.authConfig) + + ctx, dialCancel := context.WithTimeout(context.Background(), authTimeout) + defer dialCancel() + + token, err := a.GetToken(ctx) + if err != nil { + return nil, err + } + if token == nil { + return nil, errors.New("unable to get valid token") + } + + opts = append(opts, grpc.WithPerRPCCredentials(&bearerAuthentication{ + Token: token.AccessToken, + })) + + return opts, nil +} + +func loadTLSCredentials() (credentials.TransportCredentials, error) { + certPool, err := x509.SystemCertPool() + if err != nil { + return nil, fmt.Errorf("unable to read system certs") + } + + tlsConfig := &tls.Config{ + RootCAs: certPool, + MinVersion: tls.VersionTLS12, + } + return credentials.NewTLS(tlsConfig), nil +} diff --git a/client/cmd/internal/connectivity/authentication.go b/client/cmd/internal/connection/token_auth.go similarity index 50% rename from client/cmd/internal/connectivity/authentication.go rename to client/cmd/internal/connection/token_auth.go index b03c5c6896..dbd002358a 100644 --- a/client/cmd/internal/connectivity/authentication.go +++ b/client/cmd/internal/connection/token_auth.go @@ -1,4 +1,4 @@ -package connectivity +package connection import ( "context" @@ -18,17 +18,3 @@ func (a *bearerAuthentication) GetRequestMetadata(context.Context, ...string) (m func (*bearerAuthentication) RequireTransportSecurity() bool { return false } - -type basicAuthentication struct { - Token string -} - -func (a *basicAuthentication) GetRequestMetadata(context.Context, ...string) (map[string]string, error) { - return map[string]string{ - "Authorization": fmt.Sprintf("Basic %s", a.Token), - }, nil -} - -func (*basicAuthentication) RequireTransportSecurity() bool { - return false -} diff --git a/client/cmd/internal/connectivity/connectivity.go b/client/cmd/internal/connectivity/connectivity.go deleted file mode 100644 index 6fb5749cdf..0000000000 --- a/client/cmd/internal/connectivity/connectivity.go +++ /dev/null @@ -1,120 +0,0 @@ -package connectivity - -import ( - "context" - "encoding/base64" - "errors" - "os" - "time" - - "github.com/MakeNowJust/heredoc" - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" - grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" - grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" - "google.golang.org/grpc" -) - -const ( - grpcMaxClientSendSize = 128 << 20 // 128MB - grpcMaxClientRecvSize = 128 << 20 // 128MB - grpcMaxRetry uint = 3 - - optimusDialTimeout = time.Second * 2 - backoffDuration = 100 * time.Millisecond -) - -var errServerNotReachable = func(host string) error { - return errors.New(heredoc.Docf(`Unable to reach optimus server at %s, this can happen due to following reasons: - 1. Check if you are connected to internet - 2. Is the host correctly configured in optimus config - 3. Is Optimus server currently unreachable`, host)) -} - -// Connectivity defines client connection to a targeted server host -type Connectivity struct { - requestCtx context.Context //nolint:containedctx - cancelRequestCtx func() - - connection *grpc.ClientConn -} - -// NewConnectivity initializes client connection -func NewConnectivity(serverHost string, requestTimeout time.Duration) (*Connectivity, error) { - connection, err := createConnection(serverHost) - if err != nil { - return nil, err - } - reqCtx, reqCancel := context.WithTimeout(context.Background(), requestTimeout) - return &Connectivity{ - requestCtx: reqCtx, - cancelRequestCtx: reqCancel, - connection: connection, - }, nil -} - -// GetContext gets request context -func (c *Connectivity) GetContext() context.Context { - return c.requestCtx -} - -// GetConnection gets client connection -func (c *Connectivity) GetConnection() *grpc.ClientConn { - return c.connection -} - -// Close closes client connection and its context -func (c *Connectivity) Close() { - c.connection.Close() - c.cancelRequestCtx() -} - -func createConnection(host string) (*grpc.ClientConn, error) { - opts := getDefaultDialOptions() - - // pass rpc credentials - if token := os.Getenv("OPTIMUS_AUTH_BASIC_TOKEN"); token != "" { - base64Token := base64.StdEncoding.EncodeToString([]byte(token)) - opts = append(opts, grpc.WithPerRPCCredentials(&basicAuthentication{ - Token: base64Token, - })) - } else if token := os.Getenv("OPTIMUS_AUTH_BEARER_TOKEN"); token != "" { - opts = append(opts, grpc.WithPerRPCCredentials(&bearerAuthentication{ - Token: token, - })) - } - - ctx, dialCancel := context.WithTimeout(context.Background(), optimusDialTimeout) - conn, err := grpc.DialContext(ctx, host, opts...) - if errors.Is(err, context.DeadlineExceeded) { - err = errServerNotReachable(host) - } - dialCancel() - return conn, err -} - -func getDefaultDialOptions() []grpc.DialOption { - retryOpts := []grpc_retry.CallOption{ - grpc_retry.WithBackoff(grpc_retry.BackoffExponential(backoffDuration)), - grpc_retry.WithMax(grpcMaxRetry), - } - var opts []grpc.DialOption - opts = append(opts, - grpc.WithInsecure(), - grpc.WithBlock(), - grpc.WithDefaultCallOptions( - grpc.MaxCallSendMsgSize(grpcMaxClientSendSize), - grpc.MaxCallRecvMsgSize(grpcMaxClientRecvSize), - ), - grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient( - grpc_retry.UnaryClientInterceptor(retryOpts...), - otelgrpc.UnaryClientInterceptor(), - grpc_prometheus.UnaryClientInterceptor, - )), - grpc.WithStreamInterceptor(grpc_middleware.ChainStreamClient( - otelgrpc.StreamClientInterceptor(), - grpc_prometheus.StreamClientInterceptor, - )), - ) - return opts -} diff --git a/client/cmd/internal/load_client_config.go b/client/cmd/internal/load_client_config.go index 82d42ef8cc..bed44e323b 100644 --- a/client/cmd/internal/load_client_config.go +++ b/client/cmd/internal/load_client_config.go @@ -3,9 +3,9 @@ package internal import ( "errors" - saltConfig "github.com/odpf/salt/config" + saltConfig "github.com/raystack/salt/config" - "github.com/odpf/optimus/config" + "github.com/raystack/optimus/config" ) // TODO: need to do refactor for proper file naming diff --git a/client/cmd/internal/logger/logger.go b/client/cmd/internal/logger/logger.go index e1c721be20..d3718d738a 100644 --- a/client/cmd/internal/logger/logger.go +++ b/client/cmd/internal/logger/logger.go @@ -6,7 +6,7 @@ import ( "os" "github.com/fatih/color" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" ) type defaultLogger struct { diff --git a/client/cmd/internal/logger/printer.go b/client/cmd/internal/logger/printer.go index 9f4f40f975..276e292545 100644 --- a/client/cmd/internal/logger/printer.go +++ b/client/cmd/internal/logger/printer.go @@ -1,9 +1,9 @@ package logger import ( - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) func PrintLogStatusVerbose(logger log.Logger, logStatus *pb.Log) { diff --git a/client/cmd/internal/manage_plugins.go b/client/cmd/internal/manage_plugins.go index 2af1f817c9..2d7107ac17 100644 --- a/client/cmd/internal/manage_plugins.go +++ b/client/cmd/internal/manage_plugins.go @@ -6,9 +6,9 @@ import ( "github.com/hashicorp/go-hclog" hPlugin "github.com/hashicorp/go-plugin" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/models" - oPlugin "github.com/odpf/optimus/plugin" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/models" + oPlugin "github.com/raystack/optimus/plugin" ) // InitPlugins triggers initialization of all available plugins diff --git a/client/cmd/internal/progressbar/progress_bar.go b/client/cmd/internal/progressbar/progress_bar.go index faeb731ca7..a778240704 100644 --- a/client/cmd/internal/progressbar/progress_bar.go +++ b/client/cmd/internal/progressbar/progress_bar.go @@ -1,6 +1,7 @@ package progressbar import ( + "fmt" "io" "os" "strings" @@ -10,7 +11,7 @@ import ( "github.com/briandowns/spinner" "github.com/schollz/progressbar/v3" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/utils" ) const ( @@ -67,6 +68,14 @@ func (p *ProgressBar) Start(label string) { p.spinner = sp } +func (p *ProgressBar) StartNewLine(label string) { + p.spinner.FinalMSG = fmt.Sprintf("✓%s", p.spinner.Suffix) + p.Stop() + p.writer.Write([]byte("\n")) + p.spinner = nil + p.Start(label) +} + // StartProgress starts progress bar with count and label func (p *ProgressBar) StartProgress(count int, label string) { p.mu.Lock() diff --git a/client/cmd/internal/survey/backup_create.go b/client/cmd/internal/survey/backup_create.go index 6aba151aa7..aa7b066a1f 100644 --- a/client/cmd/internal/survey/backup_create.go +++ b/client/cmd/internal/survey/backup_create.go @@ -2,7 +2,7 @@ package survey import ( "github.com/AlecAivazis/survey/v2" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" ) // BackupCreateSurvey defines survey for creating backup diff --git a/client/cmd/internal/survey/initialize.go b/client/cmd/internal/survey/initialize.go index 24eb48fb10..74ea5ce501 100644 --- a/client/cmd/internal/survey/initialize.go +++ b/client/cmd/internal/survey/initialize.go @@ -5,10 +5,10 @@ import ( "path" "github.com/AlecAivazis/survey/v2" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/utils" ) // InititalizeSurvey defines surveys related to init client config diff --git a/client/cmd/internal/survey/job.go b/client/cmd/internal/survey/job.go index 9b9dd3a129..a7ea167cae 100644 --- a/client/cmd/internal/survey/job.go +++ b/client/cmd/internal/survey/job.go @@ -9,9 +9,9 @@ import ( "github.com/AlecAivazis/survey/v2" - "github.com/odpf/optimus/client/local" - "github.com/odpf/optimus/client/local/model" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/client/local" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/sdk/plugin" ) // JobSurvey defines survey for job specification in general diff --git a/client/cmd/internal/survey/job_addhook.go b/client/cmd/internal/survey/job_addhook.go index b1db35af84..29fc096181 100644 --- a/client/cmd/internal/survey/job_addhook.go +++ b/client/cmd/internal/survey/job_addhook.go @@ -7,9 +7,9 @@ import ( "github.com/AlecAivazis/survey/v2" - "github.com/odpf/optimus/client/local/model" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/sdk/plugin" ) // JobAddHookSurvey defines survey for job add hook diff --git a/client/cmd/internal/survey/job_create.go b/client/cmd/internal/survey/job_create.go index 5cf872379a..7907bb08f1 100644 --- a/client/cmd/internal/survey/job_create.go +++ b/client/cmd/internal/survey/job_create.go @@ -9,11 +9,11 @@ import ( "github.com/AlecAivazis/survey/v2" - "github.com/odpf/optimus/client/local" - "github.com/odpf/optimus/client/local/model" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/internal/utils" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/client/local" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/internal/utils" + "github.com/raystack/optimus/sdk/plugin" ) const ( @@ -210,7 +210,6 @@ func (j *JobCreateSurvey) askCreateQuestions(questions []*survey.Question) (mode }, Asset: map[string]string{}, Behavior: model.JobSpecBehavior{ - Catchup: false, DependsOnPast: false, }, Dependencies: []model.JobSpecDependency{}, diff --git a/client/cmd/internal/survey/namespace.go b/client/cmd/internal/survey/namespace.go index 71b892ab84..516cb533ca 100644 --- a/client/cmd/internal/survey/namespace.go +++ b/client/cmd/internal/survey/namespace.go @@ -4,9 +4,9 @@ import ( "errors" "github.com/AlecAivazis/survey/v2" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" - "github.com/odpf/optimus/config" + "github.com/raystack/optimus/config" ) // NamespaceSurvey defines surveys related to namespace diff --git a/client/cmd/internal/survey/resource_create.go b/client/cmd/internal/survey/resource_create.go index 6030081ee8..2232474a7a 100644 --- a/client/cmd/internal/survey/resource_create.go +++ b/client/cmd/internal/survey/resource_create.go @@ -7,8 +7,8 @@ import ( "github.com/AlecAivazis/survey/v2" - "github.com/odpf/optimus/client/local" - "github.com/odpf/optimus/client/local/model" + "github.com/raystack/optimus/client/local" + "github.com/raystack/optimus/client/local/model" ) // ResourceSpecCreateSurvey defines surveys for resource spec creation diff --git a/client/cmd/internal/survey/survey.go b/client/cmd/internal/survey/survey.go index fe2e621b99..6583eacb0c 100644 --- a/client/cmd/internal/survey/survey.go +++ b/client/cmd/internal/survey/survey.go @@ -8,7 +8,7 @@ import ( petname "github.com/dustinkirkland/golang-petname" "github.com/spf13/afero" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/utils" ) const ( diff --git a/client/cmd/job/addhook.go b/client/cmd/job/addhook.go index a932c50785..a0c4169c04 100644 --- a/client/cmd/job/addhook.go +++ b/client/cmd/job/addhook.go @@ -1,16 +1,16 @@ package job import ( - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/survey" - "github.com/odpf/optimus/client/local/specio" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/models" ) type addHookCommand struct { diff --git a/client/cmd/job/change_namespace.go b/client/cmd/job/change_namespace.go new file mode 100644 index 0000000000..7869ec42cb --- /dev/null +++ b/client/cmd/job/change_namespace.go @@ -0,0 +1,191 @@ +package job + +import ( + "context" + "fmt" + "os" + "path/filepath" + "strings" + "time" + + "github.com/raystack/salt/log" + "github.com/spf13/afero" + "github.com/spf13/cobra" + + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" +) + +const ( + changeNamespaceTimeout = time.Minute * 1 +) + +type changeNamespaceCommand struct { + logger log.Logger + connection connection.Connection + + configFilePath string + clientConfig *config.ClientConfig + + project string + oldNamespaceName string + newNamespaceName string + host string +} + +// NewChangeNamespaceCommand initializes job namespace change command +func NewChangeNamespaceCommand() *cobra.Command { + l := logger.NewClientLogger() + changeNamespace := &changeNamespaceCommand{ + logger: l, + } + cmd := &cobra.Command{ + Use: "change-namespace", + Short: "Change namespace of a Job", + Example: "optimus job change-namespace --old-namespace --new-namespace ", + Args: cobra.MinimumNArgs(1), + PreRunE: changeNamespace.PreRunE, + RunE: changeNamespace.RunE, + PostRunE: changeNamespace.PostRunE, + } + // Config filepath flag + cmd.Flags().StringVarP(&changeNamespace.configFilePath, "config", "c", config.EmptyPath, "File path for client configuration") + internal.MarkFlagsRequired(cmd, []string{"old-namespace", "new-namespace"}) + changeNamespace.injectFlags(cmd) + + return cmd +} + +func (c *changeNamespaceCommand) injectFlags(cmd *cobra.Command) { + // Mandatory flags + cmd.Flags().StringVarP(&c.oldNamespaceName, "old-namespace", "o", "", "current namespace of the job") + cmd.Flags().StringVarP(&c.newNamespaceName, "new-namespace", "n", "", "namespace to which the job needs to be moved to") + + // Mandatory flags if config is not set + cmd.Flags().StringVarP(&c.project, "project-name", "p", "", "Name of the optimus project") + cmd.Flags().StringVar(&c.host, "host", "", "Optimus service endpoint url") +} + +func (c *changeNamespaceCommand) PreRunE(_ *cobra.Command, _ []string) error { + // Load mandatory config + conf, err := config.LoadClientConfig(c.configFilePath) + if err != nil { + return err + } + + c.clientConfig = conf + c.connection = connection.New(c.logger, conf) + + return err +} + +func (c *changeNamespaceCommand) RunE(_ *cobra.Command, args []string) error { + jobName := args[0] + err := c.sendChangeNamespaceRequest(jobName) + if err != nil { + return fmt.Errorf("namespace change request failed for job %s: %w", jobName, err) + } + c.logger.Info("[OK] Successfully changed namespace and deployed new DAG on Scheduler") + return nil +} + +func (c *changeNamespaceCommand) sendChangeNamespaceRequest(jobName string) error { + conn, err := c.connection.Create(c.host) + if err != nil { + return err + } + defer conn.Close() + + // fetch Instance by calling the optimus API + jobRunServiceClient := pb.NewJobSpecificationServiceClient(conn) + request := &pb.ChangeJobNamespaceRequest{ + ProjectName: c.project, + NamespaceName: c.oldNamespaceName, + NewNamespaceName: c.newNamespaceName, + JobName: jobName, + } + + ctx, dialCancel := context.WithTimeout(context.Background(), changeNamespaceTimeout) + defer dialCancel() + + _, err = jobRunServiceClient.ChangeJobNamespace(ctx, request) + return err +} + +func (c *changeNamespaceCommand) PostRunE(_ *cobra.Command, args []string) error { + c.logger.Info("\n[info] Moving job in filesystem") + jobName := args[0] + + oldNamespaceConfig, err := c.getNamespaceConfig(c.oldNamespaceName) + if err != nil { + c.logger.Error(fmt.Sprintf("[error] old namespace unregistered in filesystem, err: %s", err.Error())) + return nil + } + + jobSpecReadWriter, err := specio.NewJobSpecReadWriter(afero.NewOsFs()) + if err != nil { + c.logger.Error(fmt.Sprintf("[error] could not instantiate Spec Readed, err: %s", err.Error())) + return nil + } + + jobSpec, err := jobSpecReadWriter.ReadByName(oldNamespaceConfig.Job.Path, jobName) + if err != nil { + c.logger.Error(fmt.Sprintf("[error] unable to find job in old namespace directory, err: %s", err.Error())) + return nil + } + + fs := afero.NewOsFs() + newNamespaceConfig, err := c.getNamespaceConfig(c.newNamespaceName) + if err != nil || newNamespaceConfig.Job.Path == "" { + c.logger.Warn("[warn] new namespace not recognised for jobs") + c.logger.Warn("[info] run `optimus job export` on the new namespace repo, to fetch the newly moved job.") + + c.logger.Warn("[info] removing job from old namespace") + err = fs.RemoveAll(jobSpec.Path) + if err != nil { + c.logger.Error(fmt.Sprintf("[error] unable to remove job from old namespace , err: %s", err.Error())) + c.logger.Warn("[info] consider deleting source files manually if they exist") + return nil + } + c.logger.Warn("[OK] removed job spec from current namespace directory") + return nil + } + + newJobPath := strings.Replace(jobSpec.Path, oldNamespaceConfig.Job.Path, newNamespaceConfig.Job.Path, 1) + + c.logger.Info(fmt.Sprintf("\t* Old Path : '%s' \n\t* New Path : '%s' \n", jobSpec.Path, newJobPath)) + + c.logger.Info(fmt.Sprintf("[info] creating job directry: %s", newJobPath)) + + err = fs.MkdirAll(filepath.Dir(newJobPath), os.ModePerm) + if err != nil { + c.logger.Error(fmt.Sprintf("[error] unable to create path in the new namespace directory, err: %s", err.Error())) + c.logger.Warn("[warn] unable to move job from old namespace") + c.logger.Warn("[info] consider moving source files manually") + return nil + } + + err = fs.Rename(jobSpec.Path, newJobPath) + if err != nil { + c.logger.Error(fmt.Sprintf("[warn] unable to move job from old namespace, err: %s", err.Error())) + c.logger.Warn("[info] consider moving source files manually") + return nil + } + c.logger.Info("[OK] Job moved successfully") + return nil +} + +func (c *changeNamespaceCommand) getNamespaceConfig(namespaceName string) (*config.Namespace, error) { + for _, namespace := range c.clientConfig.Namespaces { + if namespace.Name == namespaceName { + return namespace, nil + } + } + return nil, errors.NotFound(tenant.EntityNamespace, "not recognised in config") +} diff --git a/client/cmd/job/create.go b/client/cmd/job/create.go index 5df163ba90..9db3f82a27 100644 --- a/client/cmd/job/create.go +++ b/client/cmd/job/create.go @@ -5,16 +5,16 @@ import ( "path/filepath" "strings" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/survey" - "github.com/odpf/optimus/client/local/specio" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/models" ) type createCommand struct { diff --git a/client/cmd/job/export.go b/client/cmd/job/export.go index 2ea23aaf7b..ead8eb308b 100644 --- a/client/cmd/job/export.go +++ b/client/cmd/job/export.go @@ -1,23 +1,24 @@ package job import ( + "context" "errors" "fmt" "path" "strings" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/local" - "github.com/odpf/optimus/client/local/model" - "github.com/odpf/optimus/client/local/specio" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/local" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( @@ -26,7 +27,9 @@ const ( ) type exportCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + writer local.SpecWriter[*model.JobSpec] configFilePath string @@ -84,6 +87,8 @@ func (e *exportCommand) PreRunE(_ *cobra.Command, _ []string) error { } else { e.host = cfg.Host } + e.connection = connection.New(e.logger, cfg) + return err } @@ -211,15 +216,18 @@ func (e *exportCommand) writeJobs(projectName, namespaceName string, jobs []*mod } func (e *exportCommand) fetchNamespaceJobsByProjectName(projectName string) (map[string][]*model.JobSpec, error) { - conn, err := connectivity.NewConnectivity(e.host, fetchJobTimeout) + conn, err := e.connection.Create(e.host) if err != nil { return nil, err } defer conn.Close() - jobSpecificationServiceClient := pb.NewJobSpecificationServiceClient(conn.GetConnection()) + jobSpecificationServiceClient := pb.NewJobSpecificationServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), fetchJobTimeout) + defer cancelFunc() - response, err := jobSpecificationServiceClient.GetJobSpecifications(conn.GetContext(), &pb.GetJobSpecificationsRequest{ + response, err := jobSpecificationServiceClient.GetJobSpecifications(ctx, &pb.GetJobSpecificationsRequest{ ProjectName: projectName, }) if err != nil { @@ -234,15 +242,18 @@ func (e *exportCommand) fetchNamespaceJobsByProjectName(projectName string) (map } func (e *exportCommand) fetchJobsByProjectAndNamespaceName(projectName, namespaceName string) ([]*model.JobSpec, error) { - conn, err := connectivity.NewConnectivity(e.host, fetchJobTimeout) + conn, err := e.connection.Create(e.host) if err != nil { return nil, err } defer conn.Close() - jobSpecificationServiceClient := pb.NewJobSpecificationServiceClient(conn.GetConnection()) + jobSpecificationServiceClient := pb.NewJobSpecificationServiceClient(conn) - response, err := jobSpecificationServiceClient.GetJobSpecifications(conn.GetContext(), &pb.GetJobSpecificationsRequest{ + ctx, cancelFunc := context.WithTimeout(context.Background(), fetchJobTimeout) + defer cancelFunc() + + response, err := jobSpecificationServiceClient.GetJobSpecifications(ctx, &pb.GetJobSpecificationsRequest{ ProjectName: projectName, NamespaceName: namespaceName, }) @@ -258,15 +269,18 @@ func (e *exportCommand) fetchJobsByProjectAndNamespaceName(projectName, namespac } func (e *exportCommand) fetchSpecificJob(projectName, namespaceName, jobName string) (*model.JobSpec, error) { - conn, err := connectivity.NewConnectivity(e.host, fetchJobTimeout) + conn, err := e.connection.Create(e.host) if err != nil { return nil, err } defer conn.Close() - jobSpecificationServiceClient := pb.NewJobSpecificationServiceClient(conn.GetConnection()) + jobSpecificationServiceClient := pb.NewJobSpecificationServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), fetchJobTimeout) + defer cancelFunc() - response, err := jobSpecificationServiceClient.GetJobSpecifications(conn.GetContext(), &pb.GetJobSpecificationsRequest{ + response, err := jobSpecificationServiceClient.GetJobSpecifications(ctx, &pb.GetJobSpecificationsRequest{ ProjectName: projectName, NamespaceName: namespaceName, JobName: jobName, @@ -282,15 +296,18 @@ func (e *exportCommand) fetchSpecificJob(projectName, namespaceName, jobName str } func (e *exportCommand) fetchProjectNames() ([]string, error) { - conn, err := connectivity.NewConnectivity(e.host, fetchTenantTimeout) + conn, err := e.connection.Create(e.host) if err != nil { return nil, err } defer conn.Close() - projectServiceClient := pb.NewProjectServiceClient(conn.GetConnection()) + projectServiceClient := pb.NewProjectServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), fetchTenantTimeout) + defer cancelFunc() - response, err := projectServiceClient.ListProjects(conn.GetContext(), &pb.ListProjectsRequest{}) + response, err := projectServiceClient.ListProjects(ctx, &pb.ListProjectsRequest{}) if err != nil { return nil, err } diff --git a/client/cmd/job/inspect.go b/client/cmd/job/inspect.go index f8ac19f7f7..6ea475c9d5 100644 --- a/client/cmd/job/inspect.go +++ b/client/cmd/job/inspect.go @@ -6,18 +6,18 @@ import ( "fmt" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/afero" "github.com/spf13/cobra" "gopkg.in/yaml.v2" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/survey" - "github.com/odpf/optimus/client/local/model" - "github.com/odpf/optimus/client/local/specio" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( @@ -27,7 +27,8 @@ const ( ) type inspectCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection configFilePath string @@ -68,6 +69,8 @@ func (e *inspectCommand) PreRunE(_ *cobra.Command, _ []string) error { e.logger = logger.NewClientLogger() e.jobSurvey = survey.NewJobSurvey() e.namespaceSurvey = survey.NewNamespaceSurvey(e.logger) + + e.connection = connection.New(e.logger, e.clientConfig) return nil } @@ -127,7 +130,7 @@ func (e *inspectCommand) loadConfig() error { } func (e *inspectCommand) inspectJobSpecification(jobSpec *model.JobSpec, serverFetch bool) error { - conn, err := connectivity.NewConnectivity(e.clientConfig.Host, inspectTimeout) + conn, err := e.connection.Create(e.clientConfig.Host) if err != nil { return err } @@ -147,8 +150,11 @@ func (e *inspectCommand) inspectJobSpecification(jobSpec *model.JobSpec, serverF Spec: adaptedSpec, JobName: jobName, } - job := pb.NewJobSpecificationServiceClient(conn.GetConnection()) - resp, err := job.JobInspect(conn.GetContext(), jobInspectRequest) + job := pb.NewJobSpecificationServiceClient(conn) + + ctx, dialCancel := context.WithTimeout(context.Background(), inspectTimeout) + defer dialCancel() + resp, err := job.JobInspect(ctx, jobInspectRequest) if err != nil { if errors.Is(err, context.DeadlineExceeded) { e.logger.Error("Inspect process took too long, timing out") diff --git a/client/cmd/job/job.go b/client/cmd/job/job.go index 4c3361bd88..98d022abd0 100644 --- a/client/cmd/job/job.go +++ b/client/cmd/job/job.go @@ -24,6 +24,7 @@ func NewJobCommand() *cobra.Command { NewReplaceAllCommand(), NewExportCommand(), NewJobRunInputCommand(), + NewChangeNamespaceCommand(), ) return cmd } diff --git a/client/cmd/job/refresh.go b/client/cmd/job/refresh.go index c81ceb7905..36e7f80702 100644 --- a/client/cmd/job/refresh.go +++ b/client/cmd/job/refresh.go @@ -7,14 +7,14 @@ import ( "io" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( @@ -23,6 +23,7 @@ const ( type refreshCommand struct { logger log.Logger + connection connection.Connection configFilePath string verbose bool @@ -83,6 +84,8 @@ func (r *refreshCommand) PreRunE(cmd *cobra.Command, _ []string) error { if r.host == "" { r.host = conf.Host } + + r.connection = connection.New(r.logger, conf) return nil } @@ -102,15 +105,17 @@ func (r *refreshCommand) RunE(_ *cobra.Command, _ []string) error { } func (r *refreshCommand) refreshJobSpecificationRequest() error { - conn, err := connectivity.NewConnectivity(r.host, refreshTimeout) + conn, err := r.connection.Create(r.host) if err != nil { return err } defer conn.Close() - jobSpecService := pb.NewJobSpecificationServiceClient(conn.GetConnection()) + jobSpecService := pb.NewJobSpecificationServiceClient(conn) - respStream, err := jobSpecService.RefreshJobs(conn.GetContext(), &pb.RefreshJobsRequest{ + ctx, dialCancel := context.WithTimeout(context.Background(), refreshTimeout) + defer dialCancel() + respStream, err := jobSpecService.RefreshJobs(ctx, &pb.RefreshJobsRequest{ ProjectName: r.projectName, NamespaceNames: r.selectedNamespaceNames, JobNames: r.selectedJobNames, diff --git a/client/cmd/job/replace_all.go b/client/cmd/job/replace_all.go index b5ab18c24a..cb2dceabe8 100644 --- a/client/cmd/job/replace_all.go +++ b/client/cmd/job/replace_all.go @@ -9,16 +9,17 @@ import ( "time" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/afero" "github.com/spf13/cobra" - - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/local/specio" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/models" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "google.golang.org/grpc" + + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/models" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( @@ -26,7 +27,9 @@ const ( ) type replaceAllCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + clientConfig *config.ClientConfig selectedNamespaceNames []string @@ -64,6 +67,8 @@ func (r *replaceAllCommand) PreRunE(_ *cobra.Command, _ []string) error { if err != nil { return err } + + r.connection = connection.New(r.logger, r.clientConfig) return nil } @@ -82,7 +87,7 @@ func (r *replaceAllCommand) RunE(_ *cobra.Command, _ []string) error { } func (r *replaceAllCommand) replaceAll(selectedNamespaces []*config.Namespace) error { - conn, err := connectivity.NewConnectivity(r.clientConfig.Host, replaceAllTimeout) + conn, err := r.connection.Create(r.clientConfig.Host) if err != nil { return err } @@ -96,14 +101,17 @@ func (r *replaceAllCommand) replaceAll(selectedNamespaces []*config.Namespace) e return nil } -func (r *replaceAllCommand) replaceAllJobs(conn *connectivity.Connectivity, selectedNamespaces []*config.Namespace) error { +func (r *replaceAllCommand) replaceAllJobs(conn *grpc.ClientConn, selectedNamespaces []*config.Namespace) error { var namespaceNames []string for _, namespace := range selectedNamespaces { namespaceNames = append(namespaceNames, namespace.Name) } r.logger.Info("> Replacing all jobs for namespaces [%s]", strings.Join(namespaceNames, ",")) - stream, err := r.getJobStreamClient(conn) + ctx, dialCancel := context.WithTimeout(context.Background(), replaceAllTimeout) + defer dialCancel() + + stream, err := r.getJobStreamClient(ctx, conn) if err != nil { return err } @@ -171,11 +179,10 @@ func (*replaceAllCommand) getReplaceAllRequest(projectName string, namespace *co }, nil } -func (r *replaceAllCommand) getJobStreamClient( - conn *connectivity.Connectivity, -) (pb.JobSpecificationService_ReplaceAllJobSpecificationsClient, error) { - client := pb.NewJobSpecificationServiceClient(conn.GetConnection()) - stream, err := client.ReplaceAllJobSpecifications(conn.GetContext()) +func (r *replaceAllCommand) getJobStreamClient(ctx context.Context, conn *grpc.ClientConn) (pb.JobSpecificationService_ReplaceAllJobSpecificationsClient, error) { + client := pb.NewJobSpecificationServiceClient(conn) + + stream, err := client.ReplaceAllJobSpecifications(ctx) if err != nil { if errors.Is(err, context.DeadlineExceeded) { r.logger.Error("Replace job specifications process took too long, timing out") diff --git a/client/cmd/job/run_input.go b/client/cmd/job/run_input.go index aef630b795..d57e83d23b 100644 --- a/client/cmd/job/run_input.go +++ b/client/cmd/job/run_input.go @@ -1,6 +1,7 @@ package job import ( + "context" "fmt" "io/fs" "os" @@ -8,16 +9,16 @@ import ( "strings" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/utils" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/utils" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( @@ -33,7 +34,9 @@ const ( ) type jobRunInputCommand struct { - logger log.Logger + logger log.Logger + connection *connection.Insecure + configFilePath string assetOutputDir string @@ -103,6 +106,9 @@ func (j *jobRunInputCommand) PreRunE(cmd *cobra.Command, _ []string) error { if j.host == "" { j.host = conf.Host } + + j.connection = connection.NewInsecure(j.logger) + return nil } @@ -209,14 +215,14 @@ func (j *jobRunInputCommand) writeJobAssetsToFiles( } func (j *jobRunInputCommand) sendJobRunInputRequest(jobName string, jobScheduledTimeProto *timestamppb.Timestamp) (*pb.JobRunInputResponse, error) { - conn, err := connectivity.NewConnectivity(j.host, jobRunInputCompileAssetsTimeout) + conn, err := j.connection.Create(j.host) if err != nil { return nil, err } defer conn.Close() // fetch Instance by calling the optimus API - jobRunServiceClient := pb.NewJobRunServiceClient(conn.GetConnection()) + jobRunServiceClient := pb.NewJobRunServiceClient(conn) request := &pb.JobRunInputRequest{ ProjectName: j.projectName, JobName: jobName, @@ -225,7 +231,10 @@ func (j *jobRunInputCommand) sendJobRunInputRequest(jobName string, jobScheduled InstanceName: j.runName, } - return jobRunServiceClient.JobRunInput(conn.GetContext(), request) + ctx, reqCancel := context.WithTimeout(context.Background(), jobRunInputCompileAssetsTimeout) + defer reqCancel() + + return jobRunServiceClient.JobRunInput(ctx, request) } func (j *jobRunInputCommand) getJobScheduledTimeProto() (*timestamppb.Timestamp, error) { diff --git a/client/cmd/job/run_list.go b/client/cmd/job/run_list.go index f1ac5bccf8..8aadd3d210 100644 --- a/client/cmd/job/run_list.go +++ b/client/cmd/job/run_list.go @@ -1,26 +1,28 @@ package job import ( + "context" "errors" "fmt" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/progressbar" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/progressbar" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const jobStatusTimeout = time.Second * 30 type runListCommand struct { logger log.Logger + connection *connection.Insecure configFilePath string startDate string @@ -97,7 +99,7 @@ func (r *runListCommand) RunE(_ *cobra.Command, args []string) error { } func (r *runListCommand) callJobRun(jobRunRequest *pb.JobRunRequest) error { - conn, err := connectivity.NewConnectivity(r.host, jobStatusTimeout) + conn, err := r.connection.Create(r.host) if err != nil { return err } @@ -105,8 +107,12 @@ func (r *runListCommand) callJobRun(jobRunRequest *pb.JobRunRequest) error { spinner := progressbar.NewProgressBar() spinner.Start("please wait...") - run := pb.NewJobRunServiceClient(conn.GetConnection()) - jobRunResponse, err := run.JobRun(conn.GetContext(), jobRunRequest) + run := pb.NewJobRunServiceClient(conn) + + ctx, dialCancel := context.WithTimeout(context.Background(), jobStatusTimeout) + defer dialCancel() + + jobRunResponse, err := run.JobRun(ctx, jobRunRequest) spinner.Stop() if err != nil { return fmt.Errorf("request failed for job %s: %w", jobRunRequest.JobName, err) diff --git a/client/cmd/job/validate.go b/client/cmd/job/validate.go index c2bfd87ec0..f5e4bbe17a 100644 --- a/client/cmd/job/validate.go +++ b/client/cmd/job/validate.go @@ -7,22 +7,24 @@ import ( "io" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/local/model" - "github.com/odpf/optimus/client/local/specio" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const validateTimeout = time.Minute * 5 type validateCommand struct { - logger log.Logger + logger log.Logger + connection *connection.Insecure + configFilePath string clientConfig *config.ClientConfig @@ -59,6 +61,8 @@ func (v *validateCommand) PreRunE(_ *cobra.Command, _ []string) error { // Load return err } v.clientConfig = conf + + v.connection = connection.NewInsecure(v.logger) return nil } @@ -88,7 +92,7 @@ func (v *validateCommand) RunE(_ *cobra.Command, _ []string) error { } func (v *validateCommand) validateJobSpecificationRequest(jobSpecs []*model.JobSpec) error { - conn, err := connectivity.NewConnectivity(v.clientConfig.Host, validateTimeout) + conn, err := v.connection.Create(v.clientConfig.Host) if err != nil { return err } @@ -104,8 +108,12 @@ func (v *validateCommand) validateJobSpecificationRequest(jobSpecs []*model.JobS Jobs: jobSpecsProto, NamespaceName: v.namespaceName, } - job := pb.NewJobSpecificationServiceClient(conn.GetConnection()) - respStream, err := job.CheckJobSpecifications(conn.GetContext(), checkJobSpecRequest) + job := pb.NewJobSpecificationServiceClient(conn) + + ctx, dialCancel := context.WithTimeout(context.Background(), validateTimeout) + defer dialCancel() + + respStream, err := job.CheckJobSpecifications(ctx, checkJobSpecRequest) if err != nil { if errors.Is(err, context.DeadlineExceeded) { v.logger.Error("Validate process took too long, timing out") diff --git a/client/cmd/namespace/describe.go b/client/cmd/namespace/describe.go index f3fb29149f..a03b60d7cf 100644 --- a/client/cmd/namespace/describe.go +++ b/client/cmd/namespace/describe.go @@ -1,24 +1,27 @@ package namespace import ( + "context" "fmt" "path" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const describeTimeout = time.Minute * 15 type describeCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string dirPath string @@ -79,6 +82,7 @@ func (d *describeCommand) PreRunE(cmd *cobra.Command, _ []string) error { if d.host == "" { d.host = conf.Host } + d.connection = connection.New(d.logger, conf) return nil } @@ -99,7 +103,7 @@ func (d *describeCommand) RunE(_ *cobra.Command, _ []string) error { } func (d *describeCommand) getNamespace() (*config.Namespace, error) { - conn, err := connectivity.NewConnectivity(d.host, describeTimeout) + conn, err := d.connection.Create(d.host) if err != nil { return nil, err } @@ -109,8 +113,12 @@ func (d *describeCommand) getNamespace() (*config.Namespace, error) { ProjectName: d.projectName, NamespaceName: d.namespaceName, } - namespaceServiceClient := pb.NewNamespaceServiceClient(conn.GetConnection()) - response, err := namespaceServiceClient.GetNamespace(conn.GetContext(), request) + namespaceServiceClient := pb.NewNamespaceServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), describeTimeout) + defer cancelFunc() + + response, err := namespaceServiceClient.GetNamespace(ctx, request) if err != nil { return nil, fmt.Errorf("unable to get namespace [%s]: %w", d.namespaceName, err) } diff --git a/client/cmd/namespace/list.go b/client/cmd/namespace/list.go index 3b0096904c..d246c60ba8 100644 --- a/client/cmd/namespace/list.go +++ b/client/cmd/namespace/list.go @@ -2,25 +2,28 @@ package namespace import ( "bytes" + "context" "fmt" "path" "time" - "github.com/odpf/salt/log" "github.com/olekukonko/tablewriter" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const listTimeout = time.Minute * 15 type listCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string clientConfig *config.ClientConfig @@ -79,6 +82,8 @@ func (l *listCommand) PreRunE(cmd *cobra.Command, _ []string) error { if l.host == "" { l.host = l.clientConfig.Host } + l.connection = connection.New(l.logger, conf) + return nil } @@ -98,8 +103,8 @@ func (l *listCommand) RunE(_ *cobra.Command, _ []string) error { return nil } -func (*listCommand) listNamespacesFromServer(serverHost, projectName string) ([]*config.Namespace, error) { - conn, err := connectivity.NewConnectivity(serverHost, listTimeout) +func (l *listCommand) listNamespacesFromServer(serverHost, projectName string) ([]*config.Namespace, error) { + conn, err := l.connection.Create(serverHost) if err != nil { return nil, err } @@ -108,8 +113,12 @@ func (*listCommand) listNamespacesFromServer(serverHost, projectName string) ([] request := &pb.ListProjectNamespacesRequest{ ProjectName: projectName, } - namespaceServiceClient := pb.NewNamespaceServiceClient(conn.GetConnection()) - response, err := namespaceServiceClient.ListProjectNamespaces(conn.GetContext(), request) + namespaceServiceClient := pb.NewNamespaceServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), listTimeout) + defer cancelFunc() + + response, err := namespaceServiceClient.ListProjectNamespaces(ctx, request) if err != nil { return nil, fmt.Errorf("unable to list namespace for project [%s]: %w", projectName, err) } diff --git a/client/cmd/namespace/namespace.go b/client/cmd/namespace/namespace.go index 28f6dd7004..7ef0f336d1 100644 --- a/client/cmd/namespace/namespace.go +++ b/client/cmd/namespace/namespace.go @@ -18,11 +18,3 @@ func NewNamespaceCommand() *cobra.Command { ) return cmd } - -// GetAllowedDownstreamNamespaces gets all downstream namespace names -func GetAllowedDownstreamNamespaces(namespaceName string, allDownstream bool) []string { - if allDownstream { - return []string{"*"} - } - return []string{namespaceName} -} diff --git a/client/cmd/namespace/register.go b/client/cmd/namespace/register.go index 951676a31b..8af93c8149 100644 --- a/client/cmd/namespace/register.go +++ b/client/cmd/namespace/register.go @@ -1,20 +1,22 @@ package namespace import ( + "context" "errors" "fmt" "path" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" + "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const registerTimeout = time.Minute * 15 @@ -49,26 +51,34 @@ func (r *registerCommand) RunE(_ *cobra.Command, _ []string) error { if err != nil { return err } + + conn := connection.New(r.logger, clientConfig) + c, err := conn.Create(clientConfig.Host) + if err != nil { + return err + } + defer c.Close() + if r.namespaceName != "" { r.logger.Info("Registering namespace [%s] to [%s]", r.namespaceName, clientConfig.Host) namespace, err := clientConfig.GetNamespaceByName(r.namespaceName) if err != nil { return err } - return RegisterNamespace(r.logger, clientConfig.Host, clientConfig.Project.Name, namespace) + return RegisterNamespace(r.logger, c, clientConfig.Project.Name, namespace) } r.logger.Info("Registering all available namespaces from client config to [%s]", clientConfig.Host) - return RegisterSelectedNamespaces(r.logger, clientConfig.Host, clientConfig.Project.Name, clientConfig.Namespaces...) + return RegisterSelectedNamespaces(r.logger, c, clientConfig.Project.Name, clientConfig.Namespaces...) } // RegisterSelectedNamespaces registers all selected namespaces -func RegisterSelectedNamespaces(l log.Logger, serverHost, projectName string, selectedNamespaces ...*config.Namespace) error { +func RegisterSelectedNamespaces(l log.Logger, conn *grpc.ClientConn, projectName string, selectedNamespaces ...*config.Namespace) error { ch := make(chan error, len(selectedNamespaces)) defer close(ch) for _, namespace := range selectedNamespaces { go func(namespace *config.Namespace) { - ch <- RegisterNamespace(l, serverHost, projectName, namespace) + ch <- RegisterNamespace(l, conn, projectName, namespace) }(namespace) } var errMsg string @@ -84,15 +94,13 @@ func RegisterSelectedNamespaces(l log.Logger, serverHost, projectName string, se } // RegisterNamespace registers one namespace to the targeted server -func RegisterNamespace(l log.Logger, serverHost, projectName string, namespace *config.Namespace) error { - conn, err := connectivity.NewConnectivity(serverHost, registerTimeout) - if err != nil { - return err - } - defer conn.Close() +func RegisterNamespace(l log.Logger, conn *grpc.ClientConn, projectName string, namespace *config.Namespace) error { + namespaceServiceClient := pb.NewNamespaceServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), registerTimeout) + defer cancelFunc() - namespaceServiceClient := pb.NewNamespaceServiceClient(conn.GetConnection()) - _, err = namespaceServiceClient.RegisterProjectNamespace(conn.GetContext(), &pb.RegisterProjectNamespaceRequest{ + _, err := namespaceServiceClient.RegisterProjectNamespace(ctx, &pb.RegisterProjectNamespaceRequest{ ProjectName: projectName, Namespace: &pb.NamespaceSpecification{ Name: namespace.Name, diff --git a/client/cmd/playground/playground.go b/client/cmd/playground/playground.go index 43f9afd845..81e255dc44 100644 --- a/client/cmd/playground/playground.go +++ b/client/cmd/playground/playground.go @@ -3,7 +3,7 @@ package playground import ( "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/playground/window" + "github.com/raystack/optimus/client/cmd/playground/window" ) // NewPlaygroundCommand initializes command for playground diff --git a/client/cmd/playground/window/model.go b/client/cmd/playground/window/model.go index 8c895a5bfb..a1833d8a3f 100644 --- a/client/cmd/playground/window/model.go +++ b/client/cmd/playground/window/model.go @@ -10,14 +10,12 @@ import ( "github.com/charmbracelet/bubbles/textinput" tea "github.com/charmbracelet/bubbletea" - "github.com/odpf/salt/log" "github.com/olekukonko/tablewriter" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/internal/models" ) type model struct { - log log.Logger currentCursor cursorPointer truncateTo truncateTo @@ -27,18 +25,12 @@ type model struct { scheduledTime time.Time } -func newModel(log log.Logger) *model { - offsetInput := textinput.New() - - sizeInput := textinput.New() - sizeInput.Focus() - +func newModel() *model { return &model{ - log: log, currentCursor: pointToTruncateTo, truncateTo: truncateToDay, - sizeInput: sizeInput, - offsetInput: offsetInput, + sizeInput: textinput.New(), + offsetInput: textinput.New(), scheduledTime: time.Now(), } } @@ -53,6 +45,7 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if currMsg.String() != "tea.KeyMsg" { return m, nil } + msgStr := fmt.Sprintf("%s", msg) switch msgStr { case "ctrl+c", "q": @@ -73,8 +66,7 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "backspace": - m.sizeInput, _ = m.sizeInput.Update(msg) - m.offsetInput, _ = m.offsetInput.Update(msg) + m.handleInput(msg) } return m, nil } @@ -92,7 +84,7 @@ func (m *model) View() string { s.WriteString(m.generateWindowResultView()) s.WriteString("\n") s.WriteString("DOCUMENTATION:\n") - s.WriteString("- https://odpf.github.io/optimus/docs/concepts/intervals-and-windows") + s.WriteString("- https://raystack.github.io/optimus/docs/concepts/intervals-and-windows") return s.String() } @@ -100,7 +92,6 @@ func (m *model) generateWindowResultView() string { buff := &bytes.Buffer{} table := tablewriter.NewWriter(buff) table.SetHeader([]string{"Version", "Start Time", "End Time"}) - table.SetAutoMergeCells(true) table.Append(m.generateWindowTableRowView(1)) table.Append(m.generateWindowTableRowView(2)) //nolint: gomnd table.Render() @@ -172,6 +163,7 @@ func (m *model) generateWindowInputView() string { buff := &bytes.Buffer{} table := tablewriter.NewWriter(buff) table.SetRowLine(true) + table.SetColumnAlignment([]int{tablewriter.ALIGN_LEFT, tablewriter.ALIGN_LEFT}) table.Append([]string{ "truncate_to", m.generateValueWithCursorPointerView(pointToTruncateTo, string(m.truncateTo)), @@ -195,14 +187,16 @@ func (m *model) generateWindowInputView() string { func (m *model) generateWindowTableRowView(version int) []string { window, err := models.NewWindow(version, string(m.truncateTo), m.offsetInput.Value(), m.sizeInput.Value()) if err != nil { - return []string{fmt.Sprintf("%d", version), err.Error()} + return []string{fmt.Sprintf("%d", version), err.Error(), err.Error()} } + var startTimeRow string if startTime, err := window.GetStartTime(m.scheduledTime); err != nil { startTimeRow = err.Error() } else { startTimeRow = startTime.Format(time.RFC3339) } + var endTimeRow string if endTime, err := window.GetEndTime(m.scheduledTime); err != nil { endTimeRow = err.Error() @@ -232,6 +226,15 @@ func (m *model) generateValueWithCursorPointerView(targetCursor cursorPointer, v return value } +func (m *model) handleInput(msg tea.Msg) { + switch m.currentCursor { + case pointToOffset: + m.offsetInput, _ = m.offsetInput.Update(msg) + case pointToSize: + m.sizeInput, _ = m.sizeInput.Update(msg) + } +} + func (m *model) handleDecrement() { switch m.currentCursor { case pointToTruncateTo: diff --git a/client/cmd/playground/window/window.go b/client/cmd/playground/window/window.go index 4907ff301a..cad1709781 100644 --- a/client/cmd/playground/window/window.go +++ b/client/cmd/playground/window/window.go @@ -2,10 +2,10 @@ package window import ( tea "github.com/charmbracelet/bubbletea" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/logger" ) type command struct { @@ -27,6 +27,6 @@ func (j *command) RunE(_ *cobra.Command, _ []string) error { j.log.Info("Hi, this is an interactive CLI to play around with window configuration.") j.log.Info("Navigate around the available configurations input with arrow keys.") j.log.Info("If you want to quit, just press 'q' or 'ctr+c' key.\n") - p := tea.NewProgram(newModel(j.log)) + p := tea.NewProgram(newModel()) return p.Start() } diff --git a/client/cmd/plugin/install.go b/client/cmd/plugin/install.go index 67c822cbfe..58d0635bbe 100644 --- a/client/cmd/plugin/install.go +++ b/client/cmd/plugin/install.go @@ -1,12 +1,12 @@ package plugin import ( - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/plugin" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/plugin" ) type installCommand struct { diff --git a/client/cmd/plugin/sync.go b/client/cmd/plugin/sync.go index 69074d5b7a..7cc80d82ff 100644 --- a/client/cmd/plugin/sync.go +++ b/client/cmd/plugin/sync.go @@ -9,12 +9,12 @@ import ( "os" "strings" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/plugin" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/plugin" ) type syncCommand struct { diff --git a/client/cmd/plugin/validate.go b/client/cmd/plugin/validate.go index 03e2632bc8..b2969c83e1 100644 --- a/client/cmd/plugin/validate.go +++ b/client/cmd/plugin/validate.go @@ -8,11 +8,11 @@ import ( "path/filepath" "strings" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/plugin/yaml" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/plugin/yaml" ) type validateCommand struct { diff --git a/client/cmd/project/describe.go b/client/cmd/project/describe.go index 52ba005e96..f0f9a2b21c 100644 --- a/client/cmd/project/describe.go +++ b/client/cmd/project/describe.go @@ -1,24 +1,27 @@ package project import ( + "context" "path" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" "gopkg.in/yaml.v2" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const describeTimeout = time.Minute * 15 type describeCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string dirPath string @@ -75,6 +78,8 @@ func (d *describeCommand) PreRunE(cmd *cobra.Command, _ []string) error { if d.host == "" { d.host = conf.Host } + d.connection = connection.New(d.logger, conf) + return nil } @@ -95,7 +100,7 @@ func (d *describeCommand) RunE(_ *cobra.Command, _ []string) error { func (d *describeCommand) getProject() (config.Project, error) { var project config.Project - conn, err := connectivity.NewConnectivity(d.host, describeTimeout) + conn, err := d.connection.Create(d.host) if err != nil { return project, err } @@ -105,8 +110,12 @@ func (d *describeCommand) getProject() (config.Project, error) { ProjectName: d.projectName, } - projectServiceClient := pb.NewProjectServiceClient(conn.GetConnection()) - response, err := projectServiceClient.GetProject(conn.GetContext(), request) + projectServiceClient := pb.NewProjectServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), describeTimeout) + defer cancelFunc() + + response, err := projectServiceClient.GetProject(ctx, request) if err != nil { return project, err } diff --git a/client/cmd/project/register.go b/client/cmd/project/register.go index 8f3be05475..acde909913 100644 --- a/client/cmd/project/register.go +++ b/client/cmd/project/register.go @@ -1,20 +1,22 @@ package project import ( + "context" "fmt" "path" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" + "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/namespace" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/namespace" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const registerTimeout = time.Minute * 15 @@ -49,13 +51,21 @@ func (r *registerCommand) RunE(_ *cobra.Command, _ []string) error { if err != nil { return err } + + conn := connection.New(r.logger, clientConfig) + c, err := conn.Create(clientConfig.Host) + if err != nil { + return err + } + defer c.Close() + r.logger.Info("Registering project [%s] to server [%s]", clientConfig.Project.Name, clientConfig.Host) - if err := RegisterProject(r.logger, clientConfig.Host, clientConfig.Project); err != nil { + if err := RegisterProject(r.logger, c, clientConfig.Project); err != nil { return err } if r.withNamespaces { r.logger.Info("Registering all namespaces from: %s", filePath) - if err := namespace.RegisterSelectedNamespaces(r.logger, clientConfig.Host, clientConfig.Project.Name, clientConfig.Namespaces...); err != nil { + if err := namespace.RegisterSelectedNamespaces(r.logger, c, clientConfig.Project.Name, clientConfig.Namespaces...); err != nil { return err } } @@ -63,22 +73,19 @@ func (r *registerCommand) RunE(_ *cobra.Command, _ []string) error { } // RegisterProject registers a project to the targeted server host -func RegisterProject(logger log.Logger, serverHost string, project config.Project) error { - conn, err := connectivity.NewConnectivity(serverHost, registerTimeout) - if err != nil { - return err - } - defer conn.Close() - - projectServiceClient := pb.NewProjectServiceClient(conn.GetConnection()) +func RegisterProject(logger log.Logger, conn *grpc.ClientConn, project config.Project) error { + projectServiceClient := pb.NewProjectServiceClient(conn) projectSpec := &pb.ProjectSpecification{ Name: project.Name, Config: project.Config, } - _, err = projectServiceClient.RegisterProject(conn.GetContext(), &pb.RegisterProjectRequest{ + + ctx, cancelFunc := context.WithTimeout(context.Background(), registerTimeout) + defer cancelFunc() + + _, err := projectServiceClient.RegisterProject(ctx, &pb.RegisterProjectRequest{ Project: projectSpec, }) - if err != nil { if status.Code(err) == codes.FailedPrecondition { logger.Warn(fmt.Sprintf("Ignoring project config changes: %v", err)) diff --git a/client/cmd/replay/create.go b/client/cmd/replay/create.go index 0b04a3c44c..a7d531e4bf 100644 --- a/client/cmd/replay/create.go +++ b/client/cmd/replay/create.go @@ -5,25 +5,34 @@ import ( "fmt" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" "golang.org/x/net/context" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/progressbar" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( - replayTimeout = time.Minute * 1 - ISOTimeLayout = time.RFC3339 + replayTimeout = time.Minute * 1 + ISOTimeLayout = time.RFC3339 + pollIntervalInSecond = 30 +) + +var ( + supportedISOTimeLayouts = [...]string{time.RFC3339, "2006-01-02"} + terminalStatuses = map[string]bool{"success": true, "failed": true, "invalid": true} ) type createCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string parallel bool @@ -45,8 +54,9 @@ func CreateCommand() *cobra.Command { Use: "create", Short: "Run replay operation on a dag based on provided start and end time range", Long: "This operation takes three arguments, first is DAG name[required]\nused in optimus specification, " + - "second is start time[required] of\nreplay, third is end time[optional] of replay. \nDate ranges are inclusive.", - Example: "optimus replay create <2023-01-01T02:30:00Z00:00> [2023-01-02T02:30:00Z00:00]", + "second is start time[required] of\nreplay, third is end time[optional] of replay. \nDate ranges are inclusive. " + + "Supported date formats are RFC3339 and \nsimple date YYYY-MM-DD", + Example: "optimus replay create <2023-01-01T02:30:00Z00:00> [2023-01-02T02:30:00Z00:00]\noptimus replay create <2023-01-01> [2023-01-02]", Args: func(cmd *cobra.Command, args []string) error { if len(args) < 1 { return errors.New("job name is required") @@ -95,6 +105,8 @@ func (r *createCommand) PreRunE(cmd *cobra.Command, _ []string) error { if r.host == "" { r.host = conf.Host } + + r.connection = connection.New(r.logger, conf) return nil } @@ -110,18 +122,49 @@ func (r *createCommand) RunE(_ *cobra.Command, args []string) error { if err != nil { return err } - r.logger.Info("Replay request created with id %s", replayID) + r.logger.Info("Replay request is accepted and it is in progress") + r.logger.Info("Either you could wait or you could close (ctrl+c) and check the status with `optimus replay status %s` command later", replayID) + + return r.waitForReplayState(replayID) +} + +func (r *createCommand) waitForReplayState(replayID string) error { + spinner := progressbar.NewProgressBarWithWriter(r.logger.Writer()) + status := "in progress" + spinner.Start(fmt.Sprintf("%s...", status)) + for { + resp, err := r.getReplay(replayID) + if err != nil { + return err + } + if status != resp.Status { + status = resp.Status + spinner.StartNewLine(fmt.Sprintf("%s...", status)) + } + if _, ok := terminalStatuses[status]; ok { + spinner.StartNewLine("\n") + spinner.Stop() + r.logger.Info("\n" + stringifyReplayStatus(resp)) + break + } + time.Sleep(time.Duration(pollIntervalInSecond) * time.Second) + } + spinner.Stop() return nil } +func (r *createCommand) getReplay(replayID string) (*pb.GetReplayResponse, error) { + return getReplay(r.host, replayID, r.connection) +} + func (r *createCommand) createReplayRequest(jobName, startTimeStr, endTimeStr, jobConfig string) (string, error) { - conn, err := connectivity.NewConnectivity(r.host, replayTimeout) + conn, err := r.connection.Create(r.host) if err != nil { return "", err } defer conn.Close() - replayService := pb.NewReplayServiceClient(conn.GetConnection()) + replayService := pb.NewReplayServiceClient(conn) startTime, err := getTimeProto(startTimeStr) if err != nil { @@ -131,7 +174,11 @@ func (r *createCommand) createReplayRequest(jobName, startTimeStr, endTimeStr, j if err != nil { return "", err } - respStream, err := replayService.Replay(conn.GetContext(), &pb.ReplayRequest{ + + ctx, cancelFunc := context.WithTimeout(context.Background(), replayTimeout) + defer cancelFunc() + + respStream, err := replayService.Replay(ctx, &pb.ReplayRequest{ ProjectName: r.projectName, JobName: jobName, NamespaceName: r.namespaceName, @@ -151,7 +198,14 @@ func (r *createCommand) createReplayRequest(jobName, startTimeStr, endTimeStr, j } func getTimeProto(timeStr string) (*timestamppb.Timestamp, error) { - parsedTime, err := time.Parse(ISOTimeLayout, timeStr) + var parsedTime time.Time + var err error + for _, ISOTimeLayout := range supportedISOTimeLayouts { + parsedTime, err = time.Parse(ISOTimeLayout, timeStr) + if err == nil { + break + } + } if err != nil { return nil, err } diff --git a/client/cmd/replay/list.go b/client/cmd/replay/list.go new file mode 100644 index 0000000000..690a244e48 --- /dev/null +++ b/client/cmd/replay/list.go @@ -0,0 +1,133 @@ +package replay + +import ( + "bytes" + "context" + "time" + + "github.com/olekukonko/tablewriter" + "github.com/raystack/salt/log" + "github.com/spf13/cobra" + + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" +) + +type listCommand struct { + logger log.Logger + connection connection.Connection + + configFilePath string + + projectName string + host string +} + +func ListCommand() *cobra.Command { + l := &listCommand{ + logger: logger.NewClientLogger(), + } + cmd := &cobra.Command{ + Use: "list", + Short: "List down all of the replay based on the given project", + Example: "optimus list", + PreRunE: l.PreRunE, + RunE: l.RunE, + } + l.injectFlags(cmd) + return cmd +} + +func (l *listCommand) injectFlags(cmd *cobra.Command) { + // Config filepath flag + cmd.Flags().StringVarP(&l.configFilePath, "config", "c", config.EmptyPath, "File path for client configuration") + + // Mandatory flags if config is not set + cmd.Flags().StringVarP(&l.projectName, "project-name", "p", "", "Name of the optimus project") + cmd.Flags().StringVar(&l.host, "host", "", "Optimus service endpoint url") +} + +func (l *listCommand) PreRunE(cmd *cobra.Command, _ []string) error { + conf, err := internal.LoadOptionalConfig(l.configFilePath) + if err != nil { + return err + } + + if conf == nil { + internal.MarkFlagsRequired(cmd, []string{"project-name", "host"}) + return nil + } + + if l.projectName == "" { + l.projectName = conf.Project.Name + } + if l.host == "" { + l.host = conf.Host + } + l.connection = connection.New(l.logger, conf) + return nil +} + +func (l *listCommand) RunE(_ *cobra.Command, _ []string) error { + listReplayRequest := &pb.ListReplayRequest{ + ProjectName: l.projectName, + } + return l.listReplay(listReplayRequest) +} + +func (l *listCommand) listReplay(req *pb.ListReplayRequest) error { + conn, err := l.connection.Create(l.host) + if err != nil { + return err + } + defer conn.Close() + + replayService := pb.NewReplayServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), replayTimeout) + defer cancelFunc() + + listReplayResp, err := replayService.ListReplay(ctx, req) + if err != nil { + return err + } + + if len(listReplayResp.GetReplays()) == 0 { + l.logger.Info("No replays were found in %s project.", req.ProjectName) + } else { + result := stringifyListOfReplays(listReplayResp) + l.logger.Info("Replays for project: %s", l.projectName) + l.logger.Info(result) + } + return nil +} + +func stringifyListOfReplays(resp *pb.ListReplayResponse) string { + buff := &bytes.Buffer{} + table := tablewriter.NewWriter(buff) + table.SetBorder(false) + table.SetHeader([]string{ + "ID", + "Job Name", + "Start Date", + "End Date", + "Description", + "Status", + }) + table.SetAlignment(tablewriter.ALIGN_LEFT) + for _, replay := range resp.Replays { + table.Append([]string{ + replay.GetId(), + replay.GetJobName(), + replay.GetReplayConfig().GetStartTime().AsTime().Format(time.RFC3339), + replay.GetReplayConfig().GetEndTime().AsTime().Format(time.RFC3339), + replay.GetReplayConfig().GetDescription(), + replay.GetStatus(), + }) + } + table.Render() + return buff.String() +} diff --git a/client/cmd/replay/replay.go b/client/cmd/replay/replay.go index e64fc80dda..0a6149c692 100644 --- a/client/cmd/replay/replay.go +++ b/client/cmd/replay/replay.go @@ -16,6 +16,8 @@ func NewReplayCommand() *cobra.Command { cmd.AddCommand( CreateCommand(), + ListCommand(), + StatusCommand(), ) return cmd } diff --git a/client/cmd/replay/status.go b/client/cmd/replay/status.go new file mode 100644 index 0000000000..51e8081361 --- /dev/null +++ b/client/cmd/replay/status.go @@ -0,0 +1,174 @@ +package replay + +import ( + "bytes" + "context" + "errors" + "fmt" + "time" + + "github.com/olekukonko/tablewriter" + "github.com/raystack/salt/log" + "github.com/spf13/cobra" + + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" +) + +type statusCommand struct { + logger log.Logger + connection connection.Connection + + configFilePath string + + projectName string + host string +} + +// StatusCommand get status for corresponding replay +func StatusCommand() *cobra.Command { + status := &statusCommand{ + logger: logger.NewClientLogger(), + } + + cmd := &cobra.Command{ + Use: "status", + Short: "Get replay detailed status by replay ID", + Long: "This operation takes 1 argument, replayID [required] \nwhich UUID format ", + Example: "optimus replay status ", + Args: func(cmd *cobra.Command, args []string) error { + if len(args) < 1 { + return errors.New("replayID is required") + } + return nil + }, + RunE: status.RunE, + PreRunE: status.PreRunE, + } + + status.injectFlags(cmd) + return cmd +} + +func (r *statusCommand) injectFlags(cmd *cobra.Command) { + // Config filepath flag + cmd.Flags().StringVarP(&r.configFilePath, "config", "c", config.EmptyPath, "File path for client configuration") + + // Mandatory flags if config is not set + cmd.Flags().StringVarP(&r.projectName, "project-name", "p", "", "Name of the optimus project") + cmd.Flags().StringVar(&r.host, "host", "", "Optimus service endpoint url") +} + +func (r *statusCommand) PreRunE(cmd *cobra.Command, _ []string) error { + conf, err := internal.LoadOptionalConfig(r.configFilePath) + if err != nil { + return err + } + + if conf == nil { + internal.MarkFlagsRequired(cmd, []string{"project-name", "host"}) + return nil + } + + if r.projectName == "" { + r.projectName = conf.Project.Name + } + if r.host == "" { + r.host = conf.Host + } + r.connection = connection.New(r.logger, conf) + return nil +} + +func (r *statusCommand) RunE(_ *cobra.Command, args []string) error { + replayID := args[0] + resp, err := r.getReplay(replayID) + if err != nil { + return err + } + result := stringifyReplayStatus(resp) + r.logger.Info("Replay status for replay ID: %s", replayID) + r.logger.Info(result) + return nil +} + +func (r *statusCommand) getReplay(replayID string) (*pb.GetReplayResponse, error) { + return getReplay(r.host, replayID, r.connection) +} + +func getReplay(host, replayID string, connection connection.Connection) (*pb.GetReplayResponse, error) { + conn, err := connection.Create(host) + if err != nil { + return nil, err + } + defer conn.Close() + + req := &pb.GetReplayRequest{ReplayId: replayID} + + replayService := pb.NewReplayServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), replayTimeout) + defer cancelFunc() + + return replayService.GetReplay(ctx, req) +} + +func stringifyReplayStatus(resp *pb.GetReplayResponse) string { + buff := &bytes.Buffer{} + mode := "sequential" + if resp.GetReplayConfig().GetParallel() { + mode = "parallel" + } + buff.WriteString(fmt.Sprintf("Job Name : %s\n", resp.GetJobName())) + buff.WriteString(fmt.Sprintf("Replay Mode : %s\n", mode)) + buff.WriteString(fmt.Sprintf("Description : %s\n", resp.ReplayConfig.GetDescription())) + buff.WriteString(fmt.Sprintf("Start Date : %s\n", resp.ReplayConfig.GetStartTime().AsTime().Format(time.RFC3339))) + buff.WriteString(fmt.Sprintf("End Date : %s\n", resp.ReplayConfig.GetEndTime().AsTime().Format(time.RFC3339))) + buff.WriteString(fmt.Sprintf("Replay Status : %s\n", resp.GetStatus())) + buff.WriteString(fmt.Sprintf("Total Runs : %d\n\n", len(resp.GetReplayRuns()))) + + if len(resp.ReplayConfig.GetJobConfig()) > 0 { + stringifyReplayConfig(buff, resp.ReplayConfig.GetJobConfig()) + buff.WriteString("\n") + } + + if len(resp.GetReplayRuns()) > 0 { + stringifyReplayRuns(buff, resp.GetReplayRuns()) + } + + return buff.String() +} + +func stringifyReplayConfig(buff *bytes.Buffer, jobConfig map[string]string) { + table := tablewriter.NewWriter(buff) + table.SetBorder(false) + table.SetHeader([]string{ + "config key", + "config value", + }) + table.SetAlignment(tablewriter.ALIGN_LEFT) + for k, v := range jobConfig { + table.Append([]string{k, v}) + } + table.Render() +} + +func stringifyReplayRuns(buff *bytes.Buffer, runs []*pb.ReplayRun) { + table := tablewriter.NewWriter(buff) + table.SetBorder(false) + table.SetHeader([]string{ + "scheduled at", + "status", + }) + table.SetAlignment(tablewriter.ALIGN_LEFT) + for _, run := range runs { + table.Append([]string{ + run.GetScheduledAt().AsTime().String(), + run.GetStatus(), + }) + } + table.Render() +} diff --git a/client/cmd/resource/apply.go b/client/cmd/resource/apply.go new file mode 100644 index 0000000000..9c45f353ad --- /dev/null +++ b/client/cmd/resource/apply.go @@ -0,0 +1,160 @@ +package resource + +import ( + "context" + "errors" + "fmt" + "time" + + "github.com/MakeNowJust/heredoc" + "github.com/raystack/salt/log" + "github.com/spf13/cobra" + + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/progressbar" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" +) + +const ( + applyTimeout = time.Minute * 5 + successStatus = "success" +) + +type applyCommand struct { + logger log.Logger + connection connection.Connection + + configFilePath string + clientConfig *config.ClientConfig + + namespaceSurvey *survey.NamespaceSurvey + namespaceName string + projectName string + storeName string + + verbose bool + resourceNames []string +} + +// NewApplyCommand initializes command for applying resources from optimus to datastore +func NewApplyCommand() *cobra.Command { + l := logger.NewClientLogger() + apply := &applyCommand{ + logger: l, + namespaceSurvey: survey.NewNamespaceSurvey(l), + } + + cmd := &cobra.Command{ + Use: "apply", + Short: "Apply resources from optimus to datastore", + Long: heredoc.Doc(`Apply changes to destination datastore`), + Example: "optimus resource apply ", + Annotations: map[string]string{ + "group:core": "true", + }, + RunE: apply.RunE, + PreRunE: apply.PreRunE, + } + cmd.Flags().StringVarP(&apply.configFilePath, "config", "c", apply.configFilePath, "File path for client configuration") + cmd.Flags().StringSliceVarP(&apply.resourceNames, "resource-names", "R", nil, "Selected resources of optimus project") + cmd.Flags().BoolVarP(&apply.verbose, "verbose", "v", false, "Print details related to upload-all stages") + cmd.Flags().StringVarP(&apply.namespaceName, "namespace", "n", "", "Namespace name within project") + cmd.Flags().StringVarP(&apply.storeName, "datastore", "s", "bigquery", "Datastore type where the resource belongs") + return cmd +} + +func (a *applyCommand) PreRunE(_ *cobra.Command, _ []string) error { + var err error + a.clientConfig, err = config.LoadClientConfig(a.configFilePath) + if err != nil { + return err + } + + a.connection = connection.New(a.logger, a.clientConfig) + + return nil +} + +func (a *applyCommand) RunE(_ *cobra.Command, _ []string) error { + a.logger.Info("> Validating resource names") + if len(a.resourceNames) == 0 { + return errors.New("empty resource names") + } + + if a.projectName == "" { + a.projectName = a.clientConfig.Project.Name + } + + var namespace *config.Namespace + // use flag or ask namespace name + if a.namespaceName == "" { + var err error + namespace, err = a.namespaceSurvey.AskToSelectNamespace(a.clientConfig) + if err != nil { + return err + } + a.namespaceName = namespace.Name + } + + return a.apply() +} + +func (a *applyCommand) apply() error { + conn, err := a.connection.Create(a.clientConfig.Host) + if err != nil { + return err + } + defer conn.Close() + + apply := pb.NewResourceServiceClient(conn) + + spinner := progressbar.NewProgressBar() + spinner.Start("please wait...") + + applyRequest := pb.ApplyResourcesRequest{ + ProjectName: a.projectName, + NamespaceName: a.namespaceName, + DatastoreName: a.storeName, + ResourceNames: a.resourceNames, + } + + ctx, cancelFunc := context.WithTimeout(context.Background(), applyTimeout) + defer cancelFunc() + + responses, err := apply.ApplyResources(ctx, &applyRequest) + spinner.Stop() + if err != nil { + if errors.Is(err, context.DeadlineExceeded) { + a.logger.Error("Apply took too long, timing out") + } + return fmt.Errorf("failed to apply resourcse: %w", err) + } + + a.printApplyStatus(responses) + return nil +} + +func (a *applyCommand) printApplyStatus(responses *pb.ApplyResourcesResponse) { + a.logger.Info("Apply finished") + var successResources []string + for _, status := range responses.Statuses { + if status.Status == successStatus { + successResources = append(successResources, status.ResourceName) + } + } + if len(successResources) > 0 { + a.logger.Info("Resources with success") + for i, name := range successResources { + a.logger.Info("%d. %s", i+1, name) + } + } + + for _, resourceStatus := range responses.Statuses { + if resourceStatus.Status != successStatus { + a.logger.Error("Resource [%s] failed with: %s", resourceStatus.ResourceName, resourceStatus.Reason) + } + } +} diff --git a/client/cmd/resource/change_namespace.go b/client/cmd/resource/change_namespace.go new file mode 100644 index 0000000000..9b27af88bc --- /dev/null +++ b/client/cmd/resource/change_namespace.go @@ -0,0 +1,198 @@ +package resource + +import ( + "context" + "fmt" + "os" + "path/filepath" + "strings" + "time" + + "github.com/raystack/salt/log" + "github.com/spf13/afero" + "github.com/spf13/cobra" + + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" +) + +const ( + changeNamespaceTimeout = time.Minute * 1 +) + +type changeNamespaceCommand struct { + logger log.Logger + connection connection.Connection + + configFilePath string + clientConfig *config.ClientConfig + + project string + oldNamespace string + newNamespace string + dataStore string + host string +} + +// NewChangeNamespaceCommand initializes resource namespace change command +func NewChangeNamespaceCommand() *cobra.Command { + l := logger.NewClientLogger() + changeNamespace := &changeNamespaceCommand{ + logger: l, + } + cmd := &cobra.Command{ + Use: "change-namespace", + Short: "Change namespace of a resource", + Example: "optimus resource change-namespace --old-namespace --new-namespace ", + Args: cobra.MinimumNArgs(2), //nolint + PreRunE: changeNamespace.PreRunE, + RunE: changeNamespace.RunE, + PostRunE: changeNamespace.PostRunE, + } + // Config filepath flag + cmd.Flags().StringVarP(&changeNamespace.configFilePath, "config", "c", config.EmptyPath, "File path for client configuration") + internal.MarkFlagsRequired(cmd, []string{"old-namespace", "new-namespace"}) + changeNamespace.injectFlags(cmd) + + return cmd +} + +func (c *changeNamespaceCommand) injectFlags(cmd *cobra.Command) { + // Mandatory flags + cmd.Flags().StringVarP(&c.oldNamespace, "old-namespace", "o", "", "current namespace of the resource") + cmd.Flags().StringVarP(&c.newNamespace, "new-namespace", "n", "", "namespace to which the resource needs to be moved to") + + // Mandatory flags if config is not set + cmd.Flags().StringVarP(&c.project, "project-name", "p", "", "Name of the optimus project") + cmd.Flags().StringVar(&c.host, "host", "", "Optimus service endpoint url") +} + +func (c *changeNamespaceCommand) PreRunE(_ *cobra.Command, _ []string) error { + // Load mandatory config + conf, err := config.LoadClientConfig(c.configFilePath) + if err != nil { + return err + } + + c.clientConfig = conf + c.connection = connection.New(c.logger, c.clientConfig) + return err +} + +func (c *changeNamespaceCommand) RunE(_ *cobra.Command, args []string) error { + resourceFullName := args[0] + c.dataStore = args[1] + err := c.sendChangeNamespaceRequest(resourceFullName) + if err != nil { + return fmt.Errorf("namespace change request failed for resource %s: %w", resourceFullName, err) + } + c.logger.Info("successfully changed namespace and deployed new DAG on Scheduler") + return nil +} + +func (c *changeNamespaceCommand) sendChangeNamespaceRequest(resourceName string) error { + conn, err := c.connection.Create(c.host) + if err != nil { + return err + } + defer conn.Close() + + // fetch Instance by calling the optimus API + resourceRunServiceClient := pb.NewResourceServiceClient(conn) + request := &pb.ChangeResourceNamespaceRequest{ + ProjectName: c.project, + NamespaceName: c.oldNamespace, + DatastoreName: c.dataStore, + ResourceName: resourceName, + NewNamespaceName: c.newNamespace, + } + + ctx, cancelFunc := context.WithTimeout(context.Background(), changeNamespaceTimeout) + defer cancelFunc() + + _, err = resourceRunServiceClient.ChangeResourceNamespace(ctx, request) + return err +} + +func (c *changeNamespaceCommand) PostRunE(_ *cobra.Command, args []string) error { + c.logger.Info("\n[INFO] Moving resource in filesystem") + resourceName := args[0] + c.dataStore = args[1] + + oldNamespaceConfig, err := c.getResourceDatastoreConfig(c.oldNamespace, c.dataStore) + if err != nil { + c.logger.Error(fmt.Sprintf("[error] old namespace unregistered in filesystem, err: %s", err.Error())) + return nil + } + + resourceSpecReadWriter, err := specio.NewResourceSpecReadWriter(afero.NewOsFs()) + if err != nil { + c.logger.Error(fmt.Sprintf("[error] could not instantiate Spec Readed, err: %s", err.Error())) + return nil + } + + resourceSpec, err := resourceSpecReadWriter.ReadByName(oldNamespaceConfig.Path, resourceName) + if err != nil { + c.logger.Error(fmt.Sprintf("[error] unable to find resource in old namespace directory, err: %s", err.Error())) + return nil + } + + fs := afero.NewOsFs() + newNamespaceConfig, err := c.getResourceDatastoreConfig(c.newNamespace, c.dataStore) + if err != nil || newNamespaceConfig.Path == "" { + c.logger.Warn("[warn] new namespace not recognised for Resources") + c.logger.Warn("[info] run `optimus resource export` on the new namespace repo, to fetch the newly moved resource.") + + c.logger.Warn("[info] removing resource from old namespace") + err = fs.RemoveAll(resourceSpec.Path) + if err != nil { + c.logger.Error(fmt.Sprintf("[error] unable to remove resource from old namespace , err: %s", err.Error())) + c.logger.Warn("[info] consider deleting source files manually if they exist") + return nil + } + c.logger.Warn("[OK] removed resource spec from current namespace directory") + return nil + } + + newResourcePath := strings.Replace(resourceSpec.Path, oldNamespaceConfig.Path, newNamespaceConfig.Path, 1) + + c.logger.Info(fmt.Sprintf("\t* Old Path : '%s' \n\t* New Path : '%s' \n", resourceSpec.Path, newResourcePath)) + + c.logger.Info(fmt.Sprintf("[info] creating Resource directry: %s", newResourcePath)) + + err = fs.MkdirAll(filepath.Dir(newResourcePath), os.FileMode(0o755)) + if err != nil { + c.logger.Error(fmt.Sprintf("[error] unable to create path in the new namespace directory, err: %s", err.Error())) + c.logger.Warn("[warn] unable to move resource from old namespace") + c.logger.Warn("[info] consider moving source files manually") + return nil + } + + err = fs.Rename(resourceSpec.Path, newResourcePath) + if err != nil { + c.logger.Error(fmt.Sprintf("[warn] unable to move resource from old namespace, err: %s", err.Error())) + c.logger.Warn("[info] consider moving source files manually") + return nil + } + c.logger.Info("[OK] Resource moved successfully") + return nil +} + +func (c *changeNamespaceCommand) getResourceDatastoreConfig(namespaceName, datastoreName string) (*config.Datastore, error) { + for _, namespace := range c.clientConfig.Namespaces { + if namespace.Name == namespaceName { + for _, datastore := range namespace.Datastore { + if datastore.Type == datastoreName { + return &datastore, nil + } + } + } + } + return nil, errors.NotFound(resource.EntityResource, "not recognised in config") +} diff --git a/client/cmd/resource/create.go b/client/cmd/resource/create.go index 5c3b604278..af294114c2 100644 --- a/client/cmd/resource/create.go +++ b/client/cmd/resource/create.go @@ -4,15 +4,15 @@ import ( "fmt" "path/filepath" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/survey" - "github.com/odpf/optimus/client/local/model" - "github.com/odpf/optimus/client/local/specio" - "github.com/odpf/optimus/config" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" ) type createCommand struct { diff --git a/client/cmd/resource/export.go b/client/cmd/resource/export.go index 3d9c6cef59..1cca048588 100644 --- a/client/cmd/resource/export.go +++ b/client/cmd/resource/export.go @@ -1,23 +1,24 @@ package resource import ( + "context" "errors" "fmt" "path" "strings" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/local" - "github.com/odpf/optimus/client/local/model" - "github.com/odpf/optimus/client/local/specio" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/local" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( @@ -26,7 +27,9 @@ const ( ) type exportCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + writer local.SpecWriter[*model.ResourceSpec] configFilePath string @@ -87,6 +90,9 @@ func (e *exportCommand) PreRunE(_ *cobra.Command, _ []string) error { } else { e.host = cfg.Host } + + e.connection = connection.New(e.logger, cfg) + return nil } @@ -208,15 +214,18 @@ func (e *exportCommand) writeResources(projectName, namespaceName string, resour } func (e *exportCommand) fetchAllResources(projectName, namespaceName string) ([]*model.ResourceSpec, error) { - conn, err := connectivity.NewConnectivity(e.host, fetchResourceTimeout) + conn, err := e.connection.Create(e.host) if err != nil { return nil, err } defer conn.Close() - resourceServiceClient := pb.NewResourceServiceClient(conn.GetConnection()) + resourceServiceClient := pb.NewResourceServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), fetchResourceTimeout) + defer cancelFunc() - response, err := resourceServiceClient.ListResourceSpecification(conn.GetContext(), &pb.ListResourceSpecificationRequest{ + response, err := resourceServiceClient.ListResourceSpecification(ctx, &pb.ListResourceSpecificationRequest{ ProjectName: projectName, NamespaceName: namespaceName, DatastoreName: e.storeName, @@ -239,15 +248,18 @@ func (e *exportCommand) fetchAllResources(projectName, namespaceName string) ([] } func (e *exportCommand) fetchSpecificResource(projectName, namespaceName, resourceName string) (*model.ResourceSpec, error) { - conn, err := connectivity.NewConnectivity(e.host, fetchResourceTimeout) + conn, err := e.connection.Create(e.host) if err != nil { return nil, err } defer conn.Close() - resourceServiceClient := pb.NewResourceServiceClient(conn.GetConnection()) + resourceServiceClient := pb.NewResourceServiceClient(conn) - response, err := resourceServiceClient.ReadResource(conn.GetContext(), &pb.ReadResourceRequest{ + ctx, cancelFunc := context.WithTimeout(context.Background(), fetchResourceTimeout) + defer cancelFunc() + + response, err := resourceServiceClient.ReadResource(ctx, &pb.ReadResourceRequest{ ProjectName: projectName, NamespaceName: namespaceName, ResourceName: resourceName, @@ -266,15 +278,18 @@ func (e *exportCommand) fetchSpecificResource(projectName, namespaceName, resour } func (e *exportCommand) fetchNamespaceNames(projectName string) ([]string, error) { - conn, err := connectivity.NewConnectivity(e.host, fetchTenantTimeout) + conn, err := e.connection.Create(e.host) if err != nil { return nil, err } defer conn.Close() - namespaceServiceClient := pb.NewNamespaceServiceClient(conn.GetConnection()) + namespaceServiceClient := pb.NewNamespaceServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), fetchTenantTimeout) + defer cancelFunc() - response, err := namespaceServiceClient.ListProjectNamespaces(conn.GetContext(), &pb.ListProjectNamespacesRequest{ + response, err := namespaceServiceClient.ListProjectNamespaces(ctx, &pb.ListProjectNamespacesRequest{ ProjectName: projectName, }) if err != nil { @@ -289,15 +304,18 @@ func (e *exportCommand) fetchNamespaceNames(projectName string) ([]string, error } func (e *exportCommand) fetchProjectNames() ([]string, error) { - conn, err := connectivity.NewConnectivity(e.host, fetchTenantTimeout) + conn, err := e.connection.Create(e.host) if err != nil { return nil, err } defer conn.Close() - projectServiceClient := pb.NewProjectServiceClient(conn.GetConnection()) + projectServiceClient := pb.NewProjectServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), fetchTenantTimeout) + defer cancelFunc() - response, err := projectServiceClient.ListProjects(conn.GetContext(), &pb.ListProjectsRequest{}) + response, err := projectServiceClient.ListProjects(ctx, &pb.ListProjectsRequest{}) if err != nil { return nil, err } diff --git a/client/cmd/resource/resource.go b/client/cmd/resource/resource.go index 945e192fed..6daf1d0054 100644 --- a/client/cmd/resource/resource.go +++ b/client/cmd/resource/resource.go @@ -17,5 +17,7 @@ func NewResourceCommand() *cobra.Command { cmd.AddCommand(NewCreateCommand()) cmd.AddCommand(NewUploadAllCommand()) cmd.AddCommand(NewExportCommand()) + cmd.AddCommand(NewChangeNamespaceCommand()) + cmd.AddCommand(NewApplyCommand()) return cmd } diff --git a/client/cmd/resource/upload_all.go b/client/cmd/resource/upload_all.go index 0fcae22bfc..dd449e1cdc 100644 --- a/client/cmd/resource/upload_all.go +++ b/client/cmd/resource/upload_all.go @@ -9,15 +9,17 @@ import ( "time" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/afero" "github.com/spf13/cobra" - - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/local/specio" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "google.golang.org/grpc" + + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/client/local/specio" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( @@ -25,12 +27,16 @@ const ( ) type uploadAllCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + clientConfig *config.ClientConfig selectedNamespaceNames []string verbose bool configFilePath string + + batchSize int } // NewUploadAllCommand initializes command for uploading all resources @@ -43,7 +49,7 @@ func NewUploadAllCommand() *cobra.Command { Use: "upload-all", Short: "Upload all current optimus resources to server", Long: heredoc.Doc(`Apply local changes to destination server which includes creating/updating resources`), - Example: "optimus resource upload-all [--verbose]", + Example: "optimus resource upload-all [--verbose | -b 1000]", Annotations: map[string]string{ "group:core": "true", }, @@ -53,6 +59,7 @@ func NewUploadAllCommand() *cobra.Command { cmd.Flags().StringVarP(&uploadAll.configFilePath, "config", "c", uploadAll.configFilePath, "File path for client configuration") cmd.Flags().StringSliceVarP(&uploadAll.selectedNamespaceNames, "namespace-names", "N", nil, "Selected namespaces of optimus project") cmd.Flags().BoolVarP(&uploadAll.verbose, "verbose", "v", false, "Print details related to upload-all stages") + cmd.Flags().IntVarP(&uploadAll.batchSize, "batch-size", "b", 0, "Number of resources to upload in a batch") return cmd } @@ -62,6 +69,8 @@ func (u *uploadAllCommand) PreRunE(_ *cobra.Command, _ []string) error { if err != nil { return err } + + u.connection = connection.New(u.logger, u.clientConfig) return nil } @@ -80,13 +89,16 @@ func (u *uploadAllCommand) RunE(_ *cobra.Command, _ []string) error { } func (u *uploadAllCommand) uploadAll(selectedNamespaces []*config.Namespace) error { - conn, err := connectivity.NewConnectivity(u.clientConfig.Host, uploadAllTimeout) + conn, err := u.connection.Create(u.clientConfig.Host) if err != nil { return err } defer conn.Close() - if err := u.uploadAllResources(conn, selectedNamespaces); err != nil { + ctx, cancelFunc := context.WithTimeout(context.Background(), uploadAllTimeout) + defer cancelFunc() + + if err := u.uploadAllResources(ctx, conn, selectedNamespaces); err != nil { return err } u.logger.Info("finished uploading resource specifications to server!\n") @@ -94,7 +106,7 @@ func (u *uploadAllCommand) uploadAll(selectedNamespaces []*config.Namespace) err return nil } -func (u *uploadAllCommand) uploadAllResources(conn *connectivity.Connectivity, selectedNamespaces []*config.Namespace) error { +func (u *uploadAllCommand) uploadAllResources(ctx context.Context, conn *grpc.ClientConn, selectedNamespaces []*config.Namespace) error { var namespaceNames []string for _, namespace := range selectedNamespaces { namespaceNames = append(namespaceNames, namespace.Name) @@ -102,7 +114,7 @@ func (u *uploadAllCommand) uploadAllResources(conn *connectivity.Connectivity, s u.logger.Info("> Uploading all resources for namespaces [%s]", strings.Join(namespaceNames, ",")) - stream, err := u.getResourceStreamClient(conn) + stream, err := u.getResourceStreamClient(ctx, conn) if err != nil { return err } @@ -135,34 +147,58 @@ func (u *uploadAllCommand) sendNamespaceResourceRequest(stream pb.ResourceServic datastoreSpecFs := CreateDataStoreSpecFs(namespace) for storeName, repoFS := range datastoreSpecFs { u.logger.Info("> Deploying %s resources for namespace [%s]", storeName, namespace.Name) - request, err := u.getResourceDeploymentRequest(namespace.Name, storeName, repoFS) + + resources, err := readResourceSpecs(repoFS) if err != nil { return fmt.Errorf("error getting resource specs for namespace [%s]: %w", namespace.Name, err) } - if err = stream.Send(request); err != nil { - return fmt.Errorf("resource upload for namespace [%s] failed: %w", namespace.Name, err) + resLength := len(resources) + size := resLength + if u.batchSize > 0 { + size = u.batchSize + } + + var errorReturned bool + for i := 0; i < resLength; i += size { + endIndex := i + size + if resLength < endIndex { + endIndex = resLength + } + + request, err := u.getResourceDeploymentRequest(namespace.Name, storeName, resources[i:endIndex]) + if err != nil { + u.logger.Error("Unable to get resource request, err: %s", err) + continue + } + + if err = stream.Send(request); err != nil { + errorReturned = true + u.logger.Error("Error: %s", err) + } + progressFn(len(request.GetResources())) + } + if errorReturned { + return fmt.Errorf("resource upload for namespace [%s] failed", namespace.Name) } - progressFn(len(request.GetResources())) } return nil } -func (u *uploadAllCommand) getResourceDeploymentRequest(namespaceName, storeName string, - repoFS afero.Fs, -) (*pb.DeployResourceSpecificationRequest, error) { +func readResourceSpecs(repoFS afero.Fs) ([]*model.ResourceSpec, error) { resourceSpecReadWriter, err := specio.NewResourceSpecReadWriter(repoFS) if err != nil { return nil, err } - resourceSpecs, err := resourceSpecReadWriter.ReadAll(".") - if err != nil { - return nil, err - } + return resourceSpecReadWriter.ReadAll(".") +} - resourceSpecsProto := make([]*pb.ResourceSpecification, len(resourceSpecs)) - for i, resourceSpec := range resourceSpecs { +func (u *uploadAllCommand) getResourceDeploymentRequest(namespaceName, storeName string, + resources []*model.ResourceSpec, +) (*pb.DeployResourceSpecificationRequest, error) { + resourceSpecsProto := make([]*pb.ResourceSpecification, len(resources)) + for i, resourceSpec := range resources { resourceSpecProto, err := resourceSpec.ToProto() if err != nil { return nil, err @@ -178,10 +214,10 @@ func (u *uploadAllCommand) getResourceDeploymentRequest(namespaceName, storeName }, nil } -func (u *uploadAllCommand) getResourceStreamClient(conn *connectivity.Connectivity) (pb.ResourceService_DeployResourceSpecificationClient, error) { - client := pb.NewResourceServiceClient(conn.GetConnection()) +func (u *uploadAllCommand) getResourceStreamClient(ctx context.Context, conn *grpc.ClientConn) (pb.ResourceService_DeployResourceSpecificationClient, error) { + client := pb.NewResourceServiceClient(conn) // TODO: create a new api for upload-all and remove deploy - stream, err := client.DeployResourceSpecification(conn.GetContext()) + stream, err := client.DeployResourceSpecification(ctx) if err != nil { if errors.Is(err, context.DeadlineExceeded) { u.logger.Error("Deployment of resources took too long, timing out") diff --git a/client/cmd/scheduler/upload_all.go b/client/cmd/scheduler/upload_all.go index 41db84e4f9..7f974f8f50 100644 --- a/client/cmd/scheduler/upload_all.go +++ b/client/cmd/scheduler/upload_all.go @@ -1,16 +1,17 @@ package scheduler import ( + "context" "time" "github.com/MakeNowJust/heredoc" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( @@ -18,7 +19,9 @@ const ( ) type uploadCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + clientConfig *config.ClientConfig configFilePath string @@ -52,24 +55,25 @@ func (u *uploadCommand) PreRunE(_ *cobra.Command, _ []string) error { return err } + u.connection = connection.New(u.logger, u.clientConfig) u.logger.Info("initialization finished!\n") return err } func (u *uploadCommand) RunE(_ *cobra.Command, _ []string) error { u.logger.Info("Uploading jobs for project " + u.clientConfig.Project.Name) - u.logger.Info("please wait...") _, err := u.sendUploadAllRequest(u.clientConfig.Project.Name) - u.logger.Info("Finished uploading to scheduler") if err != nil { - u.logger.Error("With %v", err.Error()) + u.logger.Error("Error: %v", err.Error()) + return err } + u.logger.Info("Triggered upload to scheduler, changes will be reflected in scheduler after a few minutes") return nil } func (u *uploadCommand) sendUploadAllRequest(projectName string) (*pb.UploadToSchedulerResponse, error) { - conn, err := connectivity.NewConnectivity(u.clientConfig.Host, uploadTimeout) + conn, err := u.connection.Create(u.clientConfig.Host) if err != nil { return nil, err } @@ -78,6 +82,10 @@ func (u *uploadCommand) sendUploadAllRequest(projectName string) (*pb.UploadToSc request := &pb.UploadToSchedulerRequest{ ProjectName: projectName, } - jobRunServiceClient := pb.NewJobRunServiceClient(conn.GetConnection()) - return jobRunServiceClient.UploadToScheduler(conn.GetContext(), request) + jobRunServiceClient := pb.NewJobRunServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), uploadTimeout) + defer cancelFunc() + + return jobRunServiceClient.UploadToScheduler(ctx, request) } diff --git a/client/cmd/secret/delete.go b/client/cmd/secret/delete.go index 60af62d7f6..fab1846158 100644 --- a/client/cmd/secret/delete.go +++ b/client/cmd/secret/delete.go @@ -5,19 +5,21 @@ import ( "errors" "fmt" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/progressbar" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/progressbar" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type deleteCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string projectName string @@ -72,6 +74,9 @@ func (d *deleteCommand) PreRunE(cmd *cobra.Command, _ []string) error { if d.host == "" { d.host = conf.Host } + + d.connection = connection.New(d.logger, conf) + return nil } @@ -90,7 +95,7 @@ func (d *deleteCommand) RunE(_ *cobra.Command, args []string) error { } func (d *deleteCommand) deleteSecret(req *pb.DeleteSecretRequest) error { - conn, err := connectivity.NewConnectivity(d.host, secretTimeout) + conn, err := d.connection.Create(d.host) if err != nil { return err } @@ -98,9 +103,12 @@ func (d *deleteCommand) deleteSecret(req *pb.DeleteSecretRequest) error { spinner := progressbar.NewProgressBar() spinner.Start("please wait...") - secret := pb.NewSecretServiceClient(conn.GetConnection()) + secret := pb.NewSecretServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), secretTimeout) + defer cancelFunc() - _, err = secret.DeleteSecret(conn.GetContext(), req) + _, err = secret.DeleteSecret(ctx, req) spinner.Stop() if err != nil { if errors.Is(err, context.DeadlineExceeded) { diff --git a/client/cmd/secret/list.go b/client/cmd/secret/list.go index 5223c56d60..04d9342b0f 100644 --- a/client/cmd/secret/list.go +++ b/client/cmd/secret/list.go @@ -5,22 +5,25 @@ import ( "context" "errors" "fmt" + "sort" "time" - "github.com/odpf/salt/log" "github.com/olekukonko/tablewriter" + "github.com/raystack/salt/log" "github.com/spf13/cobra" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/progressbar" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/progressbar" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type listCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string projectName string @@ -72,6 +75,9 @@ func (l *listCommand) PreRunE(cmd *cobra.Command, _ []string) error { if l.host == "" { l.host = conf.Host } + + l.connection = connection.New(l.logger, conf) + return nil } @@ -83,7 +89,7 @@ func (l *listCommand) RunE(_ *cobra.Command, _ []string) error { } func (l *listCommand) listSecret(req *pb.ListSecretsRequest) error { - conn, err := connectivity.NewConnectivity(l.host, secretTimeout) + conn, err := l.connection.Create(l.host) if err != nil { return err } @@ -91,9 +97,12 @@ func (l *listCommand) listSecret(req *pb.ListSecretsRequest) error { spinner := progressbar.NewProgressBar() spinner.Start("please wait...") - secret := pb.NewSecretServiceClient(conn.GetConnection()) + secret := pb.NewSecretServiceClient(conn) - listSecretsResponse, err := secret.ListSecrets(conn.GetContext(), req) + ctx, cancelFunc := context.WithTimeout(context.Background(), secretTimeout) + defer cancelFunc() + + listSecretsResponse, err := secret.ListSecrets(ctx, req) spinner.Stop() if err != nil { if errors.Is(err, context.DeadlineExceeded) { @@ -123,8 +132,12 @@ func (*listCommand) stringifyListOfSecrets(listSecretsResponse *pb.ListSecretsRe "Date", }) - table.SetAlignment(tablewriter.ALIGN_CENTER) - for _, secret := range listSecretsResponse.Secrets { + table.SetAlignment(tablewriter.ALIGN_LEFT) + secrets := listSecretsResponse.Secrets + sort.Slice(secrets, func(i, j int) bool { + return secrets[i].Name < secrets[j].Name + }) + for _, secret := range secrets { namespace := "*" if secret.Namespace != "" { namespace = secret.Namespace diff --git a/client/cmd/secret/set.go b/client/cmd/secret/set.go index 26da640bda..f05e046c33 100644 --- a/client/cmd/secret/set.go +++ b/client/cmd/secret/set.go @@ -5,22 +5,24 @@ import ( "errors" "fmt" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/spf13/cobra" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/progressbar" - "github.com/odpf/optimus/client/cmd/internal/survey" - "github.com/odpf/optimus/config" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/progressbar" + "github.com/raystack/optimus/client/cmd/internal/survey" + "github.com/raystack/optimus/config" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type setCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string survey *survey.SecretSetSurvey @@ -92,6 +94,9 @@ func (s *setCommand) PreRunE(cmd *cobra.Command, _ []string) error { if s.host == "" { s.host = conf.Host } + + s.connection = connection.New(s.logger, conf) + return nil } @@ -146,7 +151,7 @@ func (s *setCommand) RunE(_ *cobra.Command, args []string) error { } func (s *setCommand) registerSecret(req *pb.RegisterSecretRequest) error { - conn, err := connectivity.NewConnectivity(s.host, secretTimeout) + conn, err := s.connection.Create(s.host) if err != nil { return err } @@ -154,9 +159,12 @@ func (s *setCommand) registerSecret(req *pb.RegisterSecretRequest) error { spinner := progressbar.NewProgressBar() spinner.Start("please wait...") - secret := pb.NewSecretServiceClient(conn.GetConnection()) + secret := pb.NewSecretServiceClient(conn) - _, err = secret.RegisterSecret(conn.GetContext(), req) + ctx, cancelFunc := context.WithTimeout(context.Background(), secretTimeout) + defer cancelFunc() + + _, err = secret.RegisterSecret(ctx, req) spinner.Stop() if err != nil { if errors.Is(err, context.DeadlineExceeded) { @@ -169,7 +177,7 @@ func (s *setCommand) registerSecret(req *pb.RegisterSecretRequest) error { } func (s *setCommand) updateSecret(req *pb.UpdateSecretRequest) error { - conn, err := connectivity.NewConnectivity(s.host, secretTimeout) + conn, err := s.connection.Create(s.host) if err != nil { return err } @@ -177,9 +185,12 @@ func (s *setCommand) updateSecret(req *pb.UpdateSecretRequest) error { spinner := progressbar.NewProgressBar() spinner.Start("please wait...") - secret := pb.NewSecretServiceClient(conn.GetConnection()) + secret := pb.NewSecretServiceClient(conn) + + ctx, cancelFunc := context.WithTimeout(context.Background(), secretTimeout) + defer cancelFunc() - _, err = secret.UpdateSecret(conn.GetContext(), req) + _, err = secret.UpdateSecret(ctx, req) spinner.Stop() if err != nil { if errors.Is(err, context.DeadlineExceeded) { diff --git a/client/cmd/version/version.go b/client/cmd/version/version.go index 434d45fc83..00ad4a517b 100644 --- a/client/cmd/version/version.go +++ b/client/cmd/version/version.go @@ -1,26 +1,31 @@ package version import ( + "context" "fmt" "time" - "github.com/odpf/salt/log" - "github.com/odpf/salt/version" + "github.com/raystack/salt/log" + "github.com/raystack/salt/version" "github.com/spf13/cobra" - - "github.com/odpf/optimus/client/cmd/internal" - "github.com/odpf/optimus/client/cmd/internal/connectivity" - "github.com/odpf/optimus/client/cmd/internal/logger" - "github.com/odpf/optimus/client/cmd/internal/progressbar" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/models" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/raystack/optimus/client/cmd/internal" + "github.com/raystack/optimus/client/cmd/internal/connection" + "github.com/raystack/optimus/client/cmd/internal/logger" + "github.com/raystack/optimus/client/cmd/internal/progressbar" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/models" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const versionTimeout = time.Second * 2 type versionCommand struct { - logger log.Logger + logger log.Logger + connection connection.Connection + configFilePath string isWithServer bool @@ -71,6 +76,8 @@ func (v *versionCommand) PreRunE(cmd *cobra.Command, _ []string) error { } else if v.host == "" { v.host = conf.Host } + + v.connection = connection.New(v.logger, conf) } var err error @@ -92,7 +99,7 @@ func (v *versionCommand) RunE(_ *cobra.Command, _ []string) error { } // Print version update if new version is exist - githubRepo := "odpf/optimus" + githubRepo := "raystack/optimus" if updateNotice := version.UpdateNotice(config.BuildVersion, githubRepo); updateNotice != "" { v.logger.Info(updateNotice) } @@ -126,23 +133,29 @@ func (v *versionCommand) printAllPluginInfos() { } // getVersionRequest send a version request to service -func (*versionCommand) getVersionRequest(clientVer, host string) (ver string, err error) { - conn, err := connectivity.NewConnectivity(host, versionTimeout) +func (v *versionCommand) getVersionRequest(clientVer, host string) (ver string, err error) { + conn, err := v.connection.Create(host) if err != nil { return "", err } defer conn.Close() - runtime := pb.NewRuntimeServiceClient(conn.GetConnection()) + runtime := pb.NewRuntimeServiceClient(conn) spinner := progressbar.NewProgressBar() spinner.Start("please wait...") - versionResponse, err := runtime.Version(conn.GetContext(), &pb.VersionRequest{ + + ctx, cancelFunc := context.WithTimeout(context.Background(), versionTimeout) + defer cancelFunc() + + versionResponse, err := runtime.Version(ctx, &pb.VersionRequest{ Client: clientVer, }) if err != nil { + if status.Code(err) == codes.Unauthenticated { + return "", fmt.Errorf("please check if client_id belongs to this application") + } return "", fmt.Errorf("request failed for version: %w", err) } - time.Sleep(versionTimeout) spinner.Stop() return versionResponse.Server, nil } diff --git a/client/extension/default_asset_operator.go b/client/extension/default_asset_operator.go index c67c62b894..9825d10745 100644 --- a/client/extension/default_asset_operator.go +++ b/client/extension/default_asset_operator.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/afero" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) // AssetOperatorFS is file system that will be used by operator. diff --git a/client/extension/default_asset_operator_test.go b/client/extension/default_asset_operator_test.go index b006d65c1d..e1e25a2250 100644 --- a/client/extension/default_asset_operator_test.go +++ b/client/extension/default_asset_operator_test.go @@ -9,7 +9,7 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/extension" + "github.com/raystack/optimus/client/extension" ) type DefaultAssetOperatorTestSuite struct { diff --git a/client/extension/default_manifester.go b/client/extension/default_manifester.go index d1ad8dd485..d853451b51 100644 --- a/client/extension/default_manifester.go +++ b/client/extension/default_manifester.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/afero" "gopkg.in/yaml.v3" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) const manifestFileName = "manifest.yaml" diff --git a/client/extension/default_manifester_test.go b/client/extension/default_manifester_test.go index 8826d8387d..56f6598fa2 100644 --- a/client/extension/default_manifester_test.go +++ b/client/extension/default_manifester_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/suite" "gopkg.in/yaml.v3" - "github.com/odpf/optimus/client/extension" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension" + "github.com/raystack/optimus/client/extension/model" ) const ( diff --git a/client/extension/extension.go b/client/extension/extension.go index 8bec9e65e3..982129680e 100644 --- a/client/extension/extension.go +++ b/client/extension/extension.go @@ -3,8 +3,8 @@ package extension import ( "github.com/spf13/afero" - "github.com/odpf/optimus/client/extension/internal" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/internal" + "github.com/raystack/optimus/client/extension/model" ) // CleanExtensionFS is file system that will be used when cleaning extension. diff --git a/client/extension/extension_test.go b/client/extension/extension_test.go index bd8393e045..a2b1de62b0 100644 --- a/client/extension/extension_test.go +++ b/client/extension/extension_test.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/client/extension" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension" + "github.com/raystack/optimus/client/extension/model" ) func TestClean(t *testing.T) { diff --git a/client/extension/factory/factory.go b/client/extension/factory/factory.go index 397f41d425..9c204541a6 100644 --- a/client/extension/factory/factory.go +++ b/client/extension/factory/factory.go @@ -3,7 +3,7 @@ package factory import ( "fmt" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) // ParseRegistry is the registry for all parsers defined by each provider diff --git a/client/extension/factory/factory_test.go b/client/extension/factory/factory_test.go index d09bb9629b..6772ef3f8a 100644 --- a/client/extension/factory/factory_test.go +++ b/client/extension/factory/factory_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/extension/factory" - "github.com/odpf/optimus/client/extension/mock" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/factory" + "github.com/raystack/optimus/client/extension/mock" + "github.com/raystack/optimus/client/extension/model" ) type ClientFactoryTestSuite struct { diff --git a/client/extension/internal/activate.go b/client/extension/internal/activate.go index 1f9da48b34..74f93fc2b1 100644 --- a/client/extension/internal/activate.go +++ b/client/extension/internal/activate.go @@ -3,7 +3,7 @@ package internal import ( "fmt" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) // ActivateManager is an extension manater to manage tag activation process diff --git a/client/extension/internal/activate_test.go b/client/extension/internal/activate_test.go index 09b394b169..559faa1af2 100644 --- a/client/extension/internal/activate_test.go +++ b/client/extension/internal/activate_test.go @@ -8,9 +8,9 @@ import ( tMock "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/extension/internal" - "github.com/odpf/optimus/client/extension/mock" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/internal" + "github.com/raystack/optimus/client/extension/mock" + "github.com/raystack/optimus/client/extension/model" ) type ActivateManagerTestSuite struct { diff --git a/client/extension/internal/install.go b/client/extension/internal/install.go index cc926cace6..630ccd61e3 100644 --- a/client/extension/internal/install.go +++ b/client/extension/internal/install.go @@ -6,8 +6,8 @@ import ( "fmt" "time" - "github.com/odpf/optimus/client/extension/factory" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/factory" + "github.com/raystack/optimus/client/extension/model" ) type installResource struct { diff --git a/client/extension/internal/install_test.go b/client/extension/internal/install_test.go index bd3f52d845..636be74939 100644 --- a/client/extension/internal/install_test.go +++ b/client/extension/internal/install_test.go @@ -9,10 +9,10 @@ import ( tMock "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/extension/factory" - "github.com/odpf/optimus/client/extension/internal" - "github.com/odpf/optimus/client/extension/mock" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/factory" + "github.com/raystack/optimus/client/extension/internal" + "github.com/raystack/optimus/client/extension/mock" + "github.com/raystack/optimus/client/extension/model" ) type InstallManagerTestSuite struct { @@ -186,7 +186,7 @@ func (i *InstallManagerTestSuite) TestInstall() { provider := "testing" metadata := &model.Metadata{ ProviderName: provider, - OwnerName: "odpf", + OwnerName: "raystack", ProjectName: "optimus-extension-valor", } factory.ParseRegistry = []model.Parser{ @@ -208,7 +208,7 @@ func (i *InstallManagerTestSuite) TestInstall() { manifest := &model.Manifest{ RepositoryOwners: []*model.RepositoryOwner{ { - Name: "odpf", + Name: "raystack", Provider: provider, Projects: []*model.RepositoryProject{ { @@ -266,7 +266,7 @@ func (i *InstallManagerTestSuite) TestInstall() { manifest := &model.Manifest{ RepositoryOwners: []*model.RepositoryOwner{ { - Name: "odpf", + Name: "raystack", Provider: provider, Projects: []*model.RepositoryProject{ { diff --git a/client/extension/internal/internal.go b/client/extension/internal/internal.go index 48dff3d8ac..966aada49c 100644 --- a/client/extension/internal/internal.go +++ b/client/extension/internal/internal.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) func buildOwner(metadata *model.Metadata, project *model.RepositoryProject) *model.RepositoryOwner { diff --git a/client/extension/internal/rename.go b/client/extension/internal/rename.go index 23cc92abe8..373cc28318 100644 --- a/client/extension/internal/rename.go +++ b/client/extension/internal/rename.go @@ -3,7 +3,7 @@ package internal import ( "fmt" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) // RenameManager is an extension manater to manage command rename process diff --git a/client/extension/internal/rename_test.go b/client/extension/internal/rename_test.go index 62045cb885..faaf4339ab 100644 --- a/client/extension/internal/rename_test.go +++ b/client/extension/internal/rename_test.go @@ -8,9 +8,9 @@ import ( tMock "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/extension/internal" - "github.com/odpf/optimus/client/extension/mock" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/internal" + "github.com/raystack/optimus/client/extension/mock" + "github.com/raystack/optimus/client/extension/model" ) type RenameManagerTestSuite struct { diff --git a/client/extension/internal/run.go b/client/extension/internal/run.go index dad57f922d..ce2ba000ec 100644 --- a/client/extension/internal/run.go +++ b/client/extension/internal/run.go @@ -3,7 +3,7 @@ package internal import ( "fmt" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) type runResource struct { diff --git a/client/extension/internal/run_test.go b/client/extension/internal/run_test.go index aaf6727520..7e07d268c3 100644 --- a/client/extension/internal/run_test.go +++ b/client/extension/internal/run_test.go @@ -8,9 +8,9 @@ import ( tMock "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/extension/internal" - "github.com/odpf/optimus/client/extension/mock" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/internal" + "github.com/raystack/optimus/client/extension/mock" + "github.com/raystack/optimus/client/extension/model" ) type RunManagerTestSuite struct { diff --git a/client/extension/internal/uninstall.go b/client/extension/internal/uninstall.go index 650d030dac..d6a71690b8 100644 --- a/client/extension/internal/uninstall.go +++ b/client/extension/internal/uninstall.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) type uninstallResource struct { diff --git a/client/extension/internal/uninstall_test.go b/client/extension/internal/uninstall_test.go index 585c31f94f..d6def5180f 100644 --- a/client/extension/internal/uninstall_test.go +++ b/client/extension/internal/uninstall_test.go @@ -8,9 +8,9 @@ import ( tMock "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/extension/internal" - "github.com/odpf/optimus/client/extension/mock" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/internal" + "github.com/raystack/optimus/client/extension/mock" + "github.com/raystack/optimus/client/extension/model" ) type UninstallManagerTestSuite struct { diff --git a/client/extension/internal/upgrade.go b/client/extension/internal/upgrade.go index 0bbc4db86e..138422d6c8 100644 --- a/client/extension/internal/upgrade.go +++ b/client/extension/internal/upgrade.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/odpf/optimus/client/extension/factory" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/factory" + "github.com/raystack/optimus/client/extension/model" ) type upgradeResource struct { diff --git a/client/extension/internal/upgrade_test.go b/client/extension/internal/upgrade_test.go index 487c4260fb..e293030aed 100644 --- a/client/extension/internal/upgrade_test.go +++ b/client/extension/internal/upgrade_test.go @@ -9,10 +9,10 @@ import ( tMock "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/extension/factory" - "github.com/odpf/optimus/client/extension/internal" - "github.com/odpf/optimus/client/extension/mock" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/factory" + "github.com/raystack/optimus/client/extension/internal" + "github.com/raystack/optimus/client/extension/mock" + "github.com/raystack/optimus/client/extension/model" ) type UpgradeManagerTestSuite struct { @@ -230,7 +230,7 @@ func (u *UpgradeManagerTestSuite) TestUpgrade() { } release.Project = project3 owner1 := &model.RepositoryOwner{ - Name: "odpf", + Name: "raystack", Provider: provider, Projects: []*model.RepositoryProject{project1}, } diff --git a/client/extension/manager.go b/client/extension/manager.go index b1294c1fab..6e9726d269 100644 --- a/client/extension/manager.go +++ b/client/extension/manager.go @@ -3,8 +3,8 @@ package extension import ( "context" - "github.com/odpf/optimus/client/extension/internal" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/internal" + "github.com/raystack/optimus/client/extension/model" ) // Manager defines the extension management diff --git a/client/extension/manager_test.go b/client/extension/manager_test.go index 8e21e44e54..43f2074cca 100644 --- a/client/extension/manager_test.go +++ b/client/extension/manager_test.go @@ -8,10 +8,10 @@ import ( tMock "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/extension" - "github.com/odpf/optimus/client/extension/factory" - "github.com/odpf/optimus/client/extension/mock" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension" + "github.com/raystack/optimus/client/extension/factory" + "github.com/raystack/optimus/client/extension/mock" + "github.com/raystack/optimus/client/extension/model" ) type ManagerTestSuite struct { diff --git a/client/extension/mock/client.go b/client/extension/mock/client.go index 3f5996a8b6..adf0551d01 100644 --- a/client/extension/mock/client.go +++ b/client/extension/mock/client.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) // Client is an autogenerated mock type for the Client type diff --git a/client/extension/mock/manifester.go b/client/extension/mock/manifester.go index 101e1c289c..bc12210496 100644 --- a/client/extension/mock/manifester.go +++ b/client/extension/mock/manifester.go @@ -5,7 +5,7 @@ package mock import ( "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) // Manifester is an autogenerated mock type for the Manifester type diff --git a/client/extension/provider/github/client.go b/client/extension/provider/github/client.go index 5c5014671e..8fdd956a0c 100644 --- a/client/extension/provider/github/client.go +++ b/client/extension/provider/github/client.go @@ -9,8 +9,8 @@ import ( "runtime" "strings" - "github.com/odpf/optimus/client/extension/factory" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/factory" + "github.com/raystack/optimus/client/extension/model" ) const provider = "github" diff --git a/client/extension/provider/github/client_test.go b/client/extension/provider/github/client_test.go index 8a173af1b1..3f2797beb7 100644 --- a/client/extension/provider/github/client_test.go +++ b/client/extension/provider/github/client_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/extension/provider/github" + "github.com/raystack/optimus/client/extension/provider/github" ) type ClientTestSuite struct { diff --git a/client/extension/provider/github/model.go b/client/extension/provider/github/model.go index 569d9551f5..15c53fb8f6 100644 --- a/client/extension/provider/github/model.go +++ b/client/extension/provider/github/model.go @@ -4,7 +4,7 @@ import ( "fmt" "regexp" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/model" ) const apiPrefix = "https://api.github.com/repos" diff --git a/client/extension/provider/github/parse.go b/client/extension/provider/github/parse.go index 907d5c3d6e..05dd05de79 100644 --- a/client/extension/provider/github/parse.go +++ b/client/extension/provider/github/parse.go @@ -7,8 +7,8 @@ import ( "regexp" "strings" - "github.com/odpf/optimus/client/extension/factory" - "github.com/odpf/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/factory" + "github.com/raystack/optimus/client/extension/model" ) // Parse parses remote path to get its metadata according to github convention diff --git a/client/extension/provider/github/parse_test.go b/client/extension/provider/github/parse_test.go index 0848e7ffa7..c5807f5cd6 100644 --- a/client/extension/provider/github/parse_test.go +++ b/client/extension/provider/github/parse_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/client/extension/model" - "github.com/odpf/optimus/client/extension/provider/github" + "github.com/raystack/optimus/client/extension/model" + "github.com/raystack/optimus/client/extension/provider/github" ) func TestParse(t *testing.T) { diff --git a/client/extension/provider/registry.go b/client/extension/provider/registry.go index 605cb419e9..65fafdbe6e 100644 --- a/client/extension/provider/registry.go +++ b/client/extension/provider/registry.go @@ -1,3 +1,3 @@ package provider -import _ "github.com/odpf/optimus/client/extension/provider/github" // init github client and parser +import _ "github.com/raystack/optimus/client/extension/provider/github" // init github client and parser diff --git a/client/local/internal/internal.go b/client/local/internal/internal.go index 8722186bb5..a4d733e09d 100644 --- a/client/local/internal/internal.go +++ b/client/local/internal/internal.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/afero" "gopkg.in/yaml.v3" - "github.com/odpf/optimus/client/local" + "github.com/raystack/optimus/client/local" ) func DiscoverSpecDirPaths(specFS afero.Fs, rootSpecDir, referenceFileName string) ([]string, error) { diff --git a/client/local/model/job_spec.go b/client/local/model/job_spec.go index d95b88873c..a05f9e069e 100644 --- a/client/local/model/job_spec.go +++ b/client/local/model/job_spec.go @@ -5,8 +5,8 @@ import ( "google.golang.org/protobuf/types/known/durationpb" - "github.com/odpf/optimus/internal/utils" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/internal/utils" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type JobSpec struct { @@ -33,7 +33,6 @@ type JobSpecSchedule struct { type JobSpecBehavior struct { DependsOnPast bool `yaml:"depends_on_past"` - Catchup bool `yaml:"catch_up"` Retry *JobSpecBehaviorRetry `yaml:"retry,omitempty"` Notify []JobSpecBehaviorNotifier `yaml:"notify,omitempty"` } @@ -109,7 +108,6 @@ func (j *JobSpec) ToProto() *pb.JobSpecification { EndDate: j.Schedule.EndDate, Interval: j.Schedule.Interval, DependsOnPast: j.Behavior.DependsOnPast, - CatchUp: j.Behavior.Catchup, TaskName: j.Task.Name, Config: j.getProtoJobConfigItems(), WindowSize: j.Task.Window.Size, @@ -260,7 +258,6 @@ func (j *JobSpec) MergeFrom(anotherJobSpec *JobSpec) { j.Behavior.Retry.Delay = getValue(j.Behavior.Retry.Delay, anotherJobSpec.Behavior.Retry.Delay) j.Behavior.Retry.Count = getValue(j.Behavior.Retry.Count, anotherJobSpec.Behavior.Retry.Count) j.Behavior.DependsOnPast = getValue(j.Behavior.DependsOnPast, anotherJobSpec.Behavior.DependsOnPast) - j.Behavior.Catchup = getValue(j.Behavior.Catchup, anotherJobSpec.Behavior.Catchup) for _, pNotify := range anotherJobSpec.Behavior.Notify { childNotifyIdx := -1 @@ -431,7 +428,7 @@ func ToJobSpec(protoSpec *pb.JobSpecification) *JobSpec { EndDate: protoSpec.EndDate, Interval: protoSpec.Interval, }, - Behavior: toJobSpecBehavior(protoSpec.Behavior, protoSpec.DependsOnPast, protoSpec.CatchUp), + Behavior: toJobSpecBehavior(protoSpec.Behavior, protoSpec.DependsOnPast), Task: JobSpecTask{ Name: protoSpec.TaskName, Config: configProtoToMap(protoSpec.Config), @@ -523,7 +520,7 @@ func toJobSpecHooks(protoHooks []*pb.JobSpecHook) []JobSpecHook { return hookSpecs } -func toJobSpecBehavior(protoBehavior *pb.JobSpecification_Behavior, dependsOnPast, catchUp bool) JobSpecBehavior { +func toJobSpecBehavior(protoBehavior *pb.JobSpecification_Behavior, dependsOnPast bool) JobSpecBehavior { var retry *JobSpecBehaviorRetry var notifiers []JobSpecBehaviorNotifier if protoBehavior != nil { @@ -547,7 +544,6 @@ func toJobSpecBehavior(protoBehavior *pb.JobSpecification_Behavior, dependsOnPas } return JobSpecBehavior{ DependsOnPast: dependsOnPast, - Catchup: catchUp, Retry: retry, Notify: notifiers, } diff --git a/client/local/model/job_spec_test.go b/client/local/model/job_spec_test.go index 5fed90ebdd..bdfa3803e4 100644 --- a/client/local/model/job_spec_test.go +++ b/client/local/model/job_spec_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/suite" "google.golang.org/protobuf/types/known/durationpb" - "github.com/odpf/optimus/client/local/model" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/local/model" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type JobSpecTestSuite struct { @@ -95,7 +95,6 @@ func (*JobSpecTestSuite) getCompleteJobSpec() model.JobSpec { }, Behavior: model.JobSpecBehavior{ DependsOnPast: true, - Catchup: true, Retry: &model.JobSpecBehaviorRetry{ Count: 10, Delay: 2 * time.Second, @@ -185,7 +184,6 @@ func (*JobSpecTestSuite) getCompleteJobSpecProto() *pb.JobSpecification { EndDate: "01-01-2050", Interval: "12 10 * * *", DependsOnPast: true, - CatchUp: true, Behavior: &pb.JobSpecification_Behavior{ Retry: &pb.JobSpecification_Behavior_Retry{ Count: 10, diff --git a/client/local/model/resource_spec.go b/client/local/model/resource_spec.go index 39ca07c253..3dce99701e 100644 --- a/client/local/model/resource_spec.go +++ b/client/local/model/resource_spec.go @@ -5,7 +5,7 @@ import ( "google.golang.org/protobuf/types/known/structpb" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type ResourceSpec struct { @@ -14,6 +14,7 @@ type ResourceSpec struct { Type string `yaml:"type"` Labels map[string]string `yaml:"labels"` Spec map[string]interface{} `yaml:"spec"` + Path string `yaml:"-"` } func (r ResourceSpec) ToProto() (*pb.ResourceSpecification, error) { diff --git a/client/local/model/resource_spec_test.go b/client/local/model/resource_spec_test.go index 826e5f2f8a..eff8142a77 100644 --- a/client/local/model/resource_spec_test.go +++ b/client/local/model/resource_spec_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/suite" "google.golang.org/protobuf/types/known/structpb" - "github.com/odpf/optimus/client/local/model" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/client/local/model" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type ResourceSpecTestSuite struct { diff --git a/client/local/specio.go b/client/local/specio.go index c315dd1f7f..4b95e6671d 100644 --- a/client/local/specio.go +++ b/client/local/specio.go @@ -1,6 +1,6 @@ package local -import "github.com/odpf/optimus/client/local/model" +import "github.com/raystack/optimus/client/local/model" type ValidSpec interface { *model.JobSpec | *model.ResourceSpec diff --git a/client/local/specio/export_test.go b/client/local/specio/export_test.go index 38a14029b7..6bdf2b4cfc 100644 --- a/client/local/specio/export_test.go +++ b/client/local/specio/export_test.go @@ -3,8 +3,8 @@ package specio import ( "github.com/spf13/afero" - "github.com/odpf/optimus/client/local" - "github.com/odpf/optimus/client/local/model" + "github.com/raystack/optimus/client/local" + "github.com/raystack/optimus/client/local/model" ) func NewTestJobSpecReadWriter(specFS afero.Fs) local.SpecReadWriter[*model.JobSpec] { diff --git a/client/local/specio/job_spec_io.go b/client/local/specio/job_spec_io.go index 3bcc3278f6..4c4b4ad91e 100644 --- a/client/local/specio/job_spec_io.go +++ b/client/local/specio/job_spec_io.go @@ -11,9 +11,9 @@ import ( "github.com/spf13/afero" - "github.com/odpf/optimus/client/local" - "github.com/odpf/optimus/client/local/internal" - "github.com/odpf/optimus/client/local/model" + "github.com/raystack/optimus/client/local" + "github.com/raystack/optimus/client/local/internal" + "github.com/raystack/optimus/client/local/model" ) type jobSpecReadWriter struct { diff --git a/client/local/specio/job_spec_io_test.go b/client/local/specio/job_spec_io_test.go index 73460701b0..59bbf2943a 100644 --- a/client/local/specio/job_spec_io_test.go +++ b/client/local/specio/job_spec_io_test.go @@ -13,8 +13,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/local/model" - "github.com/odpf/optimus/client/local/specio" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/client/local/specio" ) type JobSpecReadWriterTestSuite struct { @@ -281,7 +281,6 @@ schedule: interval: "" behavior: depends_on_past: false - catch_up: false task: name: "" window: @@ -308,7 +307,6 @@ schedule: interval: 0 22 * * * behavior: depends_on_past: true - catch_up: false notify: - on: test channel: diff --git a/client/local/specio/resource_spec_io.go b/client/local/specio/resource_spec_io.go index a4aa77d475..d6b6a6d392 100644 --- a/client/local/specio/resource_spec_io.go +++ b/client/local/specio/resource_spec_io.go @@ -7,9 +7,9 @@ import ( "github.com/spf13/afero" - "github.com/odpf/optimus/client/local" - "github.com/odpf/optimus/client/local/internal" - "github.com/odpf/optimus/client/local/model" + "github.com/raystack/optimus/client/local" + "github.com/raystack/optimus/client/local/internal" + "github.com/raystack/optimus/client/local/model" ) type resourceSpecReadWriter struct { @@ -44,6 +44,7 @@ func (r resourceSpecReadWriter) ReadAll(rootDirPath string) ([]*model.ResourceSp if err != nil { return nil, fmt.Errorf("error reading spec under [%s]: %w", filePath, err) } + spec.Path = dirPath specs[i] = spec } return specs, nil diff --git a/client/local/specio/resource_spec_io_test.go b/client/local/specio/resource_spec_io_test.go index 1f2c0391e6..03bb3a9ebd 100644 --- a/client/local/specio/resource_spec_io_test.go +++ b/client/local/specio/resource_spec_io_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/client/local/model" - "github.com/odpf/optimus/client/local/specio" + "github.com/raystack/optimus/client/local/model" + "github.com/raystack/optimus/client/local/specio" ) type ResourceSpecReadWriterTestSuite struct { @@ -104,6 +104,7 @@ func (r *ResourceSpecReadWriterTestSuite) TestReadAll() { }, }, }, + Path: "namespace/resource/user", }, } @@ -230,6 +231,7 @@ func (r *ResourceSpecReadWriterTestSuite) TestReadByName() { }, }, }, + Path: "namespace/resource/user", } rootDirPath := "namespace" @@ -293,6 +295,7 @@ func (r *ResourceSpecReadWriterTestSuite) TestWrite() { }, }, }, + Path: "", } actualError := specReadWriter.Write(dirPath, spec) diff --git a/config.sample.yaml b/config.sample.yaml index 72d7714a63..928154ca86 100644 --- a/config.sample.yaml +++ b/config.sample.yaml @@ -4,7 +4,6 @@ version: 1 log: # debug, info, warning, error, fatal - default 'info' level: info - ######################################## # SERVER CONFIG ######################################## @@ -38,7 +37,6 @@ log: # # name of the registered scheduler, default: airflow2 # name: airflow2 - # application telemetry #telemetry: # @@ -63,4 +61,13 @@ log: # artifacts: # # refer : https://github.com/hashicorp/go-getter # - ../transformers/dist/transformers_0.1.0_macos_arm64.tar.gz -# - https://github.com/odpf/optimus/releases/download/v0.2.5/optimus_0.2.5_linux_arm64.tar.gz +# - https://github.com/raystack/optimus/releases/download/v0.2.5/optimus_0.2.5_linux_arm64.tar.gz + +# publisher: +# type: kafka +# buffer: 8 +# config: +# topic: optimus-events +# batch_interval_second: 1 +# broker_urls: +# - localhost:9092 diff --git a/config/config_client.go b/config/config_client.go index 9beacbff99..1903736f1d 100644 --- a/config/config_client.go +++ b/config/config_client.go @@ -11,6 +11,7 @@ type ClientConfig struct { Host string `mapstructure:"host"` // optimus server host Project Project `mapstructure:"project"` Namespaces []*Namespace `mapstructure:"namespaces"` + Auth Auth `mapstructure:"auth"` namespaceNameToNamespace map[string]*Namespace } @@ -30,6 +31,11 @@ type Project struct { Config map[string]string `mapstructure:"config"` } +type Auth struct { + ClientID string `mapstructure:"client_id"` + ClientSecret string `mapstructure:"client_secret"` +} + type Namespace struct { Name string `mapstructure:"name"` Config map[string]string `mapstructure:"config"` diff --git a/config/config_client_test.go b/config/config_client_test.go index 97b2fd51ae..9d8c8aa252 100644 --- a/config/config_client_test.go +++ b/config/config_client_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/config" + "github.com/raystack/optimus/config" ) type ClientConfigTestSuite struct { diff --git a/config/config_server.go b/config/config_server.go index b50a34b80d..fb73cb4d20 100644 --- a/config/config_server.go +++ b/config/config_server.go @@ -11,6 +11,7 @@ type ServerConfig struct { ResourceManagers []ResourceManager `mapstructure:"resource_managers"` Plugin PluginConfig `mapstructure:"plugin"` Replay ReplayConfig `mapstructure:"replay"` + Publisher *Publisher `mapstructure:"publisher"` } type Serve struct { @@ -55,3 +56,15 @@ type PluginConfig struct { type ReplayConfig struct { ReplayTimeout time.Duration `mapstructure:"replay_timeout" default:"3h"` } + +type Publisher struct { + Type string `mapstructure:"type" default:"kafka"` + Buffer int `mapstructure:"buffer"` + Config interface{} `mapstructure:"config"` +} + +type PublisherKafkaConfig struct { + Topic string `mapstructure:"topic"` + BatchIntervalSecond int `mapstructure:"batch_interval_second"` + BrokerURLs []string `mapstructure:"broker_urls"` +} diff --git a/config/loader.go b/config/loader.go index 7c0253fd3f..2bbf46d92a 100644 --- a/config/loader.go +++ b/config/loader.go @@ -7,7 +7,7 @@ import ( "path/filepath" "strings" - "github.com/odpf/salt/config" + "github.com/raystack/salt/config" "github.com/spf13/afero" "github.com/spf13/viper" ) diff --git a/config/loader_test.go b/config/loader_test.go index 54f2d391f0..92db6c7888 100644 --- a/config/loader_test.go +++ b/config/loader_test.go @@ -9,11 +9,11 @@ import ( "testing" "time" - saltConfig "github.com/odpf/salt/config" + saltConfig "github.com/raystack/salt/config" "github.com/spf13/afero" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/config" + "github.com/raystack/optimus/config" ) const clientConfig = ` @@ -61,6 +61,14 @@ resource_managers: description: neighbor optimus config: host: external.optimus.io +publisher: + type: kafka + buffer: 8 + config: + topic: optimus_event_for_test + batch_interval_second: 5 + broker_urls: + - localhost:9092 ` type ConfigTestSuite struct { @@ -280,6 +288,16 @@ func (s *ConfigTestSuite) initExpectedServerConfig() { s.expectedServerConfig.Plugin = config.PluginConfig{} s.expectedServerConfig.Replay.ReplayTimeout = time.Hour * 3 + + s.expectedServerConfig.Publisher = &config.Publisher{ + Type: "kafka", + Buffer: 8, + Config: map[string]interface{}{ + "topic": "optimus_event_for_test", + "batch_interval_second": 5, + "broker_urls": []interface{}{"localhost:9092"}, + }, + } } func (*ConfigTestSuite) initServerConfigEnv() { diff --git a/config/validation_test.go b/config/validation_test.go index f7fadc0704..5218578bca 100644 --- a/config/validation_test.go +++ b/config/validation_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/config" + "github.com/raystack/optimus/config" ) type ValidationTestSuite struct { diff --git a/core/event/event.go b/core/event/event.go new file mode 100644 index 0000000000..9a5b91f99d --- /dev/null +++ b/core/event/event.go @@ -0,0 +1,27 @@ +package event + +import ( + "time" + + "github.com/google/uuid" + + "github.com/raystack/optimus/internal/errors" +) + +const eventsEntity = "events" + +type Event struct { + ID uuid.UUID + OccurredAt time.Time +} + +func NewBaseEvent() (Event, error) { + id, err := uuid.NewRandom() + if err != nil { + return Event{}, errors.InternalError(eventsEntity, "not able to generate event uuid", err) + } + return Event{ + ID: id, + OccurredAt: time.Now(), + }, nil +} diff --git a/core/event/job.go b/core/event/job.go new file mode 100644 index 0000000000..18a3468f48 --- /dev/null +++ b/core/event/job.go @@ -0,0 +1,155 @@ +package event + +import ( + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/job/handler/v1beta1" + "github.com/raystack/optimus/core/tenant" + pbIntCore "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" + pbInt "github.com/raystack/optimus/protos/raystack/optimus/integration/v1beta1" +) + +type JobCreated struct { + Event + + Job *job.Job +} + +func NewJobCreatedEvent(job *job.Job) (*JobCreated, error) { + baseEvent, err := NewBaseEvent() + if err != nil { + return nil, err + } + return &JobCreated{ + Event: baseEvent, + Job: job, + }, nil +} + +func (j *JobCreated) Bytes() ([]byte, error) { + return jobEventToBytes(j.Event, j.Job, pbInt.OptimusChangeEvent_EVENT_TYPE_JOB_CREATE) +} + +type JobUpdated struct { + Event + + Job *job.Job +} + +func NewJobUpdateEvent(job *job.Job) (*JobUpdated, error) { + baseEvent, err := NewBaseEvent() + if err != nil { + return nil, err + } + return &JobUpdated{ + Event: baseEvent, + Job: job, + }, nil +} + +func (j *JobUpdated) Bytes() ([]byte, error) { + return jobEventToBytes(j.Event, j.Job, pbInt.OptimusChangeEvent_EVENT_TYPE_JOB_UPDATE) +} + +type JobDeleted struct { + Event + + JobName job.Name + JobTenant tenant.Tenant +} + +func NewJobDeleteEvent(tnnt tenant.Tenant, jobName job.Name) (*JobDeleted, error) { + baseEvent, err := NewBaseEvent() + if err != nil { + return nil, err + } + return &JobDeleted{ + Event: baseEvent, + JobName: jobName, + JobTenant: tnnt, + }, nil +} + +func (j *JobDeleted) Bytes() ([]byte, error) { + occurredAt := timestamppb.New(j.Event.OccurredAt) + optEvent := &pbInt.OptimusChangeEvent{ + EventId: j.Event.ID.String(), + OccurredAt: occurredAt, + ProjectName: j.JobTenant.ProjectName().String(), + NamespaceName: j.JobTenant.NamespaceName().String(), + EventType: pbInt.OptimusChangeEvent_EVENT_TYPE_JOB_DELETE, + Payload: &pbInt.OptimusChangeEvent_JobChange{ + JobChange: &pbInt.JobChangePayload{ + JobName: j.JobName.String(), + }, + }, + } + return proto.Marshal(optEvent) +} + +type JobStateChange struct { + Event + + JobName job.Name + JobTenant tenant.Tenant + State job.State +} + +func NewJobStateChangeEvent(tnnt tenant.Tenant, jobName job.Name, state job.State) (*JobStateChange, error) { + baseEvent, err := NewBaseEvent() + if err != nil { + return nil, err + } + return &JobStateChange{ + Event: baseEvent, + JobName: jobName, + JobTenant: tnnt, + State: state, + }, nil +} + +func (j *JobStateChange) Bytes() ([]byte, error) { + occurredAt := timestamppb.New(j.Event.OccurredAt) + var jobStateEnum pbIntCore.JobState + switch j.State { + case job.ENABLED: + jobStateEnum = pbIntCore.JobState_JOB_STATE_ENABLED + case job.DISABLED: + jobStateEnum = pbIntCore.JobState_JOB_STATE_DISABLED + } + optEvent := &pbInt.OptimusChangeEvent{ + EventId: j.Event.ID.String(), + OccurredAt: occurredAt, + ProjectName: j.JobTenant.ProjectName().String(), + NamespaceName: j.JobTenant.NamespaceName().String(), + EventType: pbInt.OptimusChangeEvent_EVENT_TYPE_JOB_STATE_CHANGE, + Payload: &pbInt.OptimusChangeEvent_JobStateChange{ + JobStateChange: &pbInt.JobStateChangePayload{ + JobName: j.JobName.String(), + State: jobStateEnum, + }, + }, + } + return proto.Marshal(optEvent) +} + +func jobEventToBytes(event Event, job *job.Job, eventType pbInt.OptimusChangeEvent_EventType) ([]byte, error) { + jobPb := v1beta1.ToJobProto(job) + occurredAt := timestamppb.New(event.OccurredAt) + optEvent := &pbInt.OptimusChangeEvent{ + EventId: event.ID.String(), + OccurredAt: occurredAt, + ProjectName: job.Tenant().ProjectName().String(), + NamespaceName: job.Tenant().NamespaceName().String(), + EventType: eventType, + Payload: &pbInt.OptimusChangeEvent_JobChange{ + JobChange: &pbInt.JobChangePayload{ + JobName: job.GetName(), + JobSpec: jobPb, + }, + }, + } + return proto.Marshal(optEvent) +} diff --git a/core/event/moderator/handler.go b/core/event/moderator/handler.go new file mode 100644 index 0000000000..27bdcb2b8f --- /dev/null +++ b/core/event/moderator/handler.go @@ -0,0 +1,47 @@ +package moderator + +import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/raystack/salt/log" +) + +var eventQueueCounter = promauto.NewCounter(prometheus.CounterOpts{ + Name: "publisher_events_created_total", + Help: "Events created and to be sent to writer", +}) + +type Event interface { + Bytes() ([]byte, error) +} + +type Handler interface { + HandleEvent(e Event) +} + +type NoOpHandler struct{} + +func (NoOpHandler) HandleEvent(_ Event) {} + +type EventHandler struct { + messageChan chan<- []byte + logger log.Logger +} + +func NewEventHandler(messageChan chan<- []byte, logger log.Logger) *EventHandler { + return &EventHandler{ + messageChan: messageChan, + logger: logger, + } +} + +func (e EventHandler) HandleEvent(event Event) { + bytes, err := event.Bytes() + if err != nil { + e.logger.Error("error converting event to bytes: %v", err) + return + } + + go func() { e.messageChan <- bytes }() + eventQueueCounter.Inc() +} diff --git a/core/event/moderator/handler_test.go b/core/event/moderator/handler_test.go new file mode 100644 index 0000000000..f02c246abc --- /dev/null +++ b/core/event/moderator/handler_test.go @@ -0,0 +1,117 @@ +package moderator_test + +import ( + "errors" + "testing" + "time" + + "github.com/raystack/salt/log" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/raystack/optimus/core/event/moderator" +) + +func TestHandleEvent(t *testing.T) { + const buffer = 8 + logger := log.NewNoop() + timeout := 1 * time.Second + + t.Run("do not send message if there is error in extracting bytes of the event", func(t *testing.T) { + messageChan := make(chan []byte, buffer) + handler := moderator.NewEventHandler(messageChan, logger) + + event := NewEvent(t) + event.On("Bytes").Return(nil, errors.New("cannot get bytes representation")) + + handler.HandleEvent(event) + + timer := time.NewTimer(timeout) + var receivedEventBytes []byte + for { + done := false + select { + case bytes := <-messageChan: + receivedEventBytes = bytes + case <-timer.C: + done = true + } + if done { + break + } + } + assert.Nil(t, receivedEventBytes) + }) + + t.Run("send message if no error is found when extracting bytes from the event", func(t *testing.T) { + messageChan := make(chan []byte, buffer) + handler := moderator.NewEventHandler(messageChan, logger) + + sentEventBytes := []byte("message") + event := NewEvent(t) + event.On("Bytes").Return(sentEventBytes, nil) + + handler.HandleEvent(event) + + timer := time.NewTimer(timeout) + var receivedEventBytes []byte + for { + done := false + select { + case bytes := <-messageChan: + receivedEventBytes = bytes + case <-timer.C: + done = true + } + if done { + break + } + } + assert.EqualValues(t, sentEventBytes, receivedEventBytes) + }) +} + +type Event struct { + mock.Mock +} + +// Bytes provides a mock function with given fields: +func (_m *Event) Bytes() ([]byte, error) { + ret := _m.Called() + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []byte); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +type mockConstructorTestingTNewEvent interface { + mock.TestingT + Cleanup(func()) +} + +// NewEvent creates a new instance of Event. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewEvent(t mockConstructorTestingTNewEvent) *Event { + mock := &Event{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/event/moderator/worker.go b/core/event/moderator/worker.go new file mode 100644 index 0000000000..235664967b --- /dev/null +++ b/core/event/moderator/worker.go @@ -0,0 +1,84 @@ +package moderator + +import ( + "context" + "sync" + "time" + + "github.com/raystack/salt/log" +) + +type Writer interface { + Write(messages [][]byte) error + Close() error +} + +type Worker struct { + mu sync.Mutex + wg sync.WaitGroup + messageChan <-chan []byte + closeChan chan bool + + writer Writer + batchInterval time.Duration + + messages [][]byte + + logger log.Logger +} + +func NewWorker(messageChan <-chan []byte, writer Writer, batchInterval time.Duration, logger log.Logger) *Worker { + return &Worker{ + mu: sync.Mutex{}, + wg: sync.WaitGroup{}, + messageChan: messageChan, + closeChan: make(chan bool), + writer: writer, + batchInterval: batchInterval, + logger: logger, + } +} + +func (w *Worker) Run(ctx context.Context) { + w.wg.Add(1) + defer w.wg.Done() + + ticker := time.NewTicker(w.batchInterval) + for { + select { + case msg := <-w.messageChan: + w.mu.Lock() + w.messages = append(w.messages, msg) + w.mu.Unlock() + case <-ticker.C: + w.Flush() + case <-ctx.Done(): + return + case <-w.closeChan: + return + } + } +} + +func (w *Worker) Flush() { + w.mu.Lock() + defer w.mu.Unlock() + + if len(w.messages) == 0 { + return + } + + if err := w.writer.Write(w.messages); err != nil { + w.logger.Error("error writing message: %v", err) + } else { + w.messages = nil + } +} + +func (w *Worker) Close() error { + go func() { w.closeChan <- true }() + + w.wg.Wait() + w.Flush() + return w.writer.Close() +} diff --git a/core/event/resource.go b/core/event/resource.go new file mode 100644 index 0000000000..61c7553974 --- /dev/null +++ b/core/event/resource.go @@ -0,0 +1,90 @@ +package event + +import ( + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/structpb" + "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" + pbCore "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" + pbInt "github.com/raystack/optimus/protos/raystack/optimus/integration/v1beta1" +) + +type ResourceCreated struct { + Event + + Resource *resource.Resource +} + +func NewResourceCreatedEvent(rsc *resource.Resource) (*ResourceCreated, error) { + baseEvent, err := NewBaseEvent() + if err != nil { + return nil, err + } + return &ResourceCreated{ + Event: baseEvent, + Resource: rsc, + }, nil +} + +func (r ResourceCreated) Bytes() ([]byte, error) { + return resourceEventToBytes(r.Event, r.Resource, pbInt.OptimusChangeEvent_EVENT_TYPE_RESOURCE_CREATE) +} + +type ResourceUpdated struct { + Event + + Resource *resource.Resource +} + +func NewResourceUpdatedEvent(rsc *resource.Resource) (*ResourceUpdated, error) { + baseEvent, err := NewBaseEvent() + if err != nil { + return nil, err + } + return &ResourceUpdated{ + Event: baseEvent, + Resource: rsc, + }, nil +} + +func (r ResourceUpdated) Bytes() ([]byte, error) { + return resourceEventToBytes(r.Event, r.Resource, pbInt.OptimusChangeEvent_EVENT_TYPE_RESOURCE_UPDATE) +} + +func resourceEventToBytes(event Event, rsc *resource.Resource, eventType pbInt.OptimusChangeEvent_EventType) ([]byte, error) { + meta := rsc.Metadata() + if meta == nil { + return nil, errors.InvalidArgument(resource.EntityResource, "missing resource metadata") + } + + pbStruct, err := structpb.NewStruct(rsc.Spec()) + if err != nil { + return nil, errors.InvalidArgument(resource.EntityResource, "unable to convert spec to proto struct") + } + + resourcePb := &pbCore.ResourceSpecification{ + Version: meta.Version, + Name: rsc.FullName(), + Type: rsc.Kind(), + Spec: pbStruct, + Assets: nil, + Labels: meta.Labels, + } + occurredAt := timestamppb.New(event.OccurredAt) + optEvent := &pbInt.OptimusChangeEvent{ + EventId: event.ID.String(), + OccurredAt: occurredAt, + ProjectName: rsc.Tenant().ProjectName().String(), + NamespaceName: rsc.Tenant().NamespaceName().String(), + EventType: eventType, + Payload: &pbInt.OptimusChangeEvent_ResourceChange{ + ResourceChange: &pbInt.ResourceChangePayload{ + DatastoreName: rsc.Store().String(), + Resource: resourcePb, + }, + }, + } + return proto.Marshal(optEvent) +} diff --git a/core/event/scheduler.go b/core/event/scheduler.go new file mode 100644 index 0000000000..5ddfc9280e --- /dev/null +++ b/core/event/scheduler.go @@ -0,0 +1,111 @@ +package event + +import ( + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/raystack/optimus/core/scheduler" + pbInt "github.com/raystack/optimus/protos/raystack/optimus/integration/v1beta1" +) + +type JobRunWaitUpstream struct { + Event + + JobRun *scheduler.JobRun +} + +func (j *JobRunWaitUpstream) Bytes() ([]byte, error) { + return proto.Marshal(toOptimusChangeEvent(j.JobRun, j.Event, pbInt.OptimusChangeEvent_EVENT_TYPE_JOB_WAIT_UPSTREAM)) +} + +type JobRunInProgress struct { + Event + + JobRun *scheduler.JobRun +} + +func (j *JobRunInProgress) Bytes() ([]byte, error) { + return proto.Marshal(toOptimusChangeEvent(j.JobRun, j.Event, pbInt.OptimusChangeEvent_EVENT_TYPE_JOB_IN_PROGRESS)) +} + +type JobRunSuccess struct { + Event + + JobRun *scheduler.JobRun +} + +func (j *JobRunSuccess) Bytes() ([]byte, error) { + return proto.Marshal(toOptimusChangeEvent(j.JobRun, j.Event, pbInt.OptimusChangeEvent_EVENT_TYPE_JOB_SUCCESS)) +} + +type JobRunFailed struct { + Event + + JobRun *scheduler.JobRun +} + +func (j *JobRunFailed) Bytes() ([]byte, error) { + return proto.Marshal(toOptimusChangeEvent(j.JobRun, j.Event, pbInt.OptimusChangeEvent_EVENT_TYPE_JOB_FAILURE)) +} + +func NewJobRunWaitUpstreamEvent(jobRun *scheduler.JobRun) (*JobRunWaitUpstream, error) { + baseEvent, err := NewBaseEvent() + if err != nil { + return nil, err + } + return &JobRunWaitUpstream{ + Event: baseEvent, + JobRun: jobRun, + }, nil +} + +func NewJobRunInProgressEvent(jobRun *scheduler.JobRun) (*JobRunInProgress, error) { + baseEvent, err := NewBaseEvent() + if err != nil { + return nil, err + } + return &JobRunInProgress{ + Event: baseEvent, + JobRun: jobRun, + }, nil +} + +func NewJobRunSuccessEvent(jobRun *scheduler.JobRun) (*JobRunSuccess, error) { + baseEvent, err := NewBaseEvent() + if err != nil { + return nil, err + } + return &JobRunSuccess{ + Event: baseEvent, + JobRun: jobRun, + }, nil +} + +func NewJobRunFailedEvent(jobRun *scheduler.JobRun) (*JobRunFailed, error) { + baseEvent, err := NewBaseEvent() + if err != nil { + return nil, err + } + return &JobRunFailed{ + Event: baseEvent, + JobRun: jobRun, + }, nil +} + +func toOptimusChangeEvent(j *scheduler.JobRun, e Event, eventType pbInt.OptimusChangeEvent_EventType) *pbInt.OptimusChangeEvent { + return &pbInt.OptimusChangeEvent{ + EventId: e.ID.String(), + OccurredAt: timestamppb.New(e.OccurredAt), + ProjectName: j.Tenant.ProjectName().String(), + NamespaceName: j.Tenant.NamespaceName().String(), + EventType: eventType, + Payload: &pbInt.OptimusChangeEvent_JobRun{ + JobRun: &pbInt.JobRunPayload{ + JobName: j.JobName.String(), + ScheduledAt: timestamppb.New(j.ScheduledAt), + JobRunId: j.ID.String(), + StartTime: timestamppb.New(j.StartTime), + }, + }, + } +} diff --git a/core/job/handler/v1beta1/job.go b/core/job/handler/v1beta1/job.go index 10731966d3..1e0b4c5746 100644 --- a/core/job/handler/v1beta1/job.go +++ b/core/job/handler/v1beta1/job.go @@ -7,34 +7,24 @@ import ( "strings" "time" - "github.com/odpf/salt/log" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/raystack/salt/log" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/job/service/filter" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/internal/writer" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/job/service/filter" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/internal/telemetry" + "github.com/raystack/optimus/internal/writer" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" + "github.com/raystack/optimus/sdk/plugin" ) -var ( - jobReplaceAllDurationGauge = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "jobs_replace_all_duration_in_seconds", - Help: "The duration of job replace all in seconds", - }) - jobRefreshDurationGauge = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "jobs_refresh_duration_in_seconds", - Help: "The duration of job refresh in seconds", - }) - jobValidationDurationGauge = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "jobs_validation_duration_in_seconds", - Help: "The duration of job validation in seconds", - }) +const ( + metricReplaceAllDuration = "job_replace_all_duration_seconds" + metricRefreshDuration = "job_refresh_duration_seconds" + metricValidationDuration = "job_validation_duration_seconds" ) type JobHandler struct { @@ -54,13 +44,16 @@ func NewJobHandler(jobService JobService, logger log.Logger) *JobHandler { type JobService interface { Add(ctx context.Context, jobTenant tenant.Tenant, jobs []*job.Spec) error Update(ctx context.Context, jobTenant tenant.Tenant, jobs []*job.Spec) error + SyncState(ctx context.Context, jobTenant tenant.Tenant, disabledJobNames, enabledJobNames []job.Name) error + UpdateState(ctx context.Context, jobTenant tenant.Tenant, jobNames []job.Name, jobState job.State, remark string) error + ChangeNamespace(ctx context.Context, jobSourceTenant, jobNewTenant tenant.Tenant, jobName job.Name) error Delete(ctx context.Context, jobTenant tenant.Tenant, jobName job.Name, cleanFlag, forceFlag bool) (affectedDownstream []job.FullName, err error) Get(ctx context.Context, jobTenant tenant.Tenant, jobName job.Name) (jobSpec *job.Job, err error) GetTaskInfo(ctx context.Context, task job.Task) (*plugin.Info, error) GetByFilter(ctx context.Context, filters ...filter.FilterOpt) (jobSpecs []*job.Job, err error) - ReplaceAll(ctx context.Context, jobTenant tenant.Tenant, jobs []*job.Spec, jobNamesWithValidationError []job.Name, logWriter writer.LogWriter) error + ReplaceAll(ctx context.Context, jobTenant tenant.Tenant, jobs []*job.Spec, jobNamesWithInvalidSpec []job.Name, logWriter writer.LogWriter) error Refresh(ctx context.Context, projectName tenant.ProjectName, namespaceNames, jobNames []string, logWriter writer.LogWriter) error - Validate(ctx context.Context, jobTenant tenant.Tenant, jobSpecs []*job.Spec, logWriter writer.LogWriter) error + Validate(ctx context.Context, jobTenant tenant.Tenant, jobSpecs []*job.Spec, jobNamesWithInvalidSpec []job.Name, logWriter writer.LogWriter) error GetJobBasicInfo(ctx context.Context, jobTenant tenant.Tenant, jobName job.Name, spec *job.Spec) (*job.Job, writer.BufferedLogger) GetUpstreamsToInspect(ctx context.Context, subjectJob *job.Job, localJob bool) ([]*job.Upstream, error) @@ -70,31 +63,34 @@ type JobService interface { func (jh *JobHandler) AddJobSpecifications(ctx context.Context, jobSpecRequest *pb.AddJobSpecificationsRequest) (*pb.AddJobSpecificationsResponse, error) { jobTenant, err := tenant.NewTenant(jobSpecRequest.ProjectName, jobSpecRequest.NamespaceName) if err != nil { + jh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", jobSpecRequest.GetProjectName(), jobSpecRequest.GetNamespaceName(), err) return nil, errors.GRPCErr(err, "failed to add job specifications") } me := errors.NewMultiError("add specs errors") - jobSpecs, _, err := fromJobProtos(jobSpecRequest.Specs) + jobSpecs, invalidSpecs, err := fromJobProtos(jobSpecRequest.Specs) if err != nil { errorMsg := fmt.Sprintf("failure when adapting job specifications: %s", err.Error()) jh.l.Error(errorMsg) me.Append(err) } + raiseJobEventMetric(jobTenant, job.MetricJobEventStateValidationFailed, len(invalidSpecs)) if len(jobSpecs) == 0 { + jh.l.Error("no jobs to be processed") me.Append(errors.NewError(errors.ErrFailedPrecond, job.EntityJob, "no jobs to be processed")) - return nil, errors.MultiToError(me) + return nil, me.ToErr() } if err = jh.jobService.Add(ctx, jobTenant, jobSpecs); err != nil { - jh.l.Error(fmt.Sprintf("failure found when adding job specifications: %s", err.Error())) + jh.l.Error("failure found when adding job specifications: %s", err) me.Append(err) } var responseLog string if len(me.Errors) > 0 { - responseLog = fmt.Sprintf("adding jobs finished with error: %s", errors.MultiToError(me)) + responseLog = fmt.Sprintf("adding jobs finished with error: %s", me.ToErr()) } else { responseLog = "jobs are successfully created" } @@ -129,6 +125,7 @@ func (jh *JobHandler) DeleteJobSpecification(ctx context.Context, deleteRequest msg := fmt.Sprintf("job %s has been deleted", jobName) if deleteRequest.Force && len(affectedDownstream) > 0 { msg = fmt.Sprintf("job %s has been forced deleted. these downstream will be affected: %s", jobName, job.FullNames(affectedDownstream).String()) + jh.l.Warn(msg) } return &pb.DeleteJobSpecificationResponse{ @@ -137,6 +134,43 @@ func (jh *JobHandler) DeleteJobSpecification(ctx context.Context, deleteRequest }, nil } +func (jh *JobHandler) ChangeJobNamespace(ctx context.Context, changeRequest *pb.ChangeJobNamespaceRequest) (*pb.ChangeJobNamespaceResponse, error) { + jobSourceTenant, err := tenant.NewTenant(changeRequest.ProjectName, changeRequest.NamespaceName) + if err != nil { + errorMsg := "failed to adapt source tenant when changing job namespace" + jh.l.Error(fmt.Sprintf("%s: %s", errorMsg, err.Error())) + return nil, errors.GRPCErr(err, errorMsg) + } + jobNewTenant, err := tenant.NewTenant(changeRequest.ProjectName, changeRequest.NewNamespaceName) + if err != nil { + errorMsg := "failed to adapt new tenant when changing job namespace" + jh.l.Error(fmt.Sprintf("%s: %s", errorMsg, err.Error())) + return nil, errors.GRPCErr(err, errorMsg) + } + + jobName, err := job.NameFrom(changeRequest.JobName) + if err != nil { + errorMsg := "failed to adapt job name when changing job specification" + jh.l.Error(fmt.Sprintf("%s: %s", errorMsg, err.Error())) + return nil, errors.GRPCErr(err, errorMsg) + } + + err = jh.jobService.ChangeNamespace(ctx, jobSourceTenant, jobNewTenant, jobName) + if err != nil { + errorMsg := "failed to change job namespace" + jh.l.Error(fmt.Sprintf("%s: %s", errorMsg, err.Error())) + return nil, errors.GRPCErr(err, errorMsg) + } + + telemetry.NewCounter("job_namespace_migrations_total", map[string]string{ + "project": jobSourceTenant.ProjectName().String(), + "namespace_source": jobSourceTenant.NamespaceName().String(), + "namespace_destination": jobNewTenant.NamespaceName().String(), + }).Inc() + + return &pb.ChangeJobNamespaceResponse{}, nil +} + func (jh *JobHandler) UpdateJobSpecifications(ctx context.Context, jobSpecRequest *pb.UpdateJobSpecificationsRequest) (*pb.UpdateJobSpecificationsResponse, error) { jobTenant, err := tenant.NewTenant(jobSpecRequest.ProjectName, jobSpecRequest.NamespaceName) if err != nil { @@ -146,16 +180,17 @@ func (jh *JobHandler) UpdateJobSpecifications(ctx context.Context, jobSpecReques } me := errors.NewMultiError("update specs errors") - jobSpecs, _, err := fromJobProtos(jobSpecRequest.Specs) + jobSpecs, invalidSpecs, err := fromJobProtos(jobSpecRequest.Specs) if err != nil { errorMsg := fmt.Sprintf("failure when adapting job specifications: %s", err.Error()) jh.l.Error(errorMsg) me.Append(err) } + raiseJobEventMetric(jobTenant, job.MetricJobEventStateValidationFailed, len(invalidSpecs)) if len(jobSpecs) == 0 { me.Append(errors.NewError(errors.ErrFailedPrecond, job.EntityJob, "no jobs to be processed")) - return nil, errors.MultiToError(me) + return nil, me.ToErr() } if err = jh.jobService.Update(ctx, jobTenant, jobSpecs); err != nil { @@ -165,7 +200,7 @@ func (jh *JobHandler) UpdateJobSpecifications(ctx context.Context, jobSpecReques var responseLog string if len(me.Errors) > 0 { - responseLog = fmt.Sprintf("update jobs finished with error: %s", errors.MultiToError(me)) + responseLog = fmt.Sprintf("update jobs finished with error: %s", me.ToErr()) } else { responseLog = "jobs are successfully updated" } @@ -178,10 +213,12 @@ func (jh *JobHandler) UpdateJobSpecifications(ctx context.Context, jobSpecReques func (jh *JobHandler) GetJobSpecification(ctx context.Context, req *pb.GetJobSpecificationRequest) (*pb.GetJobSpecificationResponse, error) { jobTenant, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) if err != nil { + jh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, err } jobName, err := job.NameFrom(req.GetJobName()) if err != nil { + jh.l.Error("error adapating job name [%s]: %s", req.GetJobName(), err) return nil, err } @@ -194,7 +231,7 @@ func (jh *JobHandler) GetJobSpecification(ctx context.Context, req *pb.GetJobSpe // TODO: return 404 if job is not found return &pb.GetJobSpecificationResponse{ - Spec: toJobProto(jobSpec), + Spec: ToJobProto(jobSpec), }, nil } @@ -211,7 +248,7 @@ func (jh *JobHandler) GetJobSpecifications(ctx context.Context, req *pb.GetJobSp jobSpecResponseProtos = append(jobSpecResponseProtos, &pb.JobSpecificationResponse{ ProjectName: jobSpec.Tenant().ProjectName().String(), NamespaceName: jobSpec.Tenant().NamespaceName().String(), - Job: toJobProto(jobSpec), + Job: ToJobProto(jobSpec), }) } @@ -229,7 +266,7 @@ func (jh *JobHandler) ListJobSpecification(ctx context.Context, req *pb.ListJobS jobSpecificationProtos := make([]*pb.JobSpecification, len(jobSpecs)) for i, jobSpec := range jobSpecs { - jobSpecificationProtos[i] = toJobProto(jobSpec) + jobSpecificationProtos[i] = ToJobProto(jobSpec) } // TODO: make a stream response @@ -238,10 +275,11 @@ func (jh *JobHandler) ListJobSpecification(ctx context.Context, req *pb.ListJobS }, merr } -func (*JobHandler) GetWindow(_ context.Context, req *pb.GetWindowRequest) (*pb.GetWindowResponse, error) { +func (jh *JobHandler) GetWindow(_ context.Context, req *pb.GetWindowRequest) (*pb.GetWindowResponse, error) { // TODO: the default version to be deprecated & made mandatory in future releases version := 1 if err := req.GetScheduledAt().CheckValid(); err != nil { + jh.l.Error("scheduled at is invalid: %s", err) return nil, fmt.Errorf("%w: failed to parse schedule time %s", err, req.GetScheduledAt()) } @@ -250,9 +288,11 @@ func (*JobHandler) GetWindow(_ context.Context, req *pb.GetWindowRequest) (*pb.G } window, err := models.NewWindow(version, req.GetTruncateTo(), req.GetOffset(), req.GetSize()) if err != nil { + jh.l.Error("error initializing window with version [%d]: %s", req.Version, err) return nil, err } if err := window.Validate(); err != nil { + jh.l.Error("error validating window: %s", err) return nil, err } @@ -285,11 +325,14 @@ func (jh *JobHandler) ReplaceAllJobSpecifications(stream pb.JobSpecificationServ if errors.Is(err, io.EOF) { break } + errMsg := fmt.Sprintf("error encountered when receiving stream request: %s", err) + jh.l.Error(errMsg) + responseWriter.Write(writer.LogLevelError, errMsg) return err } responseWriter.Write(writer.LogLevelInfo, fmt.Sprintf("[%s] received %d job specs", request.GetNamespaceName(), len(request.GetJobs()))) - jh.l.Info("replacing all job specifications for project [%s] namespace [%s]", request.GetProjectName(), request.GetNamespaceName()) + jh.l.Debug("replacing all job specifications for project [%s] namespace [%s]", request.GetProjectName(), request.GetNamespaceName()) startTime := time.Now() jobTenant, err := tenant.NewTenant(request.ProjectName, request.NamespaceName) @@ -302,7 +345,7 @@ func (jh *JobHandler) ReplaceAllJobSpecifications(stream pb.JobSpecificationServ continue } - jobSpecs, jobNamesWithValidationErrors, err := fromJobProtos(request.Jobs) + jobSpecs, jobNamesWithInvalidSpec, err := fromJobProtos(request.Jobs) if err != nil { errMsg := fmt.Sprintf("[%s] failed to adapt job specifications: %s", request.GetNamespaceName(), err.Error()) jh.l.Error(errMsg) @@ -311,7 +354,7 @@ func (jh *JobHandler) ReplaceAllJobSpecifications(stream pb.JobSpecificationServ errMessages = append(errMessages, errMsg) } - if err := jh.jobService.ReplaceAll(stream.Context(), jobTenant, jobSpecs, jobNamesWithValidationErrors, responseWriter); err != nil { + if err := jh.jobService.ReplaceAll(stream.Context(), jobTenant, jobSpecs, jobNamesWithInvalidSpec, responseWriter); err != nil { errMsg := fmt.Sprintf("[%s] replace all job specifications failure: %s", request.NamespaceName, err.Error()) jh.l.Error(errMsg) responseWriter.Write(writer.LogLevelError, errMsg) @@ -320,8 +363,11 @@ func (jh *JobHandler) ReplaceAllJobSpecifications(stream pb.JobSpecificationServ } processDuration := time.Since(startTime) - jh.l.Info("finished replacing all job specifications for project [%s] namespace [%s], took %s", request.GetProjectName(), request.GetNamespaceName(), processDuration) - jobReplaceAllDurationGauge.Set(processDuration.Seconds()) + jh.l.Debug("finished replacing all job specifications for project [%s] namespace [%s], took %s", request.GetProjectName(), request.GetNamespaceName(), processDuration) + telemetry.NewGauge(metricReplaceAllDuration, map[string]string{ + "project": jobTenant.ProjectName().String(), + "namespace": jobTenant.NamespaceName().String(), + }).Add(processDuration.Seconds()) } if len(errNamespaces) > 0 { errMessageSummary := strings.Join(errMessages, "\n") @@ -334,12 +380,13 @@ func (jh *JobHandler) ReplaceAllJobSpecifications(stream pb.JobSpecificationServ } func (jh *JobHandler) RefreshJobs(request *pb.RefreshJobsRequest, stream pb.JobSpecificationService_RefreshJobsServer) error { - jh.l.Info("refreshing jobs for project [%s]", request.GetProjectName()) startTime := time.Now() defer func() { processDuration := time.Since(startTime) - jobRefreshDurationGauge.Set(processDuration.Seconds()) - jh.l.Info("finished refreshing jobs for project [%s], took %s", request.GetProjectName(), processDuration) + telemetry.NewGauge(metricRefreshDuration, map[string]string{ + "project": request.ProjectName, + }).Add(processDuration.Seconds()) + jh.l.Debug("finished refreshing jobs for project [%s], took %s", request.GetProjectName(), processDuration) }() responseWriter := writer.NewRefreshJobResponseWriter(stream) @@ -359,57 +406,63 @@ func (jh *JobHandler) RefreshJobs(request *pb.RefreshJobsRequest, stream pb.JobS return err } responseWriter.Write(writer.LogLevelInfo, "jobs refreshed successfully") + return nil } func (jh *JobHandler) CheckJobSpecifications(req *pb.CheckJobSpecificationsRequest, stream pb.JobSpecificationService_CheckJobSpecificationsServer) error { - jh.l.Info("validating jobs for project [%s] namespace [%s]", req.GetProjectName(), req.GetNamespaceName()) startTime := time.Now() responseWriter := writer.NewCheckJobSpecificationResponseWriter(stream) jobTenant, err := tenant.NewTenant(req.ProjectName, req.NamespaceName) if err != nil { + jh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return err } me := errors.NewMultiError("check / validate job spec errors") - jobSpecs, _, err := fromJobProtos(req.Jobs) + jobSpecs, jobNamesWithInvalidSpec, err := fromJobProtos(req.Jobs) if err != nil { - errorMsg := fmt.Sprintf("failure when adapting job specifications: %s", err.Error()) - jh.l.Error(errorMsg) + jh.l.Error("error when adapting job specifications: %s", err) me.Append(err) } - if err := jh.jobService.Validate(stream.Context(), jobTenant, jobSpecs, responseWriter); err != nil { + if err := jh.jobService.Validate(stream.Context(), jobTenant, jobSpecs, jobNamesWithInvalidSpec, responseWriter); err != nil { + jh.l.Error("error validating job: %s", err) me.Append(err) } processDuration := time.Since(startTime) - jobValidationDurationGauge.Set(processDuration.Seconds()) + telemetry.NewGauge(metricValidationDuration, map[string]string{ + "project": jobTenant.ProjectName().String(), + "namespace": jobTenant.NamespaceName().String(), + }).Add(processDuration.Seconds()) - jh.l.Info("finished validating jobs for project [%s] namespace [%s], took %s", req.GetProjectName(), req.GetNamespaceName(), processDuration) - - return errors.MultiToError(me) + return me.ToErr() } func (jh *JobHandler) GetJobTask(ctx context.Context, req *pb.GetJobTaskRequest) (*pb.GetJobTaskResponse, error) { jobTenant, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) if err != nil { + jh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, err } jobName, err := job.NameFrom(req.GetJobName()) if err != nil { + jh.l.Error("error adapting job name [%s]: %s", req.GetJobName(), err) return nil, err } jobResult, err := jh.jobService.Get(ctx, jobTenant, jobName) if err != nil { + jh.l.Error("error getting job: %s", err) return nil, err } taskInfo, err := jh.jobService.GetTaskInfo(ctx, jobResult.Spec().Task()) if err != nil { + jh.l.Error("error getting task info: %s", err) return nil, err } @@ -436,9 +489,81 @@ func (jh *JobHandler) GetJobTask(ctx context.Context, req *pb.GetJobTaskRequest) }, nil } +func (jh *JobHandler) UpdateJobsState(ctx context.Context, req *pb.UpdateJobsStateRequest) (*pb.UpdateJobsStateResponse, error) { + jobTenant, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) + if err != nil { + jh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) + return nil, err + } + jobState, err := job.StateFrom(req.GetState().String()) + if err != nil { + jh.l.Error("error adapting job state %s: %s", req.GetState().String(), err) + return nil, err + } + + remark := req.Remark + if len(remark) < 1 { + jh.l.Error("empty remark for changing %d jobs state of %s:%s to %s", len(req.GetJobNames()), jobState, jobTenant.ProjectName(), jobTenant.NamespaceName()) + return nil, errors.InvalidArgument(job.EntityJob, "can not update job state without a valid remark") + } + var jobNames []job.Name + for _, name := range req.GetJobNames() { + jobName, err := job.NameFrom(name) + if err != nil { + jh.l.Error("error adapting job name: '%s', err: %s", name, err.Error()) + return nil, err + } + jobNames = append(jobNames, jobName) + } + + err = jh.jobService.UpdateState(ctx, jobTenant, jobNames, jobState, remark) + if err != nil { + jh.l.Error("error updating job state", err.Error()) + return nil, err + } + + return &pb.UpdateJobsStateResponse{}, nil +} + +func (jh *JobHandler) SyncJobsState(ctx context.Context, req *pb.SyncJobsStateRequest) (*pb.SyncJobsStateResponse, error) { + jobTenant, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) + if err != nil { + jh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) + return nil, err + } + + var enabledJobNames, disabledJobNames []job.Name + for _, jobState := range req.GetJobStates() { + state, err := job.StateFrom(jobState.State.String()) + if err != nil { + jh.l.Error("error adapting job state %s: %s", jobState.State.String(), err) + return nil, err + } + jobName, err := job.NameFrom(jobState.JobName) + if err != nil { + jh.l.Error("error adapting job name: '%s', err: %s", jobState.JobName, err.Error()) + return nil, err + } + if state == job.DISABLED { + disabledJobNames = append(disabledJobNames, jobName) + } else { + enabledJobNames = append(enabledJobNames, jobName) + } + } + + err = jh.jobService.SyncState(ctx, jobTenant, disabledJobNames, enabledJobNames) + if err != nil { + jh.l.Error("error syncing job state for project: %s, namespace: %s, err: %s", jobTenant.ProjectName, jobTenant.NamespaceName(), err.Error()) + return nil, err + } + + return &pb.SyncJobsStateResponse{}, nil +} + func (jh *JobHandler) JobInspect(ctx context.Context, req *pb.JobInspectRequest) (*pb.JobInspectResponse, error) { jobTenant, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) if err != nil { + jh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, err } @@ -448,14 +573,14 @@ func (jh *JobHandler) JobInspect(ctx context.Context, req *pb.JobInspectRequest) if req.GetSpec() != nil { jobSpec, err = fromJobProto(req.GetSpec()) if err != nil { - errMsg := fmt.Sprintf("cannot adapt job specification %s: %s", req.Spec.Name, err.Error()) - jh.l.Error(errMsg) + jh.l.Error("cannot adapt job specification %s: %s", req.Spec.Name, err) return nil, err } localJob = true } else { jobName, err = job.NameFrom(req.JobName) if err != nil { + jh.l.Error("error adapting job name %s: %s", req.JobName, err) return nil, err } } @@ -473,12 +598,14 @@ func (jh *JobHandler) JobInspect(ctx context.Context, req *pb.JobInspectRequest) upstreamLogs := &writer.BufferedLogger{} upstreams, err := jh.jobService.GetUpstreamsToInspect(ctx, subjectJob, localJob) if err != nil { + jh.l.Error("error getting upstreams to inspect: %s", err) upstreamLogs.Write(writer.LogLevelError, fmt.Sprintf("unable to get upstream jobs: %v", err.Error())) } downstreamLogs := &writer.BufferedLogger{} downstreams, err := jh.jobService.GetDownstream(ctx, subjectJob, localJob) if err != nil { + jh.l.Error("error getting downstream: %s", err) downstreamLogs.Write(writer.LogLevelError, fmt.Sprintf("unable to get downstream jobs: %v", err.Error())) } @@ -494,3 +621,11 @@ func (jh *JobHandler) JobInspect(ctx context.Context, req *pb.JobInspectRequest) }, }, nil } + +func raiseJobEventMetric(jobTenant tenant.Tenant, state string, metricValue int) { + telemetry.NewCounter(job.MetricJobEvent, map[string]string{ + "project": jobTenant.ProjectName().String(), + "namespace": jobTenant.NamespaceName().String(), + "status": state, + }).Add(float64(metricValue)) +} diff --git a/core/job/handler/v1beta1/job_adapter.go b/core/job/handler/v1beta1/job_adapter.go index 0f119486e6..0333cdaa3d 100644 --- a/core/job/handler/v1beta1/job_adapter.go +++ b/core/job/handler/v1beta1/job_adapter.go @@ -5,14 +5,14 @@ import ( "google.golang.org/protobuf/types/known/durationpb" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/internal/utils" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/internal/utils" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) -func toJobProto(jobEntity *job.Job) *pb.JobSpecification { +func ToJobProto(jobEntity *job.Job) *pb.JobSpecification { return &pb.JobSpecification{ Version: int32(jobEntity.Spec().Version()), Name: jobEntity.Spec().Name().String(), @@ -21,7 +21,6 @@ func toJobProto(jobEntity *job.Job) *pb.JobSpecification { EndDate: jobEntity.Spec().Schedule().EndDate().String(), Interval: jobEntity.Spec().Schedule().Interval(), DependsOnPast: jobEntity.Spec().Schedule().DependsOnPast(), - CatchUp: jobEntity.Spec().Schedule().CatchUp(), TaskName: jobEntity.Spec().Task().Name().String(), Config: fromConfig(jobEntity.Spec().Task().Config()), WindowSize: jobEntity.Spec().Window().GetSize(), @@ -57,7 +56,7 @@ func fromJobProtos(protoJobSpecs []*pb.JobSpecification) ([]*job.Spec, []job.Nam } jobSpecs = append(jobSpecs, jobSpec) } - return jobSpecs, jobNameWithValidationErrors, errors.MultiToError(me) + return jobSpecs, jobNameWithValidationErrors, me.ToErr() } func fromJobProto(js *pb.JobSpecification) (*job.Spec, error) { @@ -76,7 +75,6 @@ func fromJobProto(js *pb.JobSpecification) (*job.Spec, error) { } scheduleBuilder := job.NewScheduleBuilder(startDate). - WithCatchUp(js.CatchUp). WithDependsOnPast(js.DependsOnPast). WithInterval(js.Interval) @@ -413,7 +411,7 @@ func toBasicInfoSectionProto(jobDetail *job.Job, logMessages []*pb.Log) *pb.JobI return &pb.JobInspectResponse_BasicInfoSection{ Destination: jobDetail.Destination().String(), Source: sources, - Job: toJobProto(jobDetail), + Job: ToJobProto(jobDetail), Notice: logMessages, } } diff --git a/core/job/handler/v1beta1/job_test.go b/core/job/handler/v1beta1/job_test.go index 790ff21bb3..6ed8ba14c6 100644 --- a/core/job/handler/v1beta1/job_test.go +++ b/core/job/handler/v1beta1/job_test.go @@ -7,20 +7,20 @@ import ( "testing" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/metadata" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/job/handler/v1beta1" - "github.com/odpf/optimus/core/job/service/filter" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/internal/writer" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/job/handler/v1beta1" + "github.com/raystack/optimus/core/job/service/filter" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/internal/writer" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" + "github.com/raystack/optimus/sdk/plugin" ) func TestNewJobHandler(t *testing.T) { @@ -603,6 +603,145 @@ func TestNewJobHandler(t *testing.T) { assert.Contains(t, resp.Log, "error") }) }) + t.Run("ChangeJobNamespace", func(t *testing.T) { + newNamespaceName := "newNamespace" + + t.Run("fail if invalid params", func(t *testing.T) { + t.Run("invalid source namespace", func(t *testing.T) { + jobService := new(JobService) + defer jobService.AssertExpectations(t) + jobAName, _ := job.NameFrom("job-A") + request := &pb.ChangeJobNamespaceRequest{ + ProjectName: project.Name().String(), + NamespaceName: "", + JobName: jobAName.String(), + NewNamespaceName: newNamespaceName, + } + jobHandler := v1beta1.NewJobHandler(jobService, log) + _, err := jobHandler.ChangeJobNamespace(ctx, request) + assert.ErrorContains(t, err, "failed to adapt source tenant when changing job namespace") + }) + t.Run("invalid new namespace", func(t *testing.T) { + jobService := new(JobService) + defer jobService.AssertExpectations(t) + + jobAName, _ := job.NameFrom("job-A") + request := &pb.ChangeJobNamespaceRequest{ + ProjectName: project.Name().String(), + NamespaceName: namespace.Name().String(), + JobName: jobAName.String(), + NewNamespaceName: "", + } + jobHandler := v1beta1.NewJobHandler(jobService, log) + _, err := jobHandler.ChangeJobNamespace(ctx, request) + assert.ErrorContains(t, err, "failed to adapt new tenant when changing job namespace") + }) + t.Run("invalid job name", func(t *testing.T) { + jobService := new(JobService) + defer jobService.AssertExpectations(t) + + request := &pb.ChangeJobNamespaceRequest{ + ProjectName: project.Name().String(), + NamespaceName: namespace.Name().String(), + JobName: "", + NewNamespaceName: newNamespaceName, + } + jobHandler := v1beta1.NewJobHandler(jobService, log) + _, err := jobHandler.ChangeJobNamespace(ctx, request) + assert.ErrorContains(t, err, "failed to adapt job name when changing job specification") + }) + }) + + t.Run("Change job namespace successfully", func(t *testing.T) { + jobService := new(JobService) + + jobAName, _ := job.NameFrom("job-A") + request := &pb.ChangeJobNamespaceRequest{ + ProjectName: project.Name().String(), + NamespaceName: namespace.Name().String(), + JobName: jobAName.String(), + NewNamespaceName: newNamespaceName, + } + newTenant, _ := tenant.NewTenant(project.Name().String(), newNamespaceName) + jobService.On("ChangeNamespace", ctx, sampleTenant, newTenant, jobAName).Return(nil) + + jobHandler := v1beta1.NewJobHandler(jobService, log) + _, err := jobHandler.ChangeJobNamespace(ctx, request) + assert.NoError(t, err) + }) + t.Run("fail to Change job namespace", func(t *testing.T) { + jobService := new(JobService) + + jobAName, _ := job.NameFrom("job-A") + request := &pb.ChangeJobNamespaceRequest{ + ProjectName: project.Name().String(), + NamespaceName: namespace.Name().String(), + JobName: jobAName.String(), + NewNamespaceName: newNamespaceName, + } + newTenant, _ := tenant.NewTenant(project.Name().String(), newNamespaceName) + jobService.On("ChangeNamespace", ctx, sampleTenant, newTenant, jobAName).Return(errors.New("error in changing namespace")) + + jobHandler := v1beta1.NewJobHandler(jobService, log) + _, err := jobHandler.ChangeJobNamespace(ctx, request) + assert.ErrorContains(t, err, "error in changing namespace: failed to change job namespace") + }) + }) + t.Run("UpdateJobState", func(t *testing.T) { + updateRemark := "job state update remark" + jobAName, _ := job.NameFrom("job-A") + t.Run("fail if improper tenant info", func(t *testing.T) { + request := &pb.UpdateJobsStateRequest{ + ProjectName: project.Name().String(), + NamespaceName: "", + State: pb.JobState_JOB_STATE_ENABLED, + Remark: updateRemark, + JobNames: []string{jobAName.String()}, + } + + jobHandler := v1beta1.NewJobHandler(nil, log) + _, err := jobHandler.UpdateJobsState(ctx, request) + assert.ErrorContains(t, err, "namespace name is empty") + }) + t.Run("fail if improper job name", func(t *testing.T) { + request := &pb.UpdateJobsStateRequest{ + ProjectName: project.Name().String(), + NamespaceName: namespace.Name().String(), + State: pb.JobState_JOB_STATE_ENABLED, + Remark: updateRemark, + JobNames: []string{""}, + } + + jobHandler := v1beta1.NewJobHandler(nil, log) + _, err := jobHandler.UpdateJobsState(ctx, request) + assert.ErrorContains(t, err, "name is empty") + }) + t.Run("fail if State is improper", func(t *testing.T) { + request := &pb.UpdateJobsStateRequest{ + ProjectName: project.Name().String(), + NamespaceName: namespace.Name().String(), + State: pb.JobState_JOB_STATE_UNSPECIFIED, + Remark: updateRemark, + JobNames: []string{jobAName.String()}, + } + jobHandler := v1beta1.NewJobHandler(nil, log) + _, err := jobHandler.UpdateJobsState(ctx, request) + assert.ErrorContains(t, err, "invalid state") + }) + t.Run("fail if remark is empty", func(t *testing.T) { + request := &pb.UpdateJobsStateRequest{ + ProjectName: project.Name().String(), + NamespaceName: namespace.Name().String(), + JobNames: []string{jobAName.String()}, + State: pb.JobState_JOB_STATE_ENABLED, + Remark: "", + } + + jobHandler := v1beta1.NewJobHandler(nil, log) + _, err := jobHandler.UpdateJobsState(ctx, request) + assert.ErrorContains(t, err, "can not update job state without a valid remark") + }) + }) t.Run("DeleteJobSpecification", func(t *testing.T) { t.Run("deletes job successfully", func(t *testing.T) { jobService := new(JobService) @@ -699,7 +838,7 @@ func TestNewJobHandler(t *testing.T) { req := &pb.GetWindowRequest{ ScheduledAt: nil, } - jobHandler := v1beta1.NewJobHandler(nil, nil) + jobHandler := v1beta1.NewJobHandler(nil, log) resp, err := jobHandler.GetWindow(ctx, req) assert.Error(t, err) @@ -710,7 +849,7 @@ func TestNewJobHandler(t *testing.T) { Version: 3, ScheduledAt: timestamppb.New(time.Date(2022, 11, 18, 13, 0, 0, 0, time.UTC)), } - jobHandler := v1beta1.NewJobHandler(nil, nil) + jobHandler := v1beta1.NewJobHandler(nil, log) resp, err := jobHandler.GetWindow(ctx, req) assert.Error(t, err) @@ -722,7 +861,7 @@ func TestNewJobHandler(t *testing.T) { ScheduledAt: timestamppb.New(time.Date(2022, 11, 18, 13, 0, 0, 0, time.UTC)), Size: "1", } - jobHandler := v1beta1.NewJobHandler(nil, nil) + jobHandler := v1beta1.NewJobHandler(nil, log) resp, err := jobHandler.GetWindow(ctx, req) assert.Error(t, err) @@ -736,7 +875,7 @@ func TestNewJobHandler(t *testing.T) { Offset: "0", TruncateTo: "d", } - jobHandler := v1beta1.NewJobHandler(nil, nil) + jobHandler := v1beta1.NewJobHandler(nil, log) resp, err := jobHandler.GetWindow(ctx, req) assert.NoError(t, err) @@ -749,7 +888,7 @@ func TestNewJobHandler(t *testing.T) { Offset: "0", TruncateTo: "d", } - jobHandler := v1beta1.NewJobHandler(nil, nil) + jobHandler := v1beta1.NewJobHandler(nil, log) resp, err := jobHandler.GetWindow(ctx, req) assert.NoError(t, err) @@ -757,7 +896,7 @@ func TestNewJobHandler(t *testing.T) { }) }) t.Run("ReplaceAllJobSpecifications", func(t *testing.T) { - var jobNamesWithValidationError []job.Name + var jobNamesWithInvalidSpec []job.Name t.Run("replaces all job specifications of a tenant", func(t *testing.T) { jobService := new(JobService) @@ -800,7 +939,7 @@ func TestNewJobHandler(t *testing.T) { stream.On("Recv").Return(request, nil).Once() stream.On("Recv").Return(nil, io.EOF).Once() - jobService.On("ReplaceAll", ctx, sampleTenant, mock.Anything, jobNamesWithValidationError, mock.Anything).Return(nil) + jobService.On("ReplaceAll", ctx, sampleTenant, mock.Anything, jobNamesWithInvalidSpec, mock.Anything).Return(nil) stream.On("Send", mock.AnythingOfType("*optimus.ReplaceAllJobSpecificationsResponse")).Return(nil).Twice() @@ -845,8 +984,8 @@ func TestNewJobHandler(t *testing.T) { stream.On("Recv").Return(request2, nil).Once() stream.On("Recv").Return(nil, io.EOF).Once() - jobService.On("ReplaceAll", ctx, sampleTenant, mock.Anything, jobNamesWithValidationError, mock.Anything).Return(nil) - jobService.On("ReplaceAll", ctx, otherTenant, mock.Anything, jobNamesWithValidationError, mock.Anything).Return(nil) + jobService.On("ReplaceAll", ctx, sampleTenant, mock.Anything, jobNamesWithInvalidSpec, mock.Anything).Return(nil) + jobService.On("ReplaceAll", ctx, otherTenant, mock.Anything, jobNamesWithInvalidSpec, mock.Anything).Return(nil) stream.On("Send", mock.AnythingOfType("*optimus.ReplaceAllJobSpecificationsResponse")).Return(nil).Twice() @@ -939,7 +1078,7 @@ func TestNewJobHandler(t *testing.T) { stream.On("Recv").Return(request2, nil).Once() stream.On("Recv").Return(nil, io.EOF).Once() - jobService.On("ReplaceAll", ctx, sampleTenant, mock.Anything, jobNamesWithValidationError, mock.Anything).Return(nil) + jobService.On("ReplaceAll", ctx, sampleTenant, mock.Anything, jobNamesWithInvalidSpec, mock.Anything).Return(nil) stream.On("Send", mock.AnythingOfType("*optimus.ReplaceAllJobSpecificationsResponse")).Return(nil).Times(4) @@ -988,7 +1127,7 @@ func TestNewJobHandler(t *testing.T) { stream.On("Recv").Return(request, nil).Once() stream.On("Recv").Return(nil, io.EOF).Once() - jobService.On("ReplaceAll", ctx, sampleTenant, mock.Anything, jobNamesWithValidationError, mock.Anything).Return(errors.New("internal error")) + jobService.On("ReplaceAll", ctx, sampleTenant, mock.Anything, jobNamesWithInvalidSpec, mock.Anything).Return(errors.New("internal error")) stream.On("Send", mock.AnythingOfType("*optimus.ReplaceAllJobSpecificationsResponse")).Return(nil).Times(3) @@ -1355,7 +1494,6 @@ func TestNewJobHandler(t *testing.T) { EndDate: specA.Schedule().EndDate().String(), Interval: specA.Schedule().Interval(), DependsOnPast: specA.Schedule().DependsOnPast(), - CatchUp: specA.Schedule().CatchUp(), TaskName: specA.Task().Name().String(), WindowSize: specA.Window().GetSize(), WindowOffset: specA.Window().GetOffset(), @@ -1495,7 +1633,6 @@ func TestNewJobHandler(t *testing.T) { EndDate: specA.Schedule().EndDate().String(), Interval: specA.Schedule().Interval(), DependsOnPast: specA.Schedule().DependsOnPast(), - CatchUp: specA.Schedule().CatchUp(), TaskName: specA.Task().Name().String(), WindowSize: specA.Window().GetSize(), WindowOffset: specA.Window().GetOffset(), @@ -1641,7 +1778,6 @@ func TestNewJobHandler(t *testing.T) { EndDate: specA.Schedule().EndDate().String(), Interval: specA.Schedule().Interval(), DependsOnPast: specA.Schedule().DependsOnPast(), - CatchUp: specA.Schedule().CatchUp(), TaskName: specA.Task().Name().String(), WindowSize: specA.Window().GetSize(), WindowOffset: specA.Window().GetOffset(), @@ -1688,7 +1824,7 @@ func TestNewJobHandler(t *testing.T) { }, } - handler := v1beta1.NewJobHandler(jobService, nil) + handler := v1beta1.NewJobHandler(jobService, log) result, err := handler.JobInspect(ctx, req) assert.NoError(t, err) assert.Equal(t, resp, result) @@ -1724,7 +1860,7 @@ func TestNewJobHandler(t *testing.T) { req := &pb.GetJobTaskRequest{} - handler := v1beta1.NewJobHandler(jobService, nil) + handler := v1beta1.NewJobHandler(jobService, log) resp, err := handler.GetJobTask(ctx, req) assert.Error(t, err) assert.Nil(t, resp) @@ -1739,7 +1875,7 @@ func TestNewJobHandler(t *testing.T) { NamespaceName: sampleTenant.NamespaceName().String(), } - handler := v1beta1.NewJobHandler(jobService, nil) + handler := v1beta1.NewJobHandler(jobService, log) resp, err := handler.GetJobTask(ctx, req) assert.Error(t, err) assert.Nil(t, resp) @@ -1756,7 +1892,7 @@ func TestNewJobHandler(t *testing.T) { } jobService.On("Get", ctx, sampleTenant, job.Name("job-A")).Return(nil, errors.New("error encountered")) - handler := v1beta1.NewJobHandler(jobService, nil) + handler := v1beta1.NewJobHandler(jobService, log) resp, err := handler.GetJobTask(ctx, req) assert.Error(t, err) assert.Nil(t, resp) @@ -1776,7 +1912,7 @@ func TestNewJobHandler(t *testing.T) { jobService.On("Get", ctx, sampleTenant, jobA.Spec().Name()).Return(jobA, nil) jobService.On("GetTaskInfo", ctx, jobA.Spec().Task()).Return(nil, errors.New("error encountered")) - handler := v1beta1.NewJobHandler(jobService, nil) + handler := v1beta1.NewJobHandler(jobService, log) resp, err := handler.GetJobTask(ctx, req) assert.Error(t, err) assert.Nil(t, resp) @@ -1797,11 +1933,11 @@ func TestNewJobHandler(t *testing.T) { taskInfo := &plugin.Info{ Name: "bq2bq", Description: "task info desc", - Image: "odpf/bq2bq:latest", + Image: "raystack/bq2bq:latest", } jobService.On("Get", ctx, sampleTenant, jobA.Spec().Name()).Return(jobA, nil) jobService.On("GetTaskInfo", ctx, jobA.Spec().Task()).Return(taskInfo, nil) - handler := v1beta1.NewJobHandler(jobService, nil) + handler := v1beta1.NewJobHandler(jobService, log) resp, err := handler.GetJobTask(ctx, req) assert.NoError(t, err) assert.NotNil(t, resp) @@ -1852,6 +1988,24 @@ func (_m *JobService) Delete(ctx context.Context, jobTenant tenant.Tenant, jobNa return r0, r1 } +// ChangeNamespace provides a mock function with given fields: ctx, jobName, jobTenant, jobNewTenant +func (_m *JobService) ChangeNamespace(ctx context.Context, jobTenant, jobNewTenant tenant.Tenant, jobName job.Name) error { + ret := _m.Called(ctx, jobTenant, jobNewTenant, jobName) + return ret.Error(0) +} + +// UpdateState provides a mock function with given fields: ctx, jobTenant, jobNames, jobState, remark +func (_m *JobService) UpdateState(ctx context.Context, jobTenant tenant.Tenant, jobNames []job.Name, jobState job.State, remark string) error { + ret := _m.Called(ctx, jobTenant, jobNames, jobState, remark) + return ret.Error(0) +} + +// UpdateState provides a mock function with given fields: ctx, jobTenant, disabledJobNames, enabledJobNames +func (_m *JobService) SyncState(ctx context.Context, jobTenant tenant.Tenant, disabledJobNames, enabledJobNames []job.Name) error { + ret := _m.Called(ctx, jobTenant, disabledJobNames, enabledJobNames) + return ret.Error(0) +} + // Get provides a mock function with given fields: ctx, jobTenant, jobName func (_m *JobService) Get(ctx context.Context, jobTenant tenant.Tenant, jobName job.Name) (*job.Job, error) { ret := _m.Called(ctx, jobTenant, jobName) @@ -2011,13 +2165,13 @@ func (_m *JobService) Refresh(ctx context.Context, projectName tenant.ProjectNam return r0 } -// ReplaceAll provides a mock function with given fields: ctx, jobTenant, jobs, jobNamesWithValidationError, logWriter -func (_m *JobService) ReplaceAll(ctx context.Context, jobTenant tenant.Tenant, jobs []*job.Spec, jobNamesWithValidationError []job.Name, logWriter writer.LogWriter) error { - ret := _m.Called(ctx, jobTenant, jobs, jobNamesWithValidationError, logWriter) +// ReplaceAll provides a mock function with given fields: ctx, jobTenant, jobs, jobNamesWithInvalidSpec, logWriter +func (_m *JobService) ReplaceAll(ctx context.Context, jobTenant tenant.Tenant, jobs []*job.Spec, jobNamesWithInvalidSpec []job.Name, logWriter writer.LogWriter) error { + ret := _m.Called(ctx, jobTenant, jobs, jobNamesWithInvalidSpec, logWriter) var r0 error if rf, ok := ret.Get(0).(func(context.Context, tenant.Tenant, []*job.Spec, []job.Name, writer.LogWriter) error); ok { - r0 = rf(ctx, jobTenant, jobs, jobNamesWithValidationError, logWriter) + r0 = rf(ctx, jobTenant, jobs, jobNamesWithInvalidSpec, logWriter) } else { r0 = ret.Error(0) } @@ -2040,12 +2194,12 @@ func (_m *JobService) Update(ctx context.Context, jobTenant tenant.Tenant, jobs } // Validate provides a mock function with given fields: ctx, jobTenant, jobSpecs, logWriter -func (_m *JobService) Validate(ctx context.Context, jobTenant tenant.Tenant, jobSpecs []*job.Spec, logWriter writer.LogWriter) error { +func (_m *JobService) Validate(ctx context.Context, jobTenant tenant.Tenant, jobSpecs []*job.Spec, jobNamesWithInvalidSpec []job.Name, logWriter writer.LogWriter) error { ret := _m.Called(ctx, jobTenant, jobSpecs, logWriter) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, tenant.Tenant, []*job.Spec, writer.LogWriter) error); ok { - r0 = rf(ctx, jobTenant, jobSpecs, logWriter) + if rf, ok := ret.Get(0).(func(context.Context, tenant.Tenant, []*job.Spec, []job.Name, writer.LogWriter) error); ok { + r0 = rf(ctx, jobTenant, jobSpecs, jobNamesWithInvalidSpec, logWriter) } else { r0 = ret.Error(0) } diff --git a/core/job/job.go b/core/job/job.go index e30b51d60d..60ed3144b8 100644 --- a/core/job/job.go +++ b/core/job/job.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( @@ -16,6 +16,18 @@ const ( UpstreamStateResolved UpstreamState = "resolved" UpstreamStateUnresolved UpstreamState = "unresolved" + + MetricJobEvent = "job_events_total" + MetricJobEventStateAdded = "added" + MetricJobEventStateUpdated = "updated" + MetricJobEventStateDeleted = "deleted" + MetricJobEventStateUpsertFailed = "upsert_failed" + MetricJobEventStateDeleteFailed = "delete_failed" + MetricJobEventStateValidationFailed = "validation_failed" + MetricJobEventEnabled = "enabled" + MetricJobEventDisabled = "disabled" + + MetricJobRefreshResourceDownstream = "refresh_resource_downstream_total" ) type Job struct { @@ -87,7 +99,7 @@ func (j *Job) getStaticUpstreamsToResolve() ([]*Upstream, error) { unresolvedStaticUpstreams = append(unresolvedStaticUpstreams, NewUpstreamUnresolvedStatic(jobUpstreamName, projectUpstreamName)) } - return unresolvedStaticUpstreams, errors.MultiToError(me) + return unresolvedStaticUpstreams, me.ToErr() } type ResourceURN string @@ -171,7 +183,7 @@ func (j Jobs) GetJobsWithUnresolvedUpstreams() ([]*WithUpstream, error) { jobsWithUnresolvedUpstream = append(jobsWithUnresolvedUpstream, jobWithUnresolvedUpstream) } - return jobsWithUnresolvedUpstream, errors.MultiToError(me) + return jobsWithUnresolvedUpstream, me.ToErr() } type WithUpstream struct { diff --git a/core/job/job_test.go b/core/job/job_test.go index 73bd0f3752..45c96f9faf 100644 --- a/core/job/job_test.go +++ b/core/job/job_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/models" ) func TestEntityJob(t *testing.T) { diff --git a/core/job/resolver/external_upstream_resolver.go b/core/job/resolver/external_upstream_resolver.go index 240a1b0de8..bfc5d5cb1a 100644 --- a/core/job/resolver/external_upstream_resolver.go +++ b/core/job/resolver/external_upstream_resolver.go @@ -6,11 +6,11 @@ import ( "github.com/kushsharma/parallel" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/ext/resourcemanager" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/writer" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/ext/resourcemanager" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/writer" ) type extUpstreamResolver struct { @@ -57,12 +57,12 @@ func (e *extUpstreamResolver) Resolve(ctx context.Context, jobWithUpstream *job. resolvedExternally = true } if len(me.Errors) > 0 { - lw.Write(writer.LogLevelError, errors.MultiToError(me).Error()) + lw.Write(writer.LogLevelError, me.ToErr().Error()) } if resolvedExternally { lw.Write(writer.LogLevelDebug, fmt.Sprintf("[%s] resolved job %s upstream from external", jobWithUpstream.Job().Tenant().NamespaceName().String(), jobWithUpstream.Name().String())) } - return job.NewWithUpstream(jobWithUpstream.Job(), mergedUpstreams), errors.MultiToError(me) + return job.NewWithUpstream(jobWithUpstream.Job(), mergedUpstreams), me.ToErr() } func (e *extUpstreamResolver) BulkResolve(ctx context.Context, jobsWithUpstream []*job.WithUpstream, lw writer.LogWriter) ([]*job.WithUpstream, error) { @@ -90,7 +90,7 @@ func (e *extUpstreamResolver) BulkResolve(ctx context.Context, jobsWithUpstream me.Append(result.Err) } - return jobsWithAllUpstream, errors.MultiToError(me) + return jobsWithAllUpstream, me.ToErr() } func (e *extUpstreamResolver) fetchOptimusUpstreams(ctx context.Context, unresolvedUpstream *job.Upstream) ([]*job.Upstream, error) { @@ -104,7 +104,7 @@ func (e *extUpstreamResolver) fetchOptimusUpstreams(ctx context.Context, unresol } upstreams = append(upstreams, deps...) } - return upstreams, errors.MultiToError(me) + return upstreams, me.ToErr() } func NewTestExternalUpstreamResolver( diff --git a/core/job/resolver/external_upstream_resolver_test.go b/core/job/resolver/external_upstream_resolver_test.go index fcd5cf0ab1..9da06c292e 100644 --- a/core/job/resolver/external_upstream_resolver_test.go +++ b/core/job/resolver/external_upstream_resolver_test.go @@ -8,12 +8,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/job/resolver" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/resourcemanager" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/job/resolver" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/resourcemanager" + "github.com/raystack/optimus/internal/models" ) func TestExternalUpstreamResolver(t *testing.T) { diff --git a/core/job/resolver/internal_upstream_resolver.go b/core/job/resolver/internal_upstream_resolver.go index 23210de7b3..0ceccfafb0 100644 --- a/core/job/resolver/internal_upstream_resolver.go +++ b/core/job/resolver/internal_upstream_resolver.go @@ -5,9 +5,9 @@ import ( "golang.org/x/net/context" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) type internalUpstreamResolver struct { @@ -49,7 +49,7 @@ func (i internalUpstreamResolver) Resolve(ctx context.Context, jobWithUnresolved } distinctUpstreams := job.Upstreams(upstreamResults).Deduplicate() - return job.NewWithUpstream(jobWithUnresolvedUpstream.Job(), distinctUpstreams), errors.MultiToError(me) + return job.NewWithUpstream(jobWithUnresolvedUpstream.Job(), distinctUpstreams), me.ToErr() } func (i internalUpstreamResolver) BulkResolve(ctx context.Context, projectName tenant.ProjectName, jobsWithUnresolvedUpstream []*job.WithUpstream) ([]*job.WithUpstream, error) { @@ -77,7 +77,7 @@ func (i internalUpstreamResolver) resolveInferredUpstream(ctx context.Context, s upstream := job.NewUpstreamResolved(jobUpstreams[0].Spec().Name(), "", jobUpstreams[0].Destination(), jobUpstreams[0].Tenant(), job.UpstreamTypeInferred, jobUpstreams[0].Spec().Task().Name(), false) internalUpstream = append(internalUpstream, upstream) } - return internalUpstream, errors.MultiToError(me) + return internalUpstream, me.ToErr() } func (i internalUpstreamResolver) resolveStaticUpstream(ctx context.Context, projectName tenant.ProjectName, upstreamSpec *job.UpstreamSpec) ([]*job.Upstream, error) { @@ -97,5 +97,5 @@ func (i internalUpstreamResolver) resolveStaticUpstream(ctx context.Context, pro upstream := job.NewUpstreamResolved(upstreamJobName, "", jobUpstream.Destination(), jobUpstream.Tenant(), job.UpstreamTypeStatic, jobUpstream.Spec().Task().Name(), false) internalUpstream = append(internalUpstream, upstream) } - return internalUpstream, errors.MultiToError(me) + return internalUpstream, me.ToErr() } diff --git a/core/job/resolver/internal_upstream_resolver_test.go b/core/job/resolver/internal_upstream_resolver_test.go index 6b20ffe31b..ea4951ecf6 100644 --- a/core/job/resolver/internal_upstream_resolver_test.go +++ b/core/job/resolver/internal_upstream_resolver_test.go @@ -7,10 +7,10 @@ import ( "github.com/stretchr/testify/assert" "golang.org/x/net/context" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/job/resolver" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/job/resolver" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/models" ) func TestInternalUpstreamResolver(t *testing.T) { diff --git a/core/job/resolver/upstream_resolver.go b/core/job/resolver/upstream_resolver.go index f861f797ab..c33b4f60dd 100644 --- a/core/job/resolver/upstream_resolver.go +++ b/core/job/resolver/upstream_resolver.go @@ -4,15 +4,15 @@ import ( "context" "fmt" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/writer" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/writer" ) const ( - ConcurrentTicketPerSec = 40 - ConcurrentLimit = 600 + ConcurrentTicketPerSec = 50 + ConcurrentLimit = 100 ) type UpstreamResolver struct { @@ -57,7 +57,7 @@ func (u UpstreamResolver) BulkResolve(ctx context.Context, projectName tenant.Pr errorMsg := fmt.Sprintf("unable to resolve upstream: %s", err.Error()) logWriter.Write(writer.LogLevelError, errorMsg) me.Append(errors.NewError(errors.ErrInternalError, job.EntityJob, errorMsg)) - return nil, errors.MultiToError(me) + return nil, me.ToErr() } jobsWithResolvedExternalUpstreams, err := u.externalUpstreamResolver.BulkResolve(ctx, jobsWithResolvedInternalUpstreams, logWriter) @@ -65,7 +65,7 @@ func (u UpstreamResolver) BulkResolve(ctx context.Context, projectName tenant.Pr me.Append(u.getUnresolvedUpstreamsErrors(jobsWithResolvedExternalUpstreams, logWriter)) - return jobsWithResolvedExternalUpstreams, errors.MultiToError(me) + return jobsWithResolvedExternalUpstreams, me.ToErr() } func (u UpstreamResolver) Resolve(ctx context.Context, subjectJob *job.Job, logWriter writer.LogWriter) ([]*job.Upstream, error) { @@ -80,7 +80,7 @@ func (u UpstreamResolver) Resolve(ctx context.Context, subjectJob *job.Job, logW jobWithInternalExternalUpstream, err := u.externalUpstreamResolver.Resolve(ctx, jobWithInternalUpstream, logWriter) me.Append(err) - return jobWithInternalExternalUpstream.Upstreams(), errors.MultiToError(me) + return jobWithInternalExternalUpstream.Upstreams(), me.ToErr() } func (UpstreamResolver) getUnresolvedUpstreamsErrors(jobsWithUpstreams []*job.WithUpstream, logWriter writer.LogWriter) error { @@ -94,5 +94,5 @@ func (UpstreamResolver) getUnresolvedUpstreamsErrors(jobsWithUpstreams []*job.Wi } } } - return errors.MultiToError(me) + return me.ToErr() } diff --git a/core/job/resolver/upstream_resolver_test.go b/core/job/resolver/upstream_resolver_test.go index ac3c16e0d2..8389aabfb2 100644 --- a/core/job/resolver/upstream_resolver_test.go +++ b/core/job/resolver/upstream_resolver_test.go @@ -8,11 +8,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/job/resolver" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/internal/writer" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/job/resolver" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/internal/writer" ) func TestUpstreamResolver(t *testing.T) { diff --git a/core/job/resolver/util.go b/core/job/resolver/util.go index 657d4e1aa2..38760e0f47 100644 --- a/core/job/resolver/util.go +++ b/core/job/resolver/util.go @@ -1,6 +1,6 @@ package resolver -import "github.com/odpf/optimus/core/job" +import "github.com/raystack/optimus/core/job" func mergeUpstreams(upstreamGroups ...[]*job.Upstream) []*job.Upstream { var allUpstreams []*job.Upstream diff --git a/core/job/service/filter/filter_test.go b/core/job/service/filter/filter_test.go index a6312edb27..a7225f1c73 100644 --- a/core/job/service/filter/filter_test.go +++ b/core/job/service/filter/filter_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/job/service/filter" + "github.com/raystack/optimus/core/job/service/filter" ) func TestFilter(t *testing.T) { diff --git a/core/job/service/job_service.go b/core/job/service/job_service.go index f1bb78bb0a..20e33e6b1e 100644 --- a/core/job/service/job_service.go +++ b/core/job/service/job_service.go @@ -7,41 +7,59 @@ import ( "strings" "github.com/kushsharma/parallel" - "github.com/odpf/salt/log" - - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/job/service/filter" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/lib/tree" - "github.com/odpf/optimus/internal/telemetry" - "github.com/odpf/optimus/internal/writer" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/salt/log" + + "github.com/raystack/optimus/core/event" + "github.com/raystack/optimus/core/event/moderator" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/job/service/filter" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/lib/tree" + "github.com/raystack/optimus/internal/telemetry" + "github.com/raystack/optimus/internal/writer" + "github.com/raystack/optimus/sdk/plugin" ) const ( - ConcurrentTicketPerSec = 40 - ConcurrentLimit = 600 + ConcurrentTicketPerSec = 50 + ConcurrentLimit = 100 ) type JobService struct { - repo JobRepository + jobRepo JobRepository + upstreamRepo UpstreamRepository + downstreamRepo DownstreamRepository pluginService PluginService upstreamResolver UpstreamResolver + eventHandler EventHandler + scheduler Scheduler tenantDetailsGetter TenantDetailsGetter + jobDeploymentService JobDeploymentService + logger log.Logger } -func NewJobService(repo JobRepository, pluginService PluginService, upstreamResolver UpstreamResolver, tenantDetailsGetter TenantDetailsGetter, logger log.Logger) *JobService { +func NewJobService( + jobRepo JobRepository, upstreamRepo UpstreamRepository, downstreamRepo DownstreamRepository, + pluginService PluginService, upstreamResolver UpstreamResolver, + tenantDetailsGetter TenantDetailsGetter, eventHandler EventHandler, logger log.Logger, + jobDeploymentService JobDeploymentService, scheduler Scheduler, +) *JobService { return &JobService{ - repo: repo, - pluginService: pluginService, - upstreamResolver: upstreamResolver, - tenantDetailsGetter: tenantDetailsGetter, - logger: logger, + jobRepo: jobRepo, + upstreamRepo: upstreamRepo, + downstreamRepo: downstreamRepo, + pluginService: pluginService, + upstreamResolver: upstreamResolver, + eventHandler: eventHandler, + tenantDetailsGetter: tenantDetailsGetter, + logger: logger, + jobDeploymentService: jobDeploymentService, + scheduler: scheduler, } } @@ -55,23 +73,40 @@ type TenantDetailsGetter interface { GetDetails(ctx context.Context, jobTenant tenant.Tenant) (*tenant.WithDetails, error) } +type JobDeploymentService interface { + UploadJobs(ctx context.Context, jobTenant tenant.Tenant, toUpdate, toDelete []string) error +} + type JobRepository interface { // TODO: remove `savedJobs` since the method's main purpose is to add, not to get Add(context.Context, []*job.Job) (addedJobs []*job.Job, err error) Update(context.Context, []*job.Job) (updatedJobs []*job.Job, err error) Delete(ctx context.Context, projectName tenant.ProjectName, jobName job.Name, cleanHistory bool) error + ChangeJobNamespace(ctx context.Context, jobName job.Name, tenant, newTenant tenant.Tenant) error + GetByJobName(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) (*job.Job, error) GetAllByResourceDestination(ctx context.Context, resourceDestination job.ResourceURN) ([]*job.Job, error) GetAllByTenant(ctx context.Context, jobTenant tenant.Tenant) ([]*job.Job, error) GetAllByProjectName(ctx context.Context, projectName tenant.ProjectName) ([]*job.Job, error) + SyncState(ctx context.Context, jobTenant tenant.Tenant, disabledJobNames, enabledJobNames []job.Name) error + UpdateState(ctx context.Context, jobTenant tenant.Tenant, jobNames []job.Name, jobState job.State, remark string) error +} +type UpstreamRepository interface { ResolveUpstreams(context.Context, tenant.ProjectName, []job.Name) (map[job.Name][]*job.Upstream, error) ReplaceUpstreams(context.Context, []*job.WithUpstream) error GetUpstreams(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) ([]*job.Upstream, error) +} +type DownstreamRepository interface { GetDownstreamByDestination(ctx context.Context, projectName tenant.ProjectName, destination job.ResourceURN) ([]*job.Downstream, error) GetDownstreamByJobName(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) ([]*job.Downstream, error) + GetDownstreamBySources(ctx context.Context, sources []job.ResourceURN) ([]*job.Downstream, error) +} + +type EventHandler interface { + HandleEvent(moderator.Event) } type UpstreamResolver interface { @@ -79,28 +114,46 @@ type UpstreamResolver interface { Resolve(ctx context.Context, subjectJob *job.Job, logWriter writer.LogWriter) ([]*job.Upstream, error) } +type Scheduler interface { + UpdateJobState(ctx context.Context, tnnt tenant.Tenant, jobName []job.Name, state string) error +} + func (j *JobService) Add(ctx context.Context, jobTenant tenant.Tenant, specs []*job.Spec) error { logWriter := writer.NewLogWriter(j.logger) me := errors.NewMultiError("add specs errors") tenantWithDetails, err := j.tenantDetailsGetter.GetDetails(ctx, jobTenant) if err != nil { + j.logger.Error("error getting tenant details: %s", err) return err } jobs, err := j.generateJobs(ctx, tenantWithDetails, specs, logWriter) me.Append(err) - addedJobs, err := j.repo.Add(ctx, jobs) + addedJobs, err := j.jobRepo.Add(ctx, jobs) me.Append(err) jobsWithUpstreams, err := j.upstreamResolver.BulkResolve(ctx, jobTenant.ProjectName(), addedJobs, logWriter) me.Append(err) - err = j.repo.ReplaceUpstreams(ctx, jobsWithUpstreams) + err = j.upstreamRepo.ReplaceUpstreams(ctx, jobsWithUpstreams) me.Append(err) - return errors.MultiToError(me) + err = j.uploadJobs(ctx, jobTenant, addedJobs, nil, nil) + me.Append(err) + + for _, job := range addedJobs { + j.raiseCreateEvent(job) + } + raiseJobEventMetric(jobTenant, job.MetricJobEventStateAdded, len(addedJobs)) + + if len(addedJobs) < len(specs) { + totalFailed := len(specs) - len(addedJobs) + raiseJobEventMetric(jobTenant, job.MetricJobEventStateUpsertFailed, totalFailed) + } + + return me.ToErr() } func (j *JobService) Update(ctx context.Context, jobTenant tenant.Tenant, specs []*job.Spec) error { @@ -109,38 +162,128 @@ func (j *JobService) Update(ctx context.Context, jobTenant tenant.Tenant, specs tenantWithDetails, err := j.tenantDetailsGetter.GetDetails(ctx, jobTenant) if err != nil { + j.logger.Error("error getting tenant details: %s", err) return err } jobs, err := j.generateJobs(ctx, tenantWithDetails, specs, logWriter) me.Append(err) - updatedJobs, err := j.repo.Update(ctx, jobs) + updatedJobs, err := j.jobRepo.Update(ctx, jobs) me.Append(err) jobsWithUpstreams, err := j.upstreamResolver.BulkResolve(ctx, jobTenant.ProjectName(), updatedJobs, logWriter) me.Append(err) - err = j.repo.ReplaceUpstreams(ctx, jobsWithUpstreams) + err = j.upstreamRepo.ReplaceUpstreams(ctx, jobsWithUpstreams) me.Append(err) - return errors.MultiToError(me) + err = j.uploadJobs(ctx, jobTenant, nil, updatedJobs, nil) + me.Append(err) + + for _, job := range updatedJobs { + j.raiseUpdateEvent(job) + } + raiseJobEventMetric(jobTenant, job.MetricJobEventStateUpdated, len(updatedJobs)) + + if len(updatedJobs) < len(specs) { + totalFailed := len(specs) - len(updatedJobs) + raiseJobEventMetric(jobTenant, job.MetricJobEventStateUpsertFailed, totalFailed) + } + + return me.ToErr() +} + +func (j *JobService) UpdateState(ctx context.Context, jobTenant tenant.Tenant, jobNames []job.Name, jobState job.State, remark string) error { + err := j.scheduler.UpdateJobState(ctx, jobTenant, jobNames, jobState.String()) + if err != nil { + return err + } + + if err := j.jobRepo.UpdateState(ctx, jobTenant, jobNames, jobState, remark); err != nil { + return err + } + + var metricName string + switch jobState { + case job.ENABLED: + metricName = job.MetricJobEventEnabled + case job.DISABLED: + metricName = job.MetricJobEventDisabled + } + + raiseJobEventMetric(jobTenant, metricName, len(jobNames)) + for _, jobName := range jobNames { + j.raiseStateChangeEvent(jobTenant, jobName, jobState) + } + return nil +} + +func (j *JobService) SyncState(ctx context.Context, jobTenant tenant.Tenant, disabledJobNames, enabledJobNames []job.Name) error { + return j.jobRepo.SyncState(ctx, jobTenant, disabledJobNames, enabledJobNames) } func (j *JobService) Delete(ctx context.Context, jobTenant tenant.Tenant, jobName job.Name, cleanFlag, forceFlag bool) (affectedDownstream []job.FullName, err error) { - downstreamList, err := j.repo.GetDownstreamByJobName(ctx, jobTenant.ProjectName(), jobName) + downstreamList, err := j.downstreamRepo.GetDownstreamByJobName(ctx, jobTenant.ProjectName(), jobName) if err != nil { + raiseJobEventMetric(jobTenant, job.MetricJobEventStateDeleteFailed, 1) + j.logger.Error("error getting downstream jobs for [%s]: %s", jobName, err) return nil, err } downstreamFullNames := job.DownstreamList(downstreamList).GetDownstreamFullNames() if len(downstreamList) > 0 && !forceFlag { + raiseJobEventMetric(jobTenant, job.MetricJobEventStateDeleteFailed, 1) errorMsg := fmt.Sprintf("%s depends on this job. consider do force delete to proceed.", downstreamFullNames) + j.logger.Error(errorMsg) return nil, errors.NewError(errors.ErrFailedPrecond, job.EntityJob, errorMsg) } - return downstreamFullNames, j.repo.Delete(ctx, jobTenant.ProjectName(), jobName, cleanFlag) + if err := j.jobRepo.Delete(ctx, jobTenant.ProjectName(), jobName, cleanFlag); err != nil { + raiseJobEventMetric(jobTenant, job.MetricJobEventStateDeleteFailed, 1) + j.logger.Error("error deleting job [%s]: %s", jobName, err) + return downstreamFullNames, err + } + + raiseJobEventMetric(jobTenant, job.MetricJobEventStateDeleted, 1) + + if err := j.uploadJobs(ctx, jobTenant, nil, nil, []job.Name{jobName}); err != nil { + j.logger.Error("error uploading job [%s]: %s", jobName, err) + return downstreamFullNames, err + } + + j.raiseDeleteEvent(jobTenant, jobName) + + return downstreamFullNames, nil +} + +func (j *JobService) ChangeNamespace(ctx context.Context, jobTenant, jobNewTenant tenant.Tenant, jobName job.Name) error { + err := j.jobRepo.ChangeJobNamespace(ctx, jobName, jobTenant, jobNewTenant) + if err != nil { + errorsMsg := fmt.Sprintf("unable to successfully finish job namespace change transaction : %s", err.Error()) + return errors.NewError(errors.ErrInternalError, job.EntityJob, errorsMsg) + } + + newJobSpec, err := j.jobRepo.GetByJobName(ctx, jobNewTenant.ProjectName(), jobName) + if err != nil { + errorsMsg := fmt.Sprintf(" unable fetch jobSpecs for newly modified job : %s, namespace: %s, err: %s", jobName, jobNewTenant.NamespaceName(), err.Error()) + return errors.NewError(errors.ErrInternalError, job.EntityJob, errorsMsg) + } + + err = j.uploadJobs(ctx, jobTenant, nil, nil, []job.Name{jobName}) + if err != nil { + errorsMsg := fmt.Sprintf(" unable to remove old job : %s", err.Error()) + return errors.NewError(errors.ErrInternalError, job.EntityJob, errorsMsg) + } + + err = j.uploadJobs(ctx, jobNewTenant, []*job.Job{newJobSpec}, nil, nil) + if err != nil { + errorsMsg := fmt.Sprintf(" unable to create new job on scheduler : %s", err.Error()) + return errors.NewError(errors.ErrInternalError, job.EntityJob, errorsMsg) + } + j.raiseUpdateEvent(newJobSpec) + return nil } func (j *JobService) Get(ctx context.Context, jobTenant tenant.Tenant, jobName job.Name) (*job.Job, error) { @@ -149,9 +292,11 @@ func (j *JobService) Get(ctx context.Context, jobTenant tenant.Tenant, jobName j filter.WithString(filter.JobName, jobName.String()), ) if err != nil { + j.logger.Error("error getting job specified by the filter: %s", err) return nil, err } if len(jobs) == 0 { + j.logger.Error("job [%s] is not found", jobName) return nil, errors.NotFound(job.EntityJob, fmt.Sprintf("job %s is not found", jobName)) } return jobs[0], nil @@ -166,12 +311,16 @@ func (j *JobService) GetByFilter(ctx context.Context, filters ...filter.FilterOp // when resource destination exist, filter by destination if f.Contains(filter.ResourceDestination) { + j.logger.Debug("getting all jobs by resource destination [%s]", f.GetStringValue(filter.ResourceDestination)) + resourceDestination := job.ResourceURN(f.GetStringValue(filter.ResourceDestination)) - return j.repo.GetAllByResourceDestination(ctx, resourceDestination) + return j.jobRepo.GetAllByResourceDestination(ctx, resourceDestination) } // when project name and job names exist, filter by project and job names if f.Contains(filter.ProjectName, filter.JobNames) { + j.logger.Debug("getting all jobs by project name [%s] and job names", f.GetStringValue(filter.ProjectName)) + me := errors.NewMultiError("get all job specs errors") projectName, _ := tenant.ProjectNameFrom(f.GetStringValue(filter.ProjectName)) @@ -180,27 +329,31 @@ func (j *JobService) GetByFilter(ctx context.Context, filters ...filter.FilterOp var jobs []*job.Job for _, jobNameStr := range jobNames { jobName, _ := job.NameFrom(jobNameStr) - fetchedJob, err := j.repo.GetByJobName(ctx, projectName, jobName) + fetchedJob, err := j.jobRepo.GetByJobName(ctx, projectName, jobName) if err != nil { if !errors.IsErrorType(err, errors.ErrNotFound) { + j.logger.Error("error getting job [%s] from db: %s", jobName, err) me.Append(err) } continue } jobs = append(jobs, fetchedJob) } - return jobs, errors.MultiToError(me) + return jobs, me.ToErr() } // when project name and job name exist, filter by project name and job name if f.Contains(filter.ProjectName, filter.JobName) { + j.logger.Debug("getting all jobs by project name [%s] and job name [%s]", f.GetStringValue(filter.ProjectName), f.GetStringValue(filter.JobName)) + projectName, _ := tenant.ProjectNameFrom(f.GetStringValue(filter.ProjectName)) jobName, _ := job.NameFrom(f.GetStringValue(filter.JobName)) - fetchedJob, err := j.repo.GetByJobName(ctx, projectName, jobName) + fetchedJob, err := j.jobRepo.GetByJobName(ctx, projectName, jobName) if err != nil { if errors.IsErrorType(err, errors.ErrNotFound) { return []*job.Job{}, nil } + j.logger.Error("error getting job [%s] from db: %s", jobName, err) return nil, err } return []*job.Job{fetchedJob}, nil @@ -208,15 +361,19 @@ func (j *JobService) GetByFilter(ctx context.Context, filters ...filter.FilterOp // when project name and namespace names exist, filter by tenant if f.Contains(filter.ProjectName, filter.NamespaceNames) { + j.logger.Debug("getting all jobs by project name [%s] and namespace names", f.GetStringValue(filter.ProjectName)) + var jobs []*job.Job namespaceNames := f.GetStringArrayValue(filter.NamespaceNames) for _, namespaceName := range namespaceNames { jobTenant, err := tenant.NewTenant(f.GetStringValue(filter.ProjectName), namespaceName) if err != nil { + j.logger.Error("invalid tenant request information project [%s] namespace [%s]: %s", f.GetStringValue(filter.ProjectName), f.GetStringValue(filter.NamespaceName), err) return nil, err } - tenantJobs, err := j.repo.GetAllByTenant(ctx, jobTenant) + tenantJobs, err := j.jobRepo.GetAllByTenant(ctx, jobTenant) if err != nil { + j.logger.Error("error getting all jobs under project [%s] namespace [%s]: %s", jobTenant.ProjectName().String(), jobTenant.NamespaceName().String(), err) return nil, err } jobs = append(jobs, tenantJobs...) @@ -226,48 +383,83 @@ func (j *JobService) GetByFilter(ctx context.Context, filters ...filter.FilterOp // when project name and namespace name exist, filter by tenant if f.Contains(filter.ProjectName, filter.NamespaceName) { + j.logger.Debug("getting all jobs by project name [%s] and namespace name [%s]", f.GetStringValue(filter.ProjectName), f.GetStringValue(filter.NamespaceName)) + jobTenant, err := tenant.NewTenant(f.GetStringValue(filter.ProjectName), f.GetStringValue(filter.NamespaceName)) if err != nil { + j.logger.Error("invalid tenant request information project [%s] namespace [%s]: %s", f.GetStringValue(filter.ProjectName), f.GetStringValue(filter.NamespaceName), err) return nil, err } - return j.repo.GetAllByTenant(ctx, jobTenant) + return j.jobRepo.GetAllByTenant(ctx, jobTenant) } // when project name exist, filter by project name if f.Contains(filter.ProjectName) { + j.logger.Debug("getting all jobs by project name [%s]", f.GetStringValue(filter.ProjectName)) + projectName, _ := tenant.ProjectNameFrom(f.GetStringValue(filter.ProjectName)) - return j.repo.GetAllByProjectName(ctx, projectName) + return j.jobRepo.GetAllByProjectName(ctx, projectName) } + j.logger.Error("filter combination is not recognized") return nil, fmt.Errorf("no filter matched") } -func (j *JobService) ReplaceAll(ctx context.Context, jobTenant tenant.Tenant, specs []*job.Spec, jobNamesWithValidationError []job.Name, logWriter writer.LogWriter) error { +func (j *JobService) ReplaceAll(ctx context.Context, jobTenant tenant.Tenant, specs []*job.Spec, jobNamesWithInvalidSpec []job.Name, logWriter writer.LogWriter) error { me := errors.NewMultiError("replace all specs errors") - toAdd, toUpdate, toDelete, err := j.differentiateSpecs(ctx, jobTenant, specs, jobNamesWithValidationError) + existingJobs, err := j.jobRepo.GetAllByTenant(ctx, jobTenant) + me.Append(err) + + toAdd, toUpdate, toDelete, _, err := j.differentiateSpecs(existingJobs, specs, jobNamesWithInvalidSpec) logWriter.Write(writer.LogLevelInfo, fmt.Sprintf("[%s] found %d new, %d modified, and %d deleted job specs", jobTenant.NamespaceName().String(), len(toAdd), len(toUpdate), len(toDelete))) me.Append(err) tenantWithDetails, err := j.tenantDetailsGetter.GetDetails(ctx, jobTenant) if err != nil { + j.logger.Error("error getting tenant details: %s", err) me.Append(err) - return errors.MultiToError(me) + return me.ToErr() } addedJobs, err := j.bulkAdd(ctx, tenantWithDetails, toAdd, logWriter) me.Append(err) + failedToAdd := len(toAdd) - len(addedJobs) updatedJobs, err := j.bulkUpdate(ctx, tenantWithDetails, toUpdate, logWriter) me.Append(err) + failedToUpdate := len(toUpdate) - len(updatedJobs) - err = j.bulkDelete(ctx, jobTenant, toDelete, logWriter) + deletedJobNames, err := j.bulkDelete(ctx, jobTenant, toDelete, logWriter) me.Append(err) err = j.resolveAndSaveUpstreams(ctx, jobTenant, logWriter, addedJobs, updatedJobs) me.Append(err) - return errors.MultiToError(me) + err = j.uploadJobs(ctx, jobTenant, addedJobs, updatedJobs, deletedJobNames) + me.Append(err) + + raiseJobEventMetric(tenantWithDetails.ToTenant(), job.MetricJobEventStateUpsertFailed, failedToAdd+failedToUpdate) + + return me.ToErr() +} + +func (j *JobService) uploadJobs(ctx context.Context, jobTenant tenant.Tenant, addedJobs, updatedJobs []*job.Job, deletedJobNames []job.Name) error { + if len(addedJobs) == 0 && len(updatedJobs) == 0 && len(deletedJobNames) == 0 { + j.logger.Warn("no jobs to be uploaded") + return nil + } + + var jobNamesToUpload, jobNamesToRemove []string + for _, addedJob := range append(addedJobs, updatedJobs...) { + jobNamesToUpload = append(jobNamesToUpload, addedJob.GetName()) + } + + for _, deletedJobName := range deletedJobNames { + jobNamesToRemove = append(jobNamesToRemove, deletedJobName.String()) + } + + return j.jobDeploymentService.UploadJobs(ctx, jobTenant, jobNamesToUpload, jobNamesToRemove) } func (j *JobService) Refresh(ctx context.Context, projectName tenant.ProjectName, namespaceNames, jobNames []string, logWriter writer.LogWriter) (err error) { @@ -277,6 +469,7 @@ func (j *JobService) Refresh(ctx context.Context, projectName tenant.ProjectName allJobs, err := j.GetByFilter(ctx, projectFilter, namespacesFilter, jobNamesFilter) if err != nil { + j.logger.Error("error getting jobs by filter: %s", err) return err } @@ -285,12 +478,14 @@ func (j *JobService) Refresh(ctx context.Context, projectName tenant.ProjectName for namespaceName, jobs := range namespaceAndJobsMap { jobTenant, err := tenant.NewTenant(projectName.String(), namespaceName.String()) if err != nil { + j.logger.Error("invalid tenant information requet project [%s] namespace [%s]: %s", projectName.String(), namespaceName.String(), err) me.Append(err) continue } tenantWithDetails, err := j.tenantDetailsGetter.GetDetails(ctx, jobTenant) if err != nil { + j.logger.Error("error getting tenant details: %s", err) me.Append(err) continue } @@ -299,54 +494,192 @@ func (j *JobService) Refresh(ctx context.Context, projectName tenant.ProjectName updatedJobs, err := j.bulkUpdate(ctx, tenantWithDetails, specs, logWriter) me.Append(err) - j.logger.Debug("resolving upstreams for %d jobs of project [%s] namespace [%s]", len(updatedJobs), projectName, namespaceName) + j.logger.Debug("resolving upstreams for [%d] jobs of project [%s] namespace [%s]", len(updatedJobs), projectName, namespaceName) jobsWithUpstreams, err := j.upstreamResolver.BulkResolve(ctx, projectName, updatedJobs, logWriter) me.Append(err) - j.logger.Debug("replacing upstreams for %d jobs of project [%s] namespace [%s]", len(jobsWithUpstreams), projectName, namespaceName) - err = j.repo.ReplaceUpstreams(ctx, jobsWithUpstreams) + err = j.upstreamRepo.ReplaceUpstreams(ctx, jobsWithUpstreams) + me.Append(err) + + j.logger.Debug("uploading [%d] jobs of project [%s] namespace [%s] to scheduler", len(jobs), projectName, namespaceName) + err = j.uploadJobs(ctx, jobTenant, jobs, nil, nil) me.Append(err) } - return errors.MultiToError(me) + return me.ToErr() } -func (j *JobService) Validate(ctx context.Context, jobTenant tenant.Tenant, jobSpecs []*job.Spec, logWriter writer.LogWriter) error { +func (j *JobService) RefreshResourceDownstream(ctx context.Context, resourceURNs []job.ResourceURN, logWriter writer.LogWriter) error { + downstreams, err := j.downstreamRepo.GetDownstreamBySources(ctx, resourceURNs) + if err != nil { + j.logger.Error("error identifying job downstream for given resources: %s", err) + return err + } + + groupedDownstreams := j.groupDownstreamPerProject(downstreams) + + me := errors.NewMultiError("refresh downstream errors") + for projectName, downstreams := range groupedDownstreams { + jobNames := make([]string, len(downstreams)) + for i, d := range downstreams { + jobNames[i] = d.Name().String() + } + + status := "successful" + if err := j.Refresh(ctx, projectName, nil, jobNames, logWriter); err != nil { + j.logger.Error("error refreshing downstream jobs for project [%s]: %s", projectName, err) + me.Append(err) + + status = "failed" + } + + counter := telemetry.NewCounter(job.MetricJobRefreshResourceDownstream, map[string]string{ + "project": projectName.String(), + "status": status, + }) + counter.Add(float64(len(jobNames))) + } + + return me.ToErr() +} + +func (j *JobService) Validate(ctx context.Context, jobTenant tenant.Tenant, jobSpecs []*job.Spec, jobNamesWithInvalidSpec []job.Name, logWriter writer.LogWriter) error { me := errors.NewMultiError("validate specs errors") tenantWithDetails, err := j.tenantDetailsGetter.GetDetails(ctx, jobTenant) if err != nil { + j.logger.Error("error getting tenant details: %s", err) return err } - jobs, err := j.generateJobs(ctx, tenantWithDetails, jobSpecs, logWriter) + err = job.Specs(jobSpecs).Validate() me.Append(err) + validatedJobSpecs := job.Specs(jobSpecs).GetValid() - jobsWithUnresolvedUpstreams, err := job.Jobs(jobs).GetJobsWithUnresolvedUpstreams() + existingJobs, err := j.jobRepo.GetAllByTenant(ctx, jobTenant) me.Append(err) - if len(me.Errors) > 0 { - return errors.MultiToError(me) - } + toAdd, toUpdate, toDelete, unmodifiedSpecs, err := j.differentiateSpecs(existingJobs, validatedJobSpecs, jobNamesWithInvalidSpec) + logWriter.Write(writer.LogLevelInfo, fmt.Sprintf("[%s] found %d new, %d modified, and %d deleted job specs", jobTenant.NamespaceName().String(), len(toAdd), len(toUpdate), len(toDelete))) + me.Append(err) + + incomingJobs, err := j.generateJobs(ctx, tenantWithDetails, append(toAdd, toUpdate...), logWriter) + me.Append(err) + + err = j.validateDeleteJobs(ctx, jobTenant, toDelete, logWriter) + me.Append(err) // NOTE: only check cyclic deps across internal upstreams (sources), need further discussion to check cyclic deps for external upstream // assumption, all job specs from input are also the job within same project + jobsToValidateMap := getAllJobsToValidateMap(incomingJobs, existingJobs, unmodifiedSpecs) + identifierToJobsMap := getIdentifierToJobsMap(jobsToValidateMap) + for _, jobEntity := range jobsToValidateMap { + if _, err := j.validateCyclic(jobEntity.Job().Spec().Name(), jobsToValidateMap, identifierToJobsMap); err != nil { + j.logger.Error("error when executing cyclic validation on [%s]: %s", jobEntity.Job().Spec().Name(), err) + me.Append(err) + break + } + } + + return me.ToErr() +} + +func (j *JobService) validateDeleteJobs(ctx context.Context, jobTenant tenant.Tenant, toDelete []*job.Spec, logWriter writer.LogWriter) error { + me := errors.NewMultiError("delete job specs check errors") + toDeleteMap := job.Specs(toDelete).ToFullNameAndSpecMap(jobTenant.ProjectName()) + + for _, jobToDelete := range toDelete { + downstreams, err := j.getAllDownstreams(ctx, jobTenant.ProjectName(), jobToDelete.Name(), map[job.FullName]bool{}) + if err != nil { + j.logger.Error("error getting all downstreams for job [%s]: %s", jobToDelete.Name().String(), err) + logWriter.Write(writer.LogLevelError, fmt.Sprintf("[%s] pre-delete check for job %s failed: %s", jobTenant.NamespaceName().String(), jobToDelete.Name().String(), err.Error())) + me.Append(err) + continue + } + validateDeleteJob(jobTenant, downstreams, toDeleteMap, jobToDelete, logWriter, me) + } + return me.ToErr() +} + +func validateDeleteJob(jobTenant tenant.Tenant, downstreams []*job.Downstream, toDeleteMap map[job.FullName]*job.Spec, jobToDelete *job.Spec, logWriter writer.LogWriter, me *errors.MultiError) bool { + notDeleted, safeToDelete := isJobSafeToDelete(toDeleteMap, job.DownstreamList(downstreams).GetDownstreamFullNames()) - // populate all jobs in project - jobsInProjectWithUpstreams, err := j.getJobsInProjectWithUpstreams(ctx, jobTenant.ProjectName()) + if !safeToDelete { + // TODO: refactor to put the log writer outside + errorMsg := fmt.Sprintf("deletion of job %s will fail. job is being used by %s", jobToDelete.Name().String(), job.FullNames(notDeleted).String()) + logWriter.Write(writer.LogLevelError, fmt.Sprintf("[%s] %s", jobTenant.NamespaceName().String(), errorMsg)) + me.Append(errors.NewError(errors.ErrFailedPrecond, job.EntityJob, errorMsg)) + return false + } + + return true +} + +func isJobSafeToDelete(toDeleteMap map[job.FullName]*job.Spec, downstreamFullNames []job.FullName) ([]job.FullName, bool) { + notDeleted := []job.FullName{} + for _, downstreamFullName := range downstreamFullNames { + if _, ok := toDeleteMap[downstreamFullName]; !ok { + notDeleted = append(notDeleted, downstreamFullName) + } + } + + return notDeleted, len(notDeleted) == 0 +} + +func (j *JobService) getAllDownstreams(ctx context.Context, projectName tenant.ProjectName, jobName job.Name, visited map[job.FullName]bool) ([]*job.Downstream, error) { + currentJobFullName := job.FullNameFrom(projectName, jobName) + downstreams := []*job.Downstream{} + visited[currentJobFullName] = true + childJobs, err := j.downstreamRepo.GetDownstreamByJobName(ctx, projectName, jobName) if err != nil { - return err + j.logger.Error("error getting downstream jobs for job [%s]: %s", jobName, err) + return nil, err } + for _, childJob := range childJobs { + downstreams = append(downstreams, childJob) + if visited[childJob.FullName()] { + continue + } + childDownstreams, err := j.getAllDownstreams(ctx, childJob.ProjectName(), childJob.Name(), visited) + if err != nil { + j.logger.Error("error getting all downstreams for job [%s]: %s", childJob.Name(), err) + return nil, err + } + downstreams = append(downstreams, childDownstreams...) + } + return downstreams, nil +} - jobMap := make(map[job.Name]*job.WithUpstream) - identifierToJobsMap := make(map[string][]*job.WithUpstream) - for _, jobEntity := range append(jobsWithUnresolvedUpstreams, jobsInProjectWithUpstreams...) { - jobSpecName := jobEntity.Job().Spec().Name() - if _, ok := jobMap[jobSpecName]; ok { +func getAllJobsToValidateMap(incomingJobs, existingJobs []*job.Job, unmodifiedSpecs []*job.Spec) map[job.Name]*job.WithUpstream { + // TODO: check whether we need to accumulate encountered errors + me := errors.NewMultiError("validate specs errors") + + existingJobMap := job.Jobs(existingJobs).GetNameAndJobMap() + var unmodifiedJobs []*job.Job + for _, unmodifiedSpec := range unmodifiedSpecs { + if unmodifiedJob, ok := existingJobMap[unmodifiedSpec.Name()]; ok { + unmodifiedJobs = append(unmodifiedJobs, unmodifiedJob) continue } - jobMap[jobSpecName] = jobEntity + errorsMsg := fmt.Sprintf("unable to validate existing job %s", unmodifiedSpec.Name().String()) + me.Append(errors.NewError(errors.ErrInternalError, job.EntityJob, errorsMsg)) + } + jobsToValidateMap := make(map[job.Name]*job.WithUpstream) + for _, jobToValidate := range append(incomingJobs, unmodifiedJobs...) { + jobWithUpstream, err := jobToValidate.GetJobWithUnresolvedUpstream() + if err != nil { + me.Append(err) + continue + } + jobsToValidateMap[jobToValidate.Spec().Name()] = jobWithUpstream + } + return jobsToValidateMap +} + +func getIdentifierToJobsMap(jobsToValidateMap map[job.Name]*job.WithUpstream) map[string][]*job.WithUpstream { + identifierToJobsMap := make(map[string][]*job.WithUpstream) + for _, jobEntity := range jobsToValidateMap { jobIdentifiers := []string{jobEntity.Job().FullName()} if jobDestination := jobEntity.Job().Destination().String(); jobDestination != "" { jobIdentifiers = append(jobIdentifiers, jobDestination) @@ -358,20 +691,7 @@ func (j *JobService) Validate(ctx context.Context, jobTenant tenant.Tenant, jobS identifierToJobsMap[jobIdentifier] = append(identifierToJobsMap[jobIdentifier], jobEntity) } } - - // check cyclic deps for every job - for _, jobEntity := range jobsWithUnresolvedUpstreams { - if _, err := j.validateCyclic(jobEntity.Job().Spec().Name(), jobMap, identifierToJobsMap); err != nil { - me.Append(err) - break - } - } - - if len(me.Errors) > 0 { - return me - } - - return nil + return identifierToJobsMap } func (j *JobService) resolveAndSaveUpstreams(ctx context.Context, jobTenant tenant.Tenant, logWriter writer.LogWriter, jobsToResolve ...[]*job.Job) error { @@ -380,6 +700,7 @@ func (j *JobService) resolveAndSaveUpstreams(ctx context.Context, jobTenant tena allJobsToResolve = append(allJobsToResolve, group...) } if len(allJobsToResolve) == 0 { + j.logger.Warn("no jobs to be resolved") return nil } @@ -390,107 +711,149 @@ func (j *JobService) resolveAndSaveUpstreams(ctx context.Context, jobTenant tena me.Append(err) j.logger.Debug("replacing upstreams for %d jobs of project [%s] namespace [%s]", len(jobsWithUpstreams), jobTenant.ProjectName(), jobTenant.NamespaceName()) - err = j.repo.ReplaceUpstreams(ctx, jobsWithUpstreams) + err = j.upstreamRepo.ReplaceUpstreams(ctx, jobsWithUpstreams) me.Append(err) - return errors.MultiToError(me) + return me.ToErr() } func (j *JobService) bulkAdd(ctx context.Context, tenantWithDetails *tenant.WithDetails, specsToAdd []*job.Spec, logWriter writer.LogWriter) ([]*job.Job, error) { - j.logger.Debug("adding %d jobs to project [%s] namespace [%s]", len(specsToAdd), tenantWithDetails.Project().Name(), tenantWithDetails.Namespace().Name()) me := errors.NewMultiError("bulk add specs errors") jobsToAdd, err := j.generateJobs(ctx, tenantWithDetails, specsToAdd, logWriter) me.Append(err) if len(jobsToAdd) == 0 { - return nil, errors.MultiToError(me) + j.logger.Warn("no jobs to be added") + return nil, me.ToErr() } // TODO: consider do add inside parallel - addedJobs, err := j.repo.Add(ctx, jobsToAdd) + addedJobs, err := j.jobRepo.Add(ctx, jobsToAdd) if err != nil { + j.logger.Error("error adding jobs for namespace [%s]: %s", tenantWithDetails.Namespace().Name(), err) logWriter.Write(writer.LogLevelError, fmt.Sprintf("[%s] add jobs failure found: %s", tenantWithDetails.Namespace().Name().String(), err.Error())) me.Append(err) } if len(addedJobs) > 0 { logWriter.Write(writer.LogLevelDebug, fmt.Sprintf("[%s] successfully added %d jobs", tenantWithDetails.Namespace().Name().String(), len(addedJobs))) + for _, job := range addedJobs { + j.raiseCreateEvent(job) + } + raiseJobEventMetric(tenantWithDetails.ToTenant(), job.MetricJobEventStateAdded, len(addedJobs)) } - return addedJobs, errors.MultiToError(me) + return addedJobs, me.ToErr() } func (j *JobService) bulkUpdate(ctx context.Context, tenantWithDetails *tenant.WithDetails, specsToUpdate []*job.Spec, logWriter writer.LogWriter) ([]*job.Job, error) { - j.logger.Debug("updating %d jobs of project [%s] namespace [%s]", len(specsToUpdate), tenantWithDetails.Project().Name(), tenantWithDetails.Namespace().Name()) me := errors.NewMultiError("bulk update specs errors") jobsToUpdate, err := j.generateJobs(ctx, tenantWithDetails, specsToUpdate, logWriter) me.Append(err) if len(jobsToUpdate) == 0 { - return nil, errors.MultiToError(me) + j.logger.Warn("no jobs to be updated") + return nil, me.ToErr() } - updatedJobs, err := j.repo.Update(ctx, jobsToUpdate) + updatedJobs, err := j.jobRepo.Update(ctx, jobsToUpdate) if err != nil { + j.logger.Error("error updating jobs for namespace [%s]: %s", tenantWithDetails.Namespace().Name(), err) logWriter.Write(writer.LogLevelError, fmt.Sprintf("[%s] update jobs failure found: %s", tenantWithDetails.Namespace().Name().String(), err.Error())) me.Append(err) } if len(updatedJobs) > 0 { logWriter.Write(writer.LogLevelDebug, fmt.Sprintf("[%s] successfully updated %d jobs", tenantWithDetails.Namespace().Name().String(), len(updatedJobs))) + for _, job := range updatedJobs { + j.raiseUpdateEvent(job) + } + raiseJobEventMetric(tenantWithDetails.ToTenant(), job.MetricJobEventStateUpdated, len(updatedJobs)) } - return updatedJobs, errors.MultiToError(me) + return updatedJobs, me.ToErr() } -func (j *JobService) bulkDelete(ctx context.Context, jobTenant tenant.Tenant, toDelete []*job.Spec, logWriter writer.LogWriter) error { - j.logger.Debug("deleting %d jobs of project [%s] namespace [%s]", len(toDelete), jobTenant.ProjectName(), jobTenant.NamespaceName()) +func (j *JobService) bulkDelete(ctx context.Context, jobTenant tenant.Tenant, toDelete []*job.Spec, logWriter writer.LogWriter) ([]job.Name, error) { me := errors.NewMultiError("bulk delete specs errors") - deletedJob := 0 + var deletedJobNames []job.Name + toDeleteMap := job.Specs(toDelete).ToFullNameAndSpecMap(jobTenant.ProjectName()) + + alreadyDeleted := map[job.FullName]bool{} for _, spec := range toDelete { // TODO: reuse Delete method and pass forceFlag as false - downstreamList, err := j.repo.GetDownstreamByJobName(ctx, jobTenant.ProjectName(), spec.Name()) + fullName := job.FullNameFrom(jobTenant.ProjectName(), spec.Name()) + downstreams, err := j.getAllDownstreams(ctx, jobTenant.ProjectName(), spec.Name(), map[job.FullName]bool{}) if err != nil { + j.logger.Error("error getting downstreams for job [%s]: %s", spec.Name(), err) logWriter.Write(writer.LogLevelError, fmt.Sprintf("[%s] pre-delete check for job %s failed: %s", jobTenant.NamespaceName().String(), spec.Name().String(), err.Error())) me.Append(err) continue } - if len(downstreamList) > 0 { - downstreamFullNames := job.DownstreamList(downstreamList).GetDownstreamFullNames() - errorMsg := fmt.Sprintf("deleting job %s failed. job is being used by %s", spec.Name().String(), downstreamFullNames.String()) - logWriter.Write(writer.LogLevelError, fmt.Sprintf("[%s] %s", jobTenant.NamespaceName().String(), errorMsg)) - me.Append(errors.NewError(errors.ErrFailedPrecond, job.EntityJob, errorMsg)) + isSafeToDelete := validateDeleteJob(jobTenant, downstreams, toDeleteMap, spec, logWriter, me) + if !isSafeToDelete { + j.logger.Warn("job [%s] is not safe to be deleted", spec.Name()) continue } logWriter.Write(writer.LogLevelDebug, fmt.Sprintf("[%s] deleting job %s", jobTenant.NamespaceName().String(), spec.Name().String())) - if err = j.repo.Delete(ctx, jobTenant.ProjectName(), spec.Name(), false); err != nil { + isDeletionFail := false + for i := len(downstreams) - 1; i >= 0 && !isDeletionFail; i-- { + if alreadyDeleted[downstreams[i].FullName()] { + continue + } + if err = j.jobRepo.Delete(ctx, downstreams[i].ProjectName(), downstreams[i].Name(), false); err != nil { + j.logger.Error("error deleting [%s] as downstream of [%s]", downstreams[i].Name(), spec.Name()) + logWriter.Write(writer.LogLevelError, fmt.Sprintf("[%s] deleting job %s failed: %s", downstreams[i].NamespaceName().String(), downstreams[i].Name().String(), err.Error())) + me.Append(err) + isDeletionFail = true + } else { + alreadyDeleted[downstreams[i].FullName()] = true + j.raiseDeleteEvent(jobTenant, spec.Name()) + raiseJobEventMetric(jobTenant, job.MetricJobEventStateDeleted, 1) + deletedJobNames = append(deletedJobNames, downstreams[i].Name()) + } + } + + if alreadyDeleted[fullName] || isDeletionFail { + j.logger.Warn("job [%s] deletion is skipped [already deleted or failure in deleting downstreams]", spec.Name()) + continue + } + if err = j.jobRepo.Delete(ctx, jobTenant.ProjectName(), spec.Name(), false); err != nil { + j.logger.Error("error deleting job [%s]", spec.Name()) logWriter.Write(writer.LogLevelError, fmt.Sprintf("[%s] deleting job %s failed: %s", jobTenant.NamespaceName().String(), spec.Name().String(), err.Error())) me.Append(err) } else { - deletedJob++ + alreadyDeleted[fullName] = true + j.raiseDeleteEvent(jobTenant, spec.Name()) + raiseJobEventMetric(jobTenant, job.MetricJobEventStateDeleted, 1) + deletedJobNames = append(deletedJobNames, spec.Name()) } } - if deletedJob > 0 { - logWriter.Write(writer.LogLevelDebug, fmt.Sprintf("[%s] successfully deleted %d jobs", jobTenant.NamespaceName().String(), deletedJob)) + + if len(deletedJobNames) > 0 { + logWriter.Write(writer.LogLevelDebug, fmt.Sprintf("[%s] successfully deleted %d jobs", jobTenant.NamespaceName().String(), len(deletedJobNames))) + } + + if len(deletedJobNames) < len(toDelete) { + totalFailed := len(toDelete) - len(deletedJobNames) + raiseJobEventMetric(jobTenant, job.MetricJobEventStateDeleteFailed, totalFailed) } - return errors.MultiToError(me) + return deletedJobNames, me.ToErr() } -func (j *JobService) differentiateSpecs(ctx context.Context, jobTenant tenant.Tenant, specs []*job.Spec, jobNamesWithValidationError []job.Name) (added, modified, deleted []*job.Spec, err error) { +func (*JobService) differentiateSpecs(existingJobs []*job.Job, specs []*job.Spec, jobNamesWithInvalidSpec []job.Name) (added, modified, deleted, unmodified []*job.Spec, err error) { + // TODO: consider checking multi-error if it is required here me := errors.NewMultiError("differentiate specs errors") - existingJobs, err := j.repo.GetAllByTenant(ctx, jobTenant) - me.Append(err) - - var addedSpecs, modifiedSpecs, deletedSpecs []*job.Spec + var addedSpecs, modifiedSpecs, unmodifiedSpecs, deletedSpecs []*job.Spec existingSpecsMap := job.Jobs(existingJobs).GetNameAndSpecMap() - for _, jobNameToSkip := range jobNamesWithValidationError { + for _, jobNameToSkip := range jobNamesWithInvalidSpec { delete(existingSpecsMap, jobNameToSkip) } @@ -499,12 +862,10 @@ func (j *JobService) differentiateSpecs(ctx context.Context, jobTenant tenant.Te addedSpecs = append(addedSpecs, incomingSpec) } else if !reflect.DeepEqual(spec, incomingSpec) { modifiedSpecs = append(modifiedSpecs, incomingSpec) + } else { + unmodifiedSpecs = append(unmodifiedSpecs, incomingSpec) } } - telemetry.NewCounter("total_jobs_modified", map[string]string{ - "project": jobTenant.ProjectName().String(), - "namespace": jobTenant.NamespaceName().String(), - }).Add(float64(len(modifiedSpecs))) incomingSpecsMap := job.Specs(specs).ToNameAndSpecMap() for existingJobName, existingJobSpec := range existingSpecsMap { @@ -512,7 +873,7 @@ func (j *JobService) differentiateSpecs(ctx context.Context, jobTenant tenant.Te deletedSpecs = append(deletedSpecs, existingJobSpec) } } - return addedSpecs, modifiedSpecs, deletedSpecs, errors.MultiToError(me) + return addedSpecs, modifiedSpecs, deletedSpecs, unmodifiedSpecs, me.ToErr() } func (j *JobService) generateJobs(ctx context.Context, tenantWithDetails *tenant.WithDetails, specs []*job.Spec, logWriter writer.LogWriter) ([]*job.Job, error) { @@ -524,6 +885,7 @@ func (j *JobService) generateJobs(ctx context.Context, tenantWithDetails *tenant return func() (interface{}, error) { generatedJob, err := j.generateJob(ctx, tenantWithDetails, currentSpec) if err != nil { + j.logger.Error("error generating job [%s]: %s", currentSpec.Name(), err) lw.Write(writer.LogLevelError, fmt.Sprintf("[%s] unable to generate job %s: %s", tenantWithDetails.Namespace().Name().String(), currentSpec.Name().String(), err.Error())) return nil, err } @@ -542,18 +904,20 @@ func (j *JobService) generateJobs(ctx context.Context, tenantWithDetails *tenant generatedJobs = append(generatedJobs, specVal) } } - return generatedJobs, errors.MultiToError(me) + return generatedJobs, me.ToErr() } func (j *JobService) generateJob(ctx context.Context, tenantWithDetails *tenant.WithDetails, spec *job.Spec) (*job.Job, error) { destination, err := j.pluginService.GenerateDestination(ctx, tenantWithDetails, spec.Task()) if err != nil && !errors.Is(err, ErrUpstreamModNotFound) { + j.logger.Error("error generating destination for [%s]: %s", spec.Name(), err) errorMsg := fmt.Sprintf("unable to add %s: %s", spec.Name().String(), err.Error()) return nil, errors.NewError(errors.ErrInternalError, job.EntityJob, errorMsg) } sources, err := j.pluginService.GenerateUpstreams(ctx, tenantWithDetails, spec, true) if err != nil && !errors.Is(err, ErrUpstreamModNotFound) { + j.logger.Error("error generating upstream for [%s]: %s", spec.Name(), err) errorMsg := fmt.Sprintf("unable to add %s: %s", spec.Name().String(), err.Error()) return nil, errors.NewError(errors.ErrInternalError, job.EntityJob, errorMsg) } @@ -561,15 +925,6 @@ func (j *JobService) generateJob(ctx context.Context, tenantWithDetails *tenant. return job.NewJob(tenantWithDetails.ToTenant(), spec, destination, sources), nil } -func (j *JobService) getJobsInProjectWithUpstreams(ctx context.Context, projectName tenant.ProjectName) ([]*job.WithUpstream, error) { - jobsInProject, err := j.GetByFilter(ctx, filter.WithString(filter.ProjectName, projectName.String())) - if err != nil { - return nil, err - } - - return job.Jobs(jobsInProject).GetJobsWithUnresolvedUpstreams() -} - func (j *JobService) validateCyclic(rootName job.Name, jobMap map[job.Name]*job.WithUpstream, identifierToJobMap map[string][]*job.WithUpstream) ([]string, error) { dagTree := j.buildDAGTree(rootName, jobMap, identifierToJobMap) return dagTree.ValidateCyclic() @@ -610,7 +965,7 @@ func (*JobService) buildDAGTree(rootName job.Name, jobMap map[job.Name]*job.With return dagTree } -// sources: https://github.com/odpf/optimus/blob/a6dafbc1fbeb8e1f1eb8d4a6e9582ada4a7f639e/job/replay.go#L101 +// sources: https://github.com/raystack/optimus/blob/a6dafbc1fbeb8e1f1eb8d4a6e9582ada4a7f639e/job/replay.go#L101 func findOrCreateDAGNode(dagTree *tree.MultiRootTree, dag tree.TreeData) *tree.TreeNode { node, ok := dagTree.GetNodeByName(dag.GetName()) if !ok { @@ -627,41 +982,43 @@ func (j *JobService) GetJobBasicInfo(ctx context.Context, jobTenant tenant.Tenan if spec != nil { tenantWithDetails, err := j.tenantDetailsGetter.GetDetails(ctx, jobTenant) if err != nil { + j.logger.Info("error getting tenant details: %s", err) logger.Write(writer.LogLevelError, fmt.Sprintf("unable to get tenant detail, err: %v", err)) return nil, logger } subjectJob, err = j.generateJob(ctx, tenantWithDetails, spec) if err != nil { + j.logger.Info("error generating job for [%s]: %s", spec.Name(), err) logger.Write(writer.LogLevelError, fmt.Sprintf("unable to generate job, err: %v", err)) return nil, logger } } else { subjectJob, err = j.Get(ctx, jobTenant, jobName) if err != nil { + j.logger.Info("error getting job [%s]: %s", jobName, err) logger.Write(writer.LogLevelError, fmt.Sprintf("unable to get job, err: %v", err)) return nil, logger } } if len(subjectJob.Sources()) == 0 { + j.logger.Warn("no job sources detected") logger.Write(writer.LogLevelInfo, "no job sources detected") } - if subjectJob.Spec().Schedule().CatchUp() { - logger.Write(writer.LogLevelWarning, "catchup is enabled") - } - if dupDestJobNames, err := j.getJobNamesWithSameDestination(ctx, subjectJob); err != nil { logger.Write(writer.LogLevelError, "could not perform duplicate job destination check, err: "+err.Error()) } else if dupDestJobNames != "" { logger.Write(writer.LogLevelWarning, "job already exists with same Destination: "+subjectJob.Destination().String()+" existing jobNames: "+dupDestJobNames) } + return subjectJob, logger } func (j *JobService) getJobNamesWithSameDestination(ctx context.Context, subjectJob *job.Job) (string, error) { - sameDestinationJobs, err := j.repo.GetAllByResourceDestination(ctx, subjectJob.Destination()) + sameDestinationJobs, err := j.jobRepo.GetAllByResourceDestination(ctx, subjectJob.Destination()) if err != nil { + j.logger.Error("error getting all jobs by destination [%s]: %s", subjectJob.Destination(), err) return "", err } var jobNames []string @@ -679,12 +1036,64 @@ func (j *JobService) GetUpstreamsToInspect(ctx context.Context, subjectJob *job. if localJob { return j.upstreamResolver.Resolve(ctx, subjectJob, logWriter) } - return j.repo.GetUpstreams(ctx, subjectJob.ProjectName(), subjectJob.Spec().Name()) + return j.upstreamRepo.GetUpstreams(ctx, subjectJob.ProjectName(), subjectJob.Spec().Name()) } func (j *JobService) GetDownstream(ctx context.Context, subjectJob *job.Job, localJob bool) ([]*job.Downstream, error) { if localJob { - return j.repo.GetDownstreamByDestination(ctx, subjectJob.ProjectName(), subjectJob.Destination()) + return j.downstreamRepo.GetDownstreamByDestination(ctx, subjectJob.ProjectName(), subjectJob.Destination()) } - return j.repo.GetDownstreamByJobName(ctx, subjectJob.ProjectName(), subjectJob.Spec().Name()) + return j.downstreamRepo.GetDownstreamByJobName(ctx, subjectJob.ProjectName(), subjectJob.Spec().Name()) +} + +func (j *JobService) raiseCreateEvent(job *job.Job) { + jobEvent, err := event.NewJobCreatedEvent(job) + if err != nil { + j.logger.Error("error creating event for job create: %s", err) + return + } + j.eventHandler.HandleEvent(jobEvent) +} + +func (j *JobService) raiseUpdateEvent(job *job.Job) { + jobEvent, err := event.NewJobUpdateEvent(job) + if err != nil { + j.logger.Error("error creating event for job update: %s", err) + return + } + j.eventHandler.HandleEvent(jobEvent) +} + +func (j *JobService) raiseStateChangeEvent(tnnt tenant.Tenant, jobName job.Name, state job.State) { + jobEvent, err := event.NewJobStateChangeEvent(tnnt, jobName, state) + if err != nil { + j.logger.Error("error creating event for job state change: %s", err) + return + } + j.eventHandler.HandleEvent(jobEvent) +} + +func (j *JobService) raiseDeleteEvent(tnnt tenant.Tenant, jobName job.Name) { + jobEvent, err := event.NewJobDeleteEvent(tnnt, jobName) + if err != nil { + j.logger.Error("error creating event for job delete: %s", err) + return + } + j.eventHandler.HandleEvent(jobEvent) +} + +func (*JobService) groupDownstreamPerProject(downstreams []*job.Downstream) map[tenant.ProjectName][]*job.Downstream { + output := make(map[tenant.ProjectName][]*job.Downstream) + for _, d := range downstreams { + output[d.ProjectName()] = append(output[d.ProjectName()], d) + } + return output +} + +func raiseJobEventMetric(jobTenant tenant.Tenant, state string, metricValue int) { + telemetry.NewCounter(job.MetricJobEvent, map[string]string{ + "project": jobTenant.ProjectName().String(), + "namespace": jobTenant.NamespaceName().String(), + "status": state, + }).Add(float64(metricValue)) } diff --git a/core/job/service/job_service_test.go b/core/job/service/job_service_test.go index 4acc5e202c..ffa0c42d68 100644 --- a/core/job/service/job_service_test.go +++ b/core/job/service/job_service_test.go @@ -3,20 +3,22 @@ package service_test import ( "context" "errors" + "fmt" "testing" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/job/service" - "github.com/odpf/optimus/core/job/service/filter" - "github.com/odpf/optimus/core/tenant" - optErrors "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/internal/writer" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/core/event/moderator" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/job/service" + "github.com/raystack/optimus/core/job/service/filter" + "github.com/raystack/optimus/core/tenant" + optErrors "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/internal/writer" + "github.com/raystack/optimus/sdk/plugin" ) func TestJobService(t *testing.T) { @@ -59,13 +61,20 @@ func TestJobService(t *testing.T) { log := log.NewNoop() - var jobNamesWithValidationError []job.Name + var jobNamesWithInvalidSpec []job.Name + var emptyJobNames []string t.Run("Add", func(t *testing.T) { t.Run("add jobs", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -75,6 +84,11 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specs := []*job.Spec{specA} @@ -94,9 +108,14 @@ func TestJobService(t *testing.T) { jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) upstreamResolver.On("BulkResolve", ctx, project.Name(), jobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + + jobNamesToUpload := []string{jobA.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, emptyJobNames).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Add(ctx, sampleTenant, specs) assert.NoError(t, err) }) @@ -104,6 +123,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -118,7 +143,7 @@ func TestJobService(t *testing.T) { tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(&tenant.WithDetails{}, errors.New("internal error")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) err := jobService.Add(ctx, sampleTenant, specs) assert.ErrorContains(t, err, "internal error") }) @@ -126,6 +151,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -135,6 +166,11 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -161,9 +197,14 @@ func TestJobService(t *testing.T) { jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) upstreamResolver.On("BulkResolve", ctx, project.Name(), jobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + + jobNamesToUpload := []string{jobA.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, emptyJobNames).Return(nil) + + eventHandler.On("HandleEvent", mock.Anything).Times(1) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Add(ctx, sampleTenant, specs) assert.ErrorContains(t, err, "generate upstream error") }) @@ -171,6 +212,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -188,7 +235,7 @@ func TestJobService(t *testing.T) { upstreamResolver.On("BulkResolve", ctx, mock.Anything, mock.Anything, mock.Anything).Return(nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) @@ -199,7 +246,7 @@ func TestJobService(t *testing.T) { pluginService.On("GenerateUpstreams", ctx, detailedTenant, mock.Anything, true).Return(nil, errors.New("generate upstream error")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) err := jobService.Add(ctx, sampleTenant, specs) assert.ErrorContains(t, err, "generate upstream error") }) @@ -207,6 +254,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -216,6 +269,11 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specs := []*job.Spec{specA} @@ -232,9 +290,14 @@ func TestJobService(t *testing.T) { jobWithUpstream := job.NewWithUpstream(jobA, nil) upstreamResolver.On("BulkResolve", ctx, project.Name(), jobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + + jobNamesToUpload := []string{jobA.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, emptyJobNames).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Add(ctx, sampleTenant, specs) assert.NoError(t, err) }) @@ -242,6 +305,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -251,6 +320,11 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specs := []*job.Spec{specA, specB} @@ -268,14 +342,19 @@ func TestJobService(t *testing.T) { jobB := job.NewJob(sampleTenant, specB, "", nil) savedJobs := []*job.Job{jobB} - jobRepo.On("Add", ctx, mock.Anything).Return(savedJobs, errors.New("unable to save job A"), nil) + jobRepo.On("Add", ctx, mock.Anything).Return(savedJobs, errors.New("unable to save job A")) jobWithUpstreamB := job.NewWithUpstream(jobB, nil) upstreamResolver.On("BulkResolve", ctx, project.Name(), savedJobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstreamB}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) + + jobNamesToUpload := []string{jobB.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, emptyJobNames).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Add(ctx, sampleTenant, specs) assert.ErrorContains(t, err, "unable to save job A") }) @@ -283,6 +362,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -299,7 +384,7 @@ func TestJobService(t *testing.T) { upstreamResolver.On("BulkResolve", ctx, mock.Anything, mock.Anything, mock.Anything).Return(nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) resourceA := job.ResourceURN("resource-A") pluginService.On("GenerateDestination", ctx, detailedTenant, specA.Task()).Return(resourceA, nil).Once() @@ -309,7 +394,7 @@ func TestJobService(t *testing.T) { jobRepo.On("Add", ctx, mock.Anything).Return([]*job.Job{}, errors.New("unable to save job A"), errors.New("all jobs failed")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) err := jobService.Add(ctx, sampleTenant, specs) assert.ErrorContains(t, err, "unable to save job A") }) @@ -317,6 +402,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -326,6 +417,11 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specs := []*job.Spec{specA} @@ -345,18 +441,83 @@ func TestJobService(t *testing.T) { jobWithUpstreamA := job.NewWithUpstream(jobA, nil) upstreamResolver.On("BulkResolve", ctx, project.Name(), jobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstreamA}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(errors.New("internal error")) + upstreamRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(errors.New("internal error")) + + jobNamesToUpload := []string{jobA.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, emptyJobNames).Return(nil) + + eventHandler.On("HandleEvent", mock.Anything).Times(1) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Add(ctx, sampleTenant, specs) assert.Error(t, err) }) + t.Run("return error if encounter issue when uploading jobs", func(t *testing.T) { + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + pluginService := new(PluginService) + defer pluginService.AssertExpectations(t) + + upstreamResolver := new(UpstreamResolver) + defer upstreamResolver.AssertExpectations(t) + + tenantDetailsGetter := new(TenantDetailsGetter) + defer tenantDetailsGetter.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + specs := []*job.Spec{specA} + + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) + + jobADestination := job.ResourceURN("resource-A") + pluginService.On("GenerateDestination", ctx, detailedTenant, specA.Task()).Return(jobADestination, nil) + + jobAUpstreamName := []job.ResourceURN{"job-B"} + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return(jobAUpstreamName, nil) + + jobA := job.NewJob(sampleTenant, specA, jobADestination, jobAUpstreamName) + jobs := []*job.Job{jobA} + jobRepo.On("Add", ctx, mock.Anything).Return(jobs, nil, nil) + + upstream := job.NewUpstreamResolved("job-B", "", "resource-B", sampleTenant, "static", taskName, false) + jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) + upstreamResolver.On("BulkResolve", ctx, project.Name(), jobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) + + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + + errorMsg := "internal error" + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, mock.Anything, emptyJobNames).Return(errors.New(errorMsg)) + + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.Add(ctx, sampleTenant, specs) + assert.ErrorContains(t, err, errorMsg) + }) }) t.Run("Update", func(t *testing.T) { t.Run("update jobs", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -366,6 +527,11 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specs := []*job.Spec{specA} @@ -385,9 +551,14 @@ func TestJobService(t *testing.T) { jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) upstreamResolver.On("BulkResolve", ctx, project.Name(), jobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobNamesToUpload := []string{jobA.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, emptyJobNames).Return(nil) + + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Update(ctx, sampleTenant, specs) assert.NoError(t, err) }) @@ -395,6 +566,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -409,7 +586,7 @@ func TestJobService(t *testing.T) { tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(&tenant.WithDetails{}, errors.New("internal error")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) err := jobService.Update(ctx, sampleTenant, specs) assert.ErrorContains(t, err, "internal error") }) @@ -417,6 +594,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -426,6 +609,11 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -452,9 +640,14 @@ func TestJobService(t *testing.T) { jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) upstreamResolver.On("BulkResolve", ctx, project.Name(), jobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + + jobNamesToUpload := []string{jobA.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, emptyJobNames).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Update(ctx, sampleTenant, specs) assert.ErrorContains(t, err, "generate upstream error") }) @@ -462,6 +655,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -479,7 +678,7 @@ func TestJobService(t *testing.T) { upstreamResolver.On("BulkResolve", ctx, mock.Anything, mock.Anything, mock.Anything).Return(nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) @@ -490,7 +689,7 @@ func TestJobService(t *testing.T) { pluginService.On("GenerateUpstreams", ctx, detailedTenant, mock.Anything, true).Return(nil, errors.New("generate upstream error")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) err := jobService.Update(ctx, sampleTenant, specs) assert.ErrorContains(t, err, "generate upstream error") }) @@ -498,6 +697,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -507,6 +712,11 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specs := []*job.Spec{specA} @@ -523,9 +733,14 @@ func TestJobService(t *testing.T) { jobWithUpstream := job.NewWithUpstream(jobA, nil) upstreamResolver.On("BulkResolve", ctx, project.Name(), jobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + + jobNamesToUpload := []string{jobA.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, emptyJobNames).Return(nil) + + eventHandler.On("HandleEvent", mock.Anything).Times(1) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Update(ctx, sampleTenant, specs) assert.NoError(t, err) }) @@ -533,6 +748,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -542,6 +763,11 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specs := []*job.Spec{specA, specB} @@ -564,9 +790,14 @@ func TestJobService(t *testing.T) { jobWithUpstreamB := job.NewWithUpstream(jobB, nil) upstreamResolver.On("BulkResolve", ctx, project.Name(), savedJobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstreamB}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) + + jobNamesToUpload := []string{jobB.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, emptyJobNames).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Update(ctx, sampleTenant, specs) assert.ErrorContains(t, err, "unable to save job A") }) @@ -574,6 +805,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -590,7 +827,7 @@ func TestJobService(t *testing.T) { upstreamResolver.On("BulkResolve", ctx, mock.Anything, mock.Anything, mock.Anything).Return(nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(nil) resourceA := job.ResourceURN("resource-A") pluginService.On("GenerateDestination", ctx, detailedTenant, specA.Task()).Return(resourceA, nil).Once() @@ -600,7 +837,7 @@ func TestJobService(t *testing.T) { jobRepo.On("Update", ctx, mock.Anything).Return([]*job.Job{}, errors.New("unable to update job A"), errors.New("all jobs failed")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) err := jobService.Update(ctx, sampleTenant, specs) assert.ErrorContains(t, err, "unable to update job A") }) @@ -608,6 +845,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -617,6 +860,11 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specs := []*job.Spec{specA} @@ -635,32 +883,202 @@ func TestJobService(t *testing.T) { jobWithUpstreamA := job.NewWithUpstream(jobA, nil) upstreamResolver.On("BulkResolve", ctx, project.Name(), jobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstreamA}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(errors.New("internal error")) + upstreamRepo.On("ReplaceUpstreams", ctx, mock.Anything).Return(errors.New("internal error")) + + jobNamesToUpload := []string{jobA.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, emptyJobNames).Return(nil) + + eventHandler.On("HandleEvent", mock.Anything).Times(1) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Update(ctx, sampleTenant, specs) assert.Error(t, err) }) + t.Run("return error if encounter issue when uploading jobs", func(t *testing.T) { + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + pluginService := new(PluginService) + defer pluginService.AssertExpectations(t) + + upstreamResolver := new(UpstreamResolver) + defer upstreamResolver.AssertExpectations(t) + + tenantDetailsGetter := new(TenantDetailsGetter) + defer tenantDetailsGetter.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + specs := []*job.Spec{specA} + + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) + + jobADestination := job.ResourceURN("resource-A") + pluginService.On("GenerateDestination", ctx, detailedTenant, specA.Task()).Return(jobADestination, nil) + + jobAUpstreamName := []job.ResourceURN{"job-B"} + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return(jobAUpstreamName, nil) + + jobA := job.NewJob(sampleTenant, specA, jobADestination, jobAUpstreamName) + jobs := []*job.Job{jobA} + jobRepo.On("Update", ctx, mock.Anything).Return(jobs, nil, nil) + + upstream := job.NewUpstreamResolved("job-B", "", "resource-B", sampleTenant, "static", taskName, false) + jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) + upstreamResolver.On("BulkResolve", ctx, project.Name(), jobs, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) + + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + + errorMsg := "internal error" + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, mock.Anything, emptyJobNames).Return(errors.New(errorMsg)) + + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.Update(ctx, sampleTenant, specs) + assert.ErrorContains(t, err, errorMsg) + }) }) + + t.Run("ChangeNamespace", func(t *testing.T) { + newNamespaceName := "newNamespace" + newTenant, _ := tenant.NewTenant(project.Name().String(), newNamespaceName) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + jobA := job.NewJob(newTenant, specA, "table-A", []job.ResourceURN{"table-B"}) + t.Run("should fail if error in repo", func(t *testing.T) { + jobRepo := new(JobRepository) + jobRepo.On("ChangeJobNamespace", ctx, specA.Name(), sampleTenant, newTenant).Return(errors.New("error in transaction")) + defer jobRepo.AssertExpectations(t) + + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, nil, nil, nil) + err := jobService.ChangeNamespace(ctx, sampleTenant, newTenant, specA.Name()) + assert.ErrorContains(t, err, "error in transaction") + }) + + t.Run("should fail if error getting newly created job", func(t *testing.T) { + jobRepo := new(JobRepository) + jobRepo.On("ChangeJobNamespace", ctx, specA.Name(), sampleTenant, newTenant).Return(nil) + jobRepo.On("GetByJobName", ctx, project.Name(), specA.Name()).Return(nil, errors.New("error in fetching job from DB")) + defer jobRepo.AssertExpectations(t) + + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, nil, nil, nil) + err := jobService.ChangeNamespace(ctx, sampleTenant, newTenant, specA.Name()) + assert.ErrorContains(t, err, "error in fetching job from DB") + }) + + t.Run("should fail if error in upload job", func(t *testing.T) { + jobRepo := new(JobRepository) + jobRepo.On("ChangeJobNamespace", ctx, specA.Name(), sampleTenant, newTenant).Return(nil) + jobRepo.On("GetByJobName", ctx, project.Name(), specA.Name()).Return(jobA, nil) + defer jobRepo.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + jobModified := []string{specA.Name().String()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, emptyJobNames, jobModified).Return(errors.New("error in upload jobs")) + defer jobDeploymentService.AssertExpectations(t) + + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, nil, jobDeploymentService, nil) + err := jobService.ChangeNamespace(ctx, sampleTenant, newTenant, specA.Name()) + assert.ErrorContains(t, err, "error in upload jobs") + }) + + t.Run("should fail if error in upload new job", func(t *testing.T) { + jobRepo := new(JobRepository) + jobRepo.On("ChangeJobNamespace", ctx, specA.Name(), sampleTenant, newTenant).Return(nil) + jobRepo.On("GetByJobName", ctx, project.Name(), specA.Name()).Return(jobA, nil) + defer jobRepo.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + jobModified := []string{specA.Name().String()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, emptyJobNames, jobModified).Return(nil) + jobDeploymentService.On("UploadJobs", ctx, newTenant, jobModified, emptyJobNames).Return(errors.New("error in upload new job")) + defer jobDeploymentService.AssertExpectations(t) + + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, nil, jobDeploymentService, nil) + + err := jobService.ChangeNamespace(ctx, sampleTenant, newTenant, specA.Name()) + assert.ErrorContains(t, err, "error in upload new job") + }) + + t.Run("successfully", func(t *testing.T) { + jobRepo := new(JobRepository) + jobRepo.On("ChangeJobNamespace", ctx, specA.Name(), sampleTenant, newTenant).Return(nil) + jobRepo.On("GetByJobName", ctx, project.Name(), specA.Name()).Return(jobA, nil) + defer jobRepo.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + jobModified := []string{specA.Name().String()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, emptyJobNames, jobModified).Return(nil) + jobDeploymentService.On("UploadJobs", ctx, newTenant, jobModified, emptyJobNames).Return(nil) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + defer eventHandler.AssertExpectations(t) + + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, eventHandler, nil, jobDeploymentService, nil) + err := jobService.ChangeNamespace(ctx, sampleTenant, newTenant, specA.Name()) + assert.NoError(t, err) + }) + }) + t.Run("Delete", func(t *testing.T) { t.Run("deletes job without downstream", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(nil, nil) jobRepo.On("Delete", ctx, project.Name(), specA.Name(), false).Return(nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobNamesToRemove := []string{specA.Name().String()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, emptyJobNames, jobNamesToRemove).Return(nil) + + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, nil, nil, nil, eventHandler, log, jobDeploymentService, nil) affectedDownstream, err := jobService.Delete(ctx, sampleTenant, specA.Name(), false, false) assert.NoError(t, err) assert.Empty(t, affectedDownstream) }) + t.Run("deletes job with downstream if it is a force delete", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() downstreamFullNames := []job.FullName{"test-proj/job-B", "test-proj/job-C"} @@ -669,10 +1087,15 @@ func TestJobService(t *testing.T) { job.NewDownstream("job-C", project.Name(), namespace.Name(), taskName), } - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(downstreamList, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(downstreamList, nil) jobRepo.On("Delete", ctx, project.Name(), specA.Name(), false).Return(nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobNamesToRemove := []string{specA.Name().String()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, emptyJobNames, jobNamesToRemove).Return(nil) + + eventHandler.On("HandleEvent", mock.Anything).Times(1) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, nil, nil, nil, eventHandler, log, jobDeploymentService, nil) + affectedDownstream, err := jobService.Delete(ctx, sampleTenant, specA.Name(), false, true) assert.NoError(t, err) assert.EqualValues(t, downstreamFullNames, affectedDownstream) @@ -681,15 +1104,21 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() downstreamList := []*job.Downstream{ job.NewDownstream("job-B", project.Name(), namespace.Name(), taskName), job.NewDownstream("job-C", project.Name(), namespace.Name(), taskName), } - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(downstreamList, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(downstreamList, nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, nil, nil, nil, nil, log, nil, nil) affectedDownstream, err := jobService.Delete(ctx, sampleTenant, specA.Name(), false, false) assert.Error(t, err) assert.Empty(t, affectedDownstream) @@ -698,11 +1127,18 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(nil, errors.New("internal error")) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(nil, errors.New("internal error")) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, nil, nil, nil, nil, log, nil, nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) affectedDownstream, err := jobService.Delete(ctx, sampleTenant, specA.Name(), false, false) assert.Error(t, err) assert.Empty(t, affectedDownstream) @@ -711,22 +1147,62 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(nil, nil) jobRepo.On("Delete", ctx, project.Name(), specA.Name(), false).Return(errors.New("internal error")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, nil, nil, nil, nil, log, nil, nil) affectedDownstream, err := jobService.Delete(ctx, sampleTenant, specA.Name(), false, false) assert.Error(t, err) assert.Empty(t, affectedDownstream) }) + t.Run("return error if encounter issue when removing jobs from scheduler", func(t *testing.T) { + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(nil, nil) + jobRepo.On("Delete", ctx, project.Name(), specA.Name(), false).Return(nil) + + errorMsg := "internal error" + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, emptyJobNames, mock.Anything).Return(errors.New(errorMsg)) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, nil, nil, nil, eventHandler, log, jobDeploymentService, nil) + affectedDownstream, err := jobService.Delete(ctx, sampleTenant, specA.Name(), false, false) + assert.ErrorContains(t, err, errorMsg) + assert.Empty(t, affectedDownstream) + }) }) t.Run("ReplaceAll", func(t *testing.T) { t.Run("adds new jobs that does not exist yet", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -739,6 +1215,11 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -765,18 +1246,29 @@ func TestJobService(t *testing.T) { jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobA}, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(1) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + jobNamesToUpload := []string{jobA.GetName()} + var jobNamesToRemove []string + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.NoError(t, err) }) t.Run("updates modified existing jobs", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -789,6 +1281,11 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -809,24 +1306,35 @@ func TestJobService(t *testing.T) { pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return(jobAUpstreamName, nil) jobRepo.On("Update", ctx, mock.Anything).Return([]*job.Job{jobA}, nil) + eventHandler.On("HandleEvent", mock.Anything).Times(1) upstream := job.NewUpstreamResolved("job-B", "", "resource-B", sampleTenant, "static", taskName, false) jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobA}, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + jobNamesToUpload := []string{jobA.GetName()} + var jobNamesToRemove []string + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.NoError(t, err) }) t.Run("deletes the removed jobs", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -839,6 +1347,11 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -853,19 +1366,96 @@ func TestJobService(t *testing.T) { jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(existingSpecs, nil) - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), specB.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specB.Name()).Return(nil, nil) jobRepo.On("Delete", ctx, project.Name(), specB.Name(), false).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(1) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + var jobNamesToUpload []string + jobNamesToRemove := []string{specB.Name().String()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) + assert.NoError(t, err) + }) + t.Run("deletes the jobs which the downstreams are also be deleted", func(t *testing.T) { + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + pluginService := new(PluginService) + defer pluginService.AssertExpectations(t) + + upstreamResolver := new(UpstreamResolver) + defer upstreamResolver.AssertExpectations(t) + + tenantDetailsGetter := new(TenantDetailsGetter) + defer tenantDetailsGetter.AssertExpectations(t) + + logWriter := new(mockWriter) + defer logWriter.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) + + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + specD, _ := job.NewSpecBuilder(jobVersion, "job-D", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + jobA := job.NewJob(sampleTenant, specA, "", nil) + jobB := job.NewJob(sampleTenant, specB, "", nil) + jobC := job.NewJob(sampleTenant, specC, "", nil) + jobD := job.NewJob(sampleTenant, specD, "", nil) + + incomingSpecs := []*job.Spec{} + + existingSpecs := []*job.Job{jobA, jobB, jobC, jobD} + + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(existingSpecs, nil) + + downstreamA := []*job.Downstream{ + job.NewDownstream("job-B", project.Name(), namespace.Name(), taskName), + job.NewDownstream("job-D", project.Name(), namespace.Name(), taskName), + } + downstreamB := []*job.Downstream{ + job.NewDownstream("job-C", project.Name(), namespace.Name(), taskName), + } + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(downstreamA, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specB.Name()).Return(downstreamB, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specC.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specD.Name()).Return(nil, nil) + jobRepo.On("Delete", ctx, project.Name(), mock.Anything, false).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(4) + + logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, mock.Anything, mock.Anything).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.NoError(t, err) }) t.Run("adds, updates, and deletes jobs in a request", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -878,6 +1468,11 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -910,25 +1505,36 @@ func TestJobService(t *testing.T) { jobB := job.NewJob(sampleTenant, specB, "", nil) jobRepo.On("Update", ctx, mock.Anything).Return([]*job.Job{jobB}, nil) - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecC.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecC.Name()).Return(nil, nil) jobRepo.On("Delete", ctx, project.Name(), existingSpecC.Name(), false).Return(nil) upstream := job.NewUpstreamResolved("job-B", "", "resource-B", sampleTenant, "static", taskName, false) jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobA, jobB}, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(3) + + jobNamesToUpload := []string{jobA.GetName(), jobB.GetName()} + jobNamesToRemove := []string{existingJobC.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.NoError(t, err) }) t.Run("skips invalid job when classifying specs as added, modified, or deleted", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -941,6 +1547,11 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -975,18 +1586,23 @@ func TestJobService(t *testing.T) { jobB := job.NewJob(sampleTenant, specB, "", nil) jobRepo.On("Update", ctx, mock.Anything).Return([]*job.Job{jobB}, nil) - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecC.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecC.Name()).Return(nil, nil) jobRepo.On("Delete", ctx, project.Name(), existingSpecC.Name(), false).Return(nil) upstream := job.NewUpstreamResolved("job-B", "", "resource-B", sampleTenant, "static", taskName, false) jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobA, jobB}, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(3) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobNamesToUpload := []string{jobA.GetName(), jobB.GetName()} + jobNamesToRemove := []string{existingJobC.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, []job.Name{"job-D"}, logWriter) assert.NoError(t, err) }) @@ -994,6 +1610,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1006,6 +1628,11 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + eventHandler := newEventHandler(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -1020,19 +1647,30 @@ func TestJobService(t *testing.T) { var specADestination job.ResourceURN pluginService.On("GenerateDestination", ctx, detailedTenant, specA.Task()).Return(specADestination, errors.New("internal error")).Once() - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecC.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecC.Name()).Return(nil, nil) jobRepo.On("Delete", ctx, project.Name(), existingSpecC.Name(), false).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(1) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + var jobNamesToUpload []string + jobNamesToRemove := []string{existingJobC.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.ErrorContains(t, err, "internal error") }) t.Run("skips invalid modified jobs", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1045,6 +1683,11 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -1062,19 +1705,30 @@ func TestJobService(t *testing.T) { var jobBDestination job.ResourceURN pluginService.On("GenerateDestination", ctx, detailedTenant, specB.Task()).Return(jobBDestination, errors.New("internal error")).Once() - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecC.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecC.Name()).Return(nil, nil) jobRepo.On("Delete", ctx, project.Name(), existingSpecC.Name(), false).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(1) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + var jobNamesToUpload []string + jobNamesToRemove := []string{existingJobC.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.ErrorContains(t, err, "internal error") }) - t.Run("skips to delete jobs with downstream", func(t *testing.T) { + t.Run("skips to delete jobs if the downstream is not deleted", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1087,16 +1741,24 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() - incomingSpecs := []*job.Spec{specA} + specE, _ := job.NewSpecBuilder(jobVersion, "job-E", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + incomingSpecs := []*job.Spec{specA, specE} existingSpecC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTask).Build() existingJobC := job.NewJob(sampleTenant, existingSpecC, "", nil) existingSpecD, _ := job.NewSpecBuilder(jobVersion, "job-D", "sample-owner", jobSchedule, jobWindow, jobTask).Build() existingJobD := job.NewJob(sampleTenant, existingSpecD, "", nil) - existingSpecs := []*job.Job{existingJobC, existingJobD} + existingSpecE, _ := job.NewSpecBuilder(jobVersion, "job-E", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + existingJobE := job.NewJob(sampleTenant, existingSpecE, "", nil) + existingSpecs := []*job.Job{existingJobC, existingJobD, existingJobE} jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(existingSpecs, nil) @@ -1110,29 +1772,41 @@ func TestJobService(t *testing.T) { jobRepo.On("Add", ctx, mock.Anything).Return([]*job.Job{jobA}, nil) downstreamList := []*job.Downstream{ - job.NewDownstream("sample-job-E", project.Name(), namespace.Name(), taskName), + job.NewDownstream("job-E", project.Name(), namespace.Name(), taskName), } - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecC.Name()).Return(downstreamList, nil) - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecD.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecC.Name()).Return(downstreamList, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecD.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), existingSpecE.Name()).Return(nil, nil) jobRepo.On("Delete", ctx, project.Name(), existingSpecD.Name(), false).Return(nil) upstream := job.NewUpstreamResolved("job-B", "", "resource-B", sampleTenant, "static", taskName, false) jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobA}, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(2) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + jobNamesToUpload := []string{jobA.GetName()} + jobNamesToRemove := []string{existingJobD.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.ErrorContains(t, err, "job is being used by") }) t.Run("should not break process if one of job failed to be added", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1145,6 +1819,11 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -1173,18 +1852,29 @@ func TestJobService(t *testing.T) { jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobA}, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobNamesToUpload := []string{jobA.GetName()} + var jobNamesToRemove []string + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.ErrorContains(t, err, "internal error") }) t.Run("should not break process if one of job failed to be updated", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1197,6 +1887,9 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -1218,15 +1911,20 @@ func TestJobService(t *testing.T) { jobRepo.On("Update", ctx, mock.Anything).Return([]*job.Job{}, errors.New("internal error")) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.ErrorContains(t, err, "internal error") }) t.Run("should not break process if one of job failed to be deleted", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1239,6 +1937,9 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -1253,19 +1954,25 @@ func TestJobService(t *testing.T) { jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(existingSpecs, nil) - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), specB.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specB.Name()).Return(nil, nil) jobRepo.On("Delete", ctx, project.Name(), specB.Name(), false).Return(errors.New("internal error")) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil).Times(3) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.ErrorContains(t, err, "internal error") }) t.Run("should not delete job if unable to check downstream of the job", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1278,6 +1985,9 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() @@ -1292,18 +2002,93 @@ func TestJobService(t *testing.T) { jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(existingSpecs, nil) - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), specB.Name()).Return(nil, errors.New("internal error")) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specB.Name()).Return(nil, errors.New("internal error")) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil).Twice() - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.ErrorContains(t, err, "internal error") }) + t.Run("should not delete job if one of its downstream is unable to delete", func(t *testing.T) { + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + pluginService := new(PluginService) + defer pluginService.AssertExpectations(t) + + upstreamResolver := new(UpstreamResolver) + defer upstreamResolver.AssertExpectations(t) + + tenantDetailsGetter := new(TenantDetailsGetter) + defer tenantDetailsGetter.AssertExpectations(t) + + logWriter := new(mockWriter) + defer logWriter.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) + + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + specD, _ := job.NewSpecBuilder(jobVersion, "job-D", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + jobA := job.NewJob(sampleTenant, specA, "", nil) + jobB := job.NewJob(sampleTenant, specB, "", nil) + jobC := job.NewJob(sampleTenant, specC, "", nil) + jobD := job.NewJob(sampleTenant, specD, "", nil) + + incomingSpecs := []*job.Spec{} + + existingSpecs := []*job.Job{jobA, jobB, jobC, jobD} + + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(existingSpecs, nil) + + downstreamA := []*job.Downstream{ + job.NewDownstream("job-B", project.Name(), namespace.Name(), taskName), + job.NewDownstream("job-D", project.Name(), namespace.Name(), taskName), + } + downstreamB := []*job.Downstream{ + job.NewDownstream("job-C", project.Name(), namespace.Name(), taskName), + } + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(downstreamA, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specB.Name()).Return(downstreamB, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specC.Name()).Return(nil, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specD.Name()).Return(nil, nil) + jobRepo.On("Delete", ctx, project.Name(), specC.Name(), false).Return(errors.New("db error")) + jobRepo.On("Delete", ctx, project.Name(), specD.Name(), false).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + + var jobNamesToUpload []string + jobNamesToRemove := []string{specD.Name().String()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) + assert.Error(t, err) + }) t.Run("returns error if unable to get tenant details", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1316,6 +2101,9 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() jobB := job.NewJob(sampleTenant, specB, "", nil) @@ -1330,8 +2118,74 @@ func TestJobService(t *testing.T) { errorMsg := "project/namespace error" tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(nil, errors.New(errorMsg)) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithValidationError, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, jobDeploymentService, nil) + + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) + assert.ErrorContains(t, err, errorMsg) + }) + t.Run("returns error if encounter error when uploading/removing jobs", func(t *testing.T) { + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + pluginService := new(PluginService) + defer pluginService.AssertExpectations(t) + + upstreamResolver := new(UpstreamResolver) + defer upstreamResolver.AssertExpectations(t) + + tenantDetailsGetter := new(TenantDetailsGetter) + defer tenantDetailsGetter.AssertExpectations(t) + + logWriter := new(mockWriter) + defer logWriter.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) + + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + jobADestination := job.ResourceURN("resource-A") + jobAUpstreamName := []job.ResourceURN{"job-B"} + jobA := job.NewJob(sampleTenant, specA, jobADestination, jobAUpstreamName) + + specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + jobB := job.NewJob(sampleTenant, specB, "", nil) + + incomingSpecs := []*job.Spec{specA, specB} + + existingJobs := []*job.Job{jobB} + + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(existingJobs, nil) + + pluginService.On("GenerateDestination", ctx, detailedTenant, specA.Task()).Return(jobADestination, nil).Once() + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return(jobAUpstreamName, nil) + + jobRepo.On("Add", ctx, mock.Anything).Return([]*job.Job{jobA}, nil) + + upstream := job.NewUpstreamResolved("job-B", "", "resource-B", sampleTenant, "static", taskName, false) + + jobWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstream}) + upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobA}, mock.Anything).Return([]*job.WithUpstream{jobWithUpstream}, nil, nil) + + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobWithUpstream}).Return(nil) + + logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + errorMsg := "internal error" + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, mock.Anything, mock.Anything).Return(errors.New(errorMsg)) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + err := jobService.ReplaceAll(ctx, sampleTenant, incomingSpecs, jobNamesWithInvalidSpec, logWriter) assert.ErrorContains(t, err, errorMsg) }) }) @@ -1341,6 +2195,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1353,6 +2213,11 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() jobADestination := job.ResourceURN("resource-A") jobAUpstreamName := []job.ResourceURN{"job-B"} @@ -1381,11 +2246,16 @@ func TestJobService(t *testing.T) { jobBWithUpstream := job.NewWithUpstream(jobB, []*job.Upstream{upstreamC}) upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobA, jobB}, mock.Anything).Return([]*job.WithUpstream{jobAWithUpstream, jobBWithUpstream}, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobAWithUpstream, jobBWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobAWithUpstream, jobBWithUpstream}).Return(nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil).Times(3) + eventHandler.On("HandleEvent", mock.Anything).Times(2) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + var jobNamesToRemove []string + jobNamesToUpload := []string{jobA.GetName(), jobB.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Refresh(ctx, project.Name(), []string{namespace.Name().String()}, nil, logWriter) assert.NoError(t, err) }) @@ -1393,6 +2263,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1405,6 +2281,11 @@ func TestJobService(t *testing.T) { logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() jobADestination := job.ResourceURN("resource-A") jobAUpstreamName := []job.ResourceURN{"job-B"} @@ -1439,12 +2320,17 @@ func TestJobService(t *testing.T) { upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobA}, mock.Anything).Return([]*job.WithUpstream{jobAWithUpstream}, nil) upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobB}, mock.Anything).Return([]*job.WithUpstream{jobBWithUpstream}, nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobAWithUpstream}).Return(nil) - jobRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobBWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobAWithUpstream}).Return(nil) + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobBWithUpstream}).Return(nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil).Times(4) + eventHandler.On("HandleEvent", mock.Anything).Times(2) + + var jobNamesToRemove []string + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, []string{jobA.GetName()}, jobNamesToRemove).Return(nil) + jobDeploymentService.On("UploadJobs", ctx, otherTenant, []string{jobB.GetName()}, jobNamesToRemove).Return(nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) err := jobService.Refresh(ctx, project.Name(), []string{namespace.Name().String(), otherNamespace.Name().String()}, nil, logWriter) assert.NoError(t, err) }) @@ -1452,6 +2338,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -1463,21 +2355,146 @@ func TestJobService(t *testing.T) { jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(nil, errors.New("internal error")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) err := jobService.Refresh(ctx, project.Name(), []string{namespace.Name().String()}, nil, nil) assert.ErrorContains(t, err, "internal error") }) }) + t.Run("RefreshResourceDownstream", func(t *testing.T) { + t.Run("returns error if encountered error when identifying downstreams", func(t *testing.T) { + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + pluginService := new(PluginService) + defer pluginService.AssertExpectations(t) + + upstreamResolver := new(UpstreamResolver) + defer upstreamResolver.AssertExpectations(t) + + tenantDetailsGetter := new(TenantDetailsGetter) + defer tenantDetailsGetter.AssertExpectations(t) + + logWriter := new(mockWriter) + defer logWriter.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + + resourceURNs := []job.ResourceURN{"project.dataset.table"} + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + + downstreamRepo.On("GetDownstreamBySources", ctx, resourceURNs).Return(nil, errors.New("internal error")) + + err := jobService.RefreshResourceDownstream(ctx, resourceURNs, logWriter) + assert.ErrorContains(t, err, "internal error") + }) + + t.Run("should refresh and return nil if no error is encountered when refreshing downstreams", func(t *testing.T) { + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + pluginService := new(PluginService) + defer pluginService.AssertExpectations(t) + + upstreamResolver := new(UpstreamResolver) + defer upstreamResolver.AssertExpectations(t) + + tenantDetailsGetter := new(TenantDetailsGetter) + defer tenantDetailsGetter.AssertExpectations(t) + + logWriter := new(mockWriter) + defer logWriter.AssertExpectations(t) + + jobDeploymentService := new(JobDeploymentService) + defer jobDeploymentService.AssertExpectations(t) + + eventHandler := newEventHandler(t) + + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + jobADestination := job.ResourceURN("resource-A") + jobAUpstreamName := job.ResourceURN("job-B") + jobA := job.NewJob(sampleTenant, specA, jobADestination, []job.ResourceURN{jobAUpstreamName}) + + specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + jobBDestination := job.ResourceURN("resource-B") + jobBUpstreamName := job.ResourceURN("job-C") + jobB := job.NewJob(sampleTenant, specB, jobBDestination, []job.ResourceURN{jobBUpstreamName}) + + resourceURNs := []job.ResourceURN{jobAUpstreamName, jobBUpstreamName} + + jobDownstreams := []*job.Downstream{ + job.NewDownstream(jobA.Spec().Name(), sampleTenant.ProjectName(), sampleTenant.NamespaceName(), jobTask.Name()), + job.NewDownstream(jobB.Spec().Name(), sampleTenant.ProjectName(), sampleTenant.NamespaceName(), jobTask.Name()), + } + + downstreamRepo.On("GetDownstreamBySources", ctx, resourceURNs).Return(jobDownstreams, nil) + jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), jobA.Spec().Name()).Return(jobA, nil) + jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), jobB.Spec().Name()).Return(jobB, nil) + + tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, nil) + + pluginService.On("GenerateDestination", ctx, detailedTenant, specA.Task()).Return(jobADestination, nil).Once() + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return([]job.ResourceURN{jobAUpstreamName}, nil) + + pluginService.On("GenerateDestination", ctx, detailedTenant, specB.Task()).Return(jobBDestination, nil).Once() + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specB, true).Return([]job.ResourceURN{jobBUpstreamName}, nil) + + jobRepo.On("Update", ctx, mock.Anything).Return([]*job.Job{jobA, jobB}, nil) + + upstreamB := job.NewUpstreamResolved("job-B", "", "resource-B", sampleTenant, "static", taskName, false) + jobAWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstreamB}) + upstreamC := job.NewUpstreamResolved("job-C", "", "resource-C", sampleTenant, "static", taskName, false) + jobBWithUpstream := job.NewWithUpstream(jobB, []*job.Upstream{upstreamC}) + upstreamResolver.On("BulkResolve", ctx, project.Name(), []*job.Job{jobA, jobB}, mock.Anything).Return([]*job.WithUpstream{jobAWithUpstream, jobBWithUpstream}, nil) + + upstreamRepo.On("ReplaceUpstreams", ctx, []*job.WithUpstream{jobAWithUpstream, jobBWithUpstream}).Return(nil) + + logWriter.On("Write", mock.Anything, mock.Anything).Return(nil).Times(3) + eventHandler.On("HandleEvent", mock.Anything).Times(2) + + var jobNamesToRemove []string + jobNamesToUpload := []string{jobA.GetName(), jobB.GetName()} + jobDeploymentService.On("UploadJobs", ctx, sampleTenant, jobNamesToUpload, jobNamesToRemove).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, eventHandler, log, jobDeploymentService, nil) + + err := jobService.RefreshResourceDownstream(ctx, resourceURNs, logWriter) + assert.NoError(t, err) + }) + }) + t.Run("Get", func(t *testing.T) { t.Run("return error when repo get by job name error", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + jobName, _ := job.NameFrom("job-A") jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), jobName).Return(nil, errors.New("error when fetch job")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, nil, nil, nil, nil, log, nil, nil) + actual, err := jobService.Get(ctx, sampleTenant, jobName) assert.Error(t, err, "error when fetch job") assert.Nil(t, actual) @@ -1486,11 +2503,18 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-B"}) jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), specA.Name()).Return(jobA, nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, nil, nil, nil, nil, log, nil, nil) + actual, err := jobService.Get(ctx, sampleTenant, specA.Name()) assert.NoError(t, err, "error when fetch job") assert.NotNil(t, actual) @@ -1506,7 +2530,7 @@ func TestJobService(t *testing.T) { jobRepo.On("GetAllByResourceDestination", ctx, job.ResourceURN("example")).Return(nil, errors.New("error encountered")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ResourceDestination, "example")) assert.Error(t, err, "error encountered") assert.Nil(t, actual) @@ -1519,7 +2543,7 @@ func TestJobService(t *testing.T) { jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-B"}) jobRepo.On("GetAllByResourceDestination", ctx, job.ResourceURN("table-A")).Return([]*job.Job{jobA}, nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ResourceDestination, "table-A")) assert.NoError(t, err) assert.NotNil(t, actual) @@ -1535,7 +2559,7 @@ func TestJobService(t *testing.T) { jobName, _ := job.NameFrom("job-A") jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), jobName).Return(nil, errors.New("error encountered")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithStringArray(filter.JobNames, []string{jobName.String()}), @@ -1553,7 +2577,7 @@ func TestJobService(t *testing.T) { jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), specA.Name()).Return(jobA, nil) jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), specB.Name()).Return(nil, errors.New("error encountered")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithStringArray(filter.JobNames, []string{specA.Name().String(), specB.Name().String()}), @@ -1570,7 +2594,7 @@ func TestJobService(t *testing.T) { specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), specA.Name()).Return(nil, optErrors.NotFound(job.EntityJob, "job not found")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithStringArray(filter.JobNames, []string{specA.Name().String()}), @@ -1586,7 +2610,7 @@ func TestJobService(t *testing.T) { jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-B"}) jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), specA.Name()).Return(jobA, nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithStringArray(filter.JobNames, []string{specA.Name().String()}), @@ -1605,7 +2629,7 @@ func TestJobService(t *testing.T) { jobName, _ := job.NameFrom("job-A") jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), jobName).Return(nil, errors.New("error encountered")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithString(filter.JobName, jobName.String()), @@ -1620,7 +2644,7 @@ func TestJobService(t *testing.T) { specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), specA.Name()).Return(nil, optErrors.NotFound(job.EntityJob, "job not found")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithString(filter.JobName, specA.Name().String()), @@ -1636,7 +2660,7 @@ func TestJobService(t *testing.T) { jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-B"}) jobRepo.On("GetByJobName", ctx, sampleTenant.ProjectName(), specA.Name()).Return(jobA, nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithString(filter.JobName, specA.Name().String()), @@ -1654,7 +2678,7 @@ func TestJobService(t *testing.T) { jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(nil, errors.New("error encountered")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithStringArray(filter.NamespaceNames, []string{sampleTenant.NamespaceName().String()}), @@ -1666,7 +2690,7 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithStringArray(filter.NamespaceNames, []string{""}), @@ -1682,7 +2706,7 @@ func TestJobService(t *testing.T) { jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-B"}) jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return([]*job.Job{jobA}, nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithStringArray(filter.NamespaceNames, []string{sampleTenant.NamespaceName().String()}), @@ -1700,7 +2724,7 @@ func TestJobService(t *testing.T) { jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(nil, errors.New("error encountered")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithString(filter.NamespaceName, sampleTenant.NamespaceName().String()), @@ -1716,7 +2740,7 @@ func TestJobService(t *testing.T) { jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-B"}) jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return([]*job.Job{jobA}, nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), filter.WithString(filter.NamespaceName, sampleTenant.NamespaceName().String()), @@ -1734,7 +2758,7 @@ func TestJobService(t *testing.T) { jobRepo.On("GetAllByProjectName", ctx, sampleTenant.ProjectName()).Return(nil, errors.New("error encountered")) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), ) @@ -1749,7 +2773,7 @@ func TestJobService(t *testing.T) { jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-B"}) jobRepo.On("GetAllByProjectName", ctx, sampleTenant.ProjectName()).Return([]*job.Job{jobA}, nil) - jobService := service.NewJobService(jobRepo, nil, nil, nil, nil) + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx, filter.WithString(filter.ProjectName, sampleTenant.ProjectName().String()), ) @@ -1760,7 +2784,7 @@ func TestJobService(t *testing.T) { }) }) t.Run("return error when there's no filter", func(t *testing.T) { - jobService := service.NewJobService(nil, nil, nil, nil, nil) + jobService := service.NewJobService(nil, nil, nil, nil, nil, nil, nil, log, nil, nil) actual, err := jobService.GetByFilter(ctx) assert.Error(t, err, "no filter matched") assert.Nil(t, actual) @@ -1774,7 +2798,8 @@ func TestJobService(t *testing.T) { pluginService.On("Info", ctx, jobTask.Name()).Return(nil, errors.New("error encountered")) - jobService := service.NewJobService(nil, pluginService, nil, nil, nil) + jobService := service.NewJobService(nil, nil, nil, pluginService, nil, nil, nil, nil, nil, nil) + actual, err := jobService.GetTaskInfo(ctx, jobTask) assert.Error(t, err, "error encountered") assert.Nil(t, actual) @@ -1786,11 +2811,12 @@ func TestJobService(t *testing.T) { pluginInfoResp := &plugin.Info{ Name: "bq2bq", Description: "plugin desc", - Image: "odpf/bq2bq:latest", + Image: "raystack/bq2bq:latest", } pluginService.On("Info", ctx, jobTask.Name()).Return(pluginInfoResp, nil) - jobService := service.NewJobService(nil, pluginService, nil, nil, nil) + jobService := service.NewJobService(nil, nil, nil, pluginService, nil, nil, nil, nil, nil, nil) + actual, err := jobService.GetTaskInfo(ctx, jobTask) assert.NoError(t, err) assert.NotNil(t, actual) @@ -1804,10 +2830,46 @@ func TestJobService(t *testing.T) { tenantDetailsGetter.On("GetDetails", ctx, mock.Anything).Return(nil, errors.New("get tenant details fail")) defer tenantDetailsGetter.AssertExpectations(t) - jobService := service.NewJobService(nil, nil, nil, tenantDetailsGetter, log) - err := jobService.Validate(ctx, sampleTenant, []*job.Spec{}, nil) + jobService := service.NewJobService(nil, nil, nil, nil, nil, tenantDetailsGetter, nil, log, nil, nil) + err := jobService.Validate(ctx, sampleTenant, []*job.Spec{}, jobNamesWithInvalidSpec, nil) + assert.Error(t, err) + assert.Equal(t, "get tenant details fail", err.Error()) + }) + t.Run("returns error when validate duplicate jobs detected", func(t *testing.T) { + tenantDetailsGetter := new(TenantDetailsGetter) + tenantDetailsGetter.On("GetDetails", ctx, mock.Anything).Return(detailedTenant, nil) + defer tenantDetailsGetter.AssertExpectations(t) + + pluginService := new(PluginService) + defer pluginService.AssertExpectations(t) + + upstreamResolver := new(UpstreamResolver) + defer upstreamResolver.AssertExpectations(t) + + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + logWriter := new(mockWriter) + defer logWriter.AssertExpectations(t) + + specA1, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + specA2, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(nil, nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) + + logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + + err := jobService.Validate(ctx, sampleTenant, []*job.Spec{specA1, specA2}, jobNamesWithInvalidSpec, logWriter) assert.Error(t, err) - assert.Equal(t, "get tenant details fail", err.Error()) + assert.Equal(t, "validate specs errors:\n duplicate job-A", err.Error()) }) t.Run("returns error when generate jobs", func(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) @@ -1820,22 +2882,33 @@ func TestJobService(t *testing.T) { upstreamResolver := new(UpstreamResolver) defer upstreamResolver.AssertExpectations(t) + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() - specs := []*job.Spec{specA} + + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return(nil, nil) pluginService.On("GenerateDestination", ctx, detailedTenant, specA.Task()).Return(job.ResourceURN(""), errors.New("some error on generate destination")) - jobService := service.NewJobService(nil, pluginService, upstreamResolver, tenantDetailsGetter, log) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - err := jobService.Validate(ctx, sampleTenant, specs, logWriter) + err := jobService.Validate(ctx, sampleTenant, []*job.Spec{specA}, jobNamesWithInvalidSpec, logWriter) assert.Error(t, err) assert.Equal(t, "validate specs errors:\n internal error for entity job: unable to add job-A: some error on generate destination", err.Error()) }) - t.Run("returns error when get all by project name failed", func(t *testing.T) { + t.Run("returns error when a job fail a deletion check", func(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) tenantDetailsGetter.On("GetDetails", ctx, mock.Anything).Return(detailedTenant, nil) defer tenantDetailsGetter.AssertExpectations(t) @@ -1846,26 +2919,120 @@ func TestJobService(t *testing.T) { upstreamResolver := new(UpstreamResolver) defer upstreamResolver.AssertExpectations(t) + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) - repo := new(JobRepository) - repo.On("GetAllByProjectName", ctx, sampleTenant.ProjectName()).Return(nil, errors.New("error on get all by project name")) - defer repo.AssertExpectations(t) + jobTaskConfigA, _ := job.ConfigFrom(map[string]string{"table": "table-A"}) + jobTaskConfigB, _ := job.ConfigFrom(map[string]string{"table": "table-B"}) + jobTaskConfigC, _ := job.ConfigFrom(map[string]string{"table": "table-C"}) + jobTaskConfigD, _ := job.ConfigFrom(map[string]string{"table": "table-D"}) + jobTaskA := job.NewTask(taskName, jobTaskConfigA) + jobTaskB := job.NewTask(taskName, jobTaskConfigB) + jobTaskC := job.NewTask(taskName, jobTaskConfigC) + jobTaskD := job.NewTask(taskName, jobTaskConfigD) + + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTaskA).Build() + specAUpdated, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner-updated", jobSchedule, jobWindow, jobTaskA).Build() + specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTaskB).Build() + specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTaskC).Build() + specD, _ := job.NewSpecBuilder(jobVersion, "job-D", "sample-owner", jobSchedule, jobWindow, jobTaskD).Build() + specs := []*job.Spec{specAUpdated, specB, specD} + + jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-Z"}) + jobB := job.NewJob(sampleTenant, specB, "table-B", []job.ResourceURN{"table-A", "table-D"}) + jobC := job.NewJob(sampleTenant, specC, "table-C", []job.ResourceURN{"table-B"}) + jobD := job.NewJob(sampleTenant, specD, "table-D", nil) + + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return([]*job.Job{jobA, jobB, jobC, jobD}, nil) - specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() - specs := []*job.Spec{specA} + pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskA).Return(job.ResourceURN("table-A"), nil) + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specAUpdated, true).Return([]job.ResourceURN{"table-Z"}, nil) - pluginService.On("GenerateDestination", ctx, detailedTenant, specA.Task()).Return(job.ResourceURN("example_destination"), nil) - pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return([]job.ResourceURN{"example_upstream", "another_upstream"}, nil) + jobCDownstream := []*job.Downstream{ + job.NewDownstream("job-B", project.Name(), namespace.Name(), taskName), + } + jobBDownstream := []*job.Downstream{ + job.NewDownstream("job-D", project.Name(), namespace.Name(), taskName), + } + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specC.Name()).Return(jobCDownstream, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specB.Name()).Return(jobBDownstream, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specD.Name()).Return([]*job.Downstream{}, nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - jobService := service.NewJobService(repo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.Validate(ctx, sampleTenant, specs, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) + err := jobService.Validate(ctx, sampleTenant, specs, jobNamesWithInvalidSpec, logWriter) assert.Error(t, err) - assert.Equal(t, "error on get all by project name", err.Error()) + assert.ErrorContains(t, err, "deletion of job job-C will fail. job is being used by test-proj/job-B, test-proj/job-D") + }) + + t.Run("returns no error when delete the job and its downstreams", func(t *testing.T) { + tenantDetailsGetter := new(TenantDetailsGetter) + tenantDetailsGetter.On("GetDetails", ctx, mock.Anything).Return(detailedTenant, nil) + defer tenantDetailsGetter.AssertExpectations(t) + + pluginService := new(PluginService) + defer pluginService.AssertExpectations(t) + + upstreamResolver := new(UpstreamResolver) + defer upstreamResolver.AssertExpectations(t) + + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + + logWriter := new(mockWriter) + defer logWriter.AssertExpectations(t) + + jobTaskConfigA, _ := job.ConfigFrom(map[string]string{"table": "table-A"}) + jobTaskConfigB, _ := job.ConfigFrom(map[string]string{"table": "table-B"}) + jobTaskConfigC, _ := job.ConfigFrom(map[string]string{"table": "table-C"}) + jobTaskA := job.NewTask(taskName, jobTaskConfigA) + jobTaskB := job.NewTask(taskName, jobTaskConfigB) + jobTaskC := job.NewTask(taskName, jobTaskConfigC) + + specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTaskA).Build() + specAUpdated, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner-updated", jobSchedule, jobWindow, jobTaskA).Build() + specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTaskB).Build() + specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTaskC).Build() + specs := []*job.Spec{specAUpdated} + + jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-Z"}) + jobB := job.NewJob(sampleTenant, specB, "table-B", nil) + jobC := job.NewJob(sampleTenant, specC, "table-C", []job.ResourceURN{"table-B"}) + + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return([]*job.Job{jobA, jobB, jobC}, nil) + + pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskA).Return(job.ResourceURN("table-A"), nil) + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specAUpdated, true).Return([]job.ResourceURN{"table-Z"}, nil) + + jobCDownstream := []*job.Downstream{ + job.NewDownstream("job-B", project.Name(), namespace.Name(), taskName), + } + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specC.Name()).Return(jobCDownstream, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specB.Name()).Return([]*job.Downstream{}, nil) + + logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) + err := jobService.Validate(ctx, sampleTenant, specs, jobNamesWithInvalidSpec, logWriter) + assert.NoError(t, err) }) + t.Run("returns error when there's a cyclic", func(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) tenantDetailsGetter.On("GetDetails", ctx, mock.Anything).Return(detailedTenant, nil) @@ -1877,8 +3044,14 @@ func TestJobService(t *testing.T) { upstreamResolver := new(UpstreamResolver) defer upstreamResolver.AssertExpectations(t) - repo := new(JobRepository) - defer repo.AssertExpectations(t) + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) @@ -1886,21 +3059,19 @@ func TestJobService(t *testing.T) { specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTask).Build() - specs := []*job.Spec{specA} - jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-C"}) jobB := job.NewJob(sampleTenant, specB, "table-B", []job.ResourceURN{"table-A"}) jobC := job.NewJob(sampleTenant, specC, "table-C", []job.ResourceURN{"table-B"}) - repo.On("GetAllByProjectName", ctx, sampleTenant.ProjectName()).Return([]*job.Job{jobA, jobB, jobC}, nil) + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return([]*job.Job{jobB, jobC}, nil) pluginService.On("GenerateDestination", ctx, detailedTenant, jobTask).Return(job.ResourceURN("table-A"), nil) pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return([]job.ResourceURN{"table-C"}, nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - jobService := service.NewJobService(repo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.Validate(ctx, sampleTenant, specs, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) + err := jobService.Validate(ctx, sampleTenant, []*job.Spec{specA, specB, specC}, jobNamesWithInvalidSpec, logWriter) assert.Error(t, err) assert.ErrorContains(t, err, "a cycle dependency encountered in the tree:") }) @@ -1915,8 +3086,14 @@ func TestJobService(t *testing.T) { upstreamResolver := new(UpstreamResolver) defer upstreamResolver.AssertExpectations(t) - repo := new(JobRepository) - defer repo.AssertExpectations(t) + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) @@ -1929,27 +3106,23 @@ func TestJobService(t *testing.T) { jobTaskC := job.NewTask(taskName, jobTaskConfigC) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTaskA).Build() + specAUpdated, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner-updated", jobSchedule, jobWindow, jobTaskA).Build() specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTaskB).Build() specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTaskC).Build() - specs := []*job.Spec{specA, specB, specC} jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-Z"}) jobB := job.NewJob(sampleTenant, specB, "table-B", []job.ResourceURN{"table-A"}) jobC := job.NewJob(sampleTenant, specC, "table-C", []job.ResourceURN{"table-B"}) - repo.On("GetAllByProjectName", ctx, sampleTenant.ProjectName()).Return([]*job.Job{jobA, jobB, jobC}, nil) + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return([]*job.Job{jobA, jobB, jobC}, nil) pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskA).Return(job.ResourceURN("table-A"), nil) - pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskB).Return(job.ResourceURN("table-B"), nil) - pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskC).Return(job.ResourceURN("table-C"), nil) - pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return([]job.ResourceURN{"table-C", "table-Z"}, nil) - pluginService.On("GenerateUpstreams", ctx, detailedTenant, specB, true).Return([]job.ResourceURN{"table-A"}, nil) - pluginService.On("GenerateUpstreams", ctx, detailedTenant, specC, true).Return([]job.ResourceURN{"table-B"}, nil) + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specAUpdated, true).Return([]job.ResourceURN{"table-C", "table-Z"}, nil) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - jobService := service.NewJobService(repo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.Validate(ctx, sampleTenant, specs, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) + err := jobService.Validate(ctx, sampleTenant, []*job.Spec{specAUpdated, specB, specC}, jobNamesWithInvalidSpec, logWriter) assert.Error(t, err) assert.ErrorContains(t, err, "a cycle dependency encountered in the tree:") }) @@ -1964,8 +3137,14 @@ func TestJobService(t *testing.T) { upstreamResolver := new(UpstreamResolver) defer upstreamResolver.AssertExpectations(t) - repo := new(JobRepository) - defer repo.AssertExpectations(t) + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) @@ -1980,26 +3159,27 @@ func TestJobService(t *testing.T) { upstreamsSpecA, _ := job.NewSpecUpstreamBuilder().WithUpstreamNames([]job.SpecUpstreamName{"test-proj/job-C"}).Build() upstreamsSpecC, _ := job.NewSpecUpstreamBuilder().WithUpstreamNames([]job.SpecUpstreamName{"test-proj/job-B"}).Build() specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTaskA).WithSpecUpstream(upstreamsSpecA).Build() + specAUpdated, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner-updated", jobSchedule, jobWindow, jobTaskA).WithSpecUpstream(upstreamsSpecA).Build() specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTaskB).Build() + specBUpdated, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner-updated", jobSchedule, jobWindow, jobTaskB).Build() specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTaskC).WithSpecUpstream(upstreamsSpecC).Build() - specs := []*job.Spec{specA, specB, specC} jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-Z"}) jobB := job.NewJob(sampleTenant, specB, "table-B", []job.ResourceURN{"table-A"}) - repo.On("GetAllByProjectName", ctx, sampleTenant.ProjectName()).Return([]*job.Job{jobA, jobB}, nil) + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return([]*job.Job{jobA, jobB}, nil) pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskA).Return(job.ResourceURN("table-A"), nil) pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskB).Return(job.ResourceURN("table-B"), nil) pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskC).Return(job.ResourceURN(""), service.ErrUpstreamModNotFound) - pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return([]job.ResourceURN{"table-Z"}, nil) - pluginService.On("GenerateUpstreams", ctx, detailedTenant, specB, true).Return([]job.ResourceURN{"table-A"}, nil) + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specAUpdated, true).Return([]job.ResourceURN{"table-Z"}, nil) + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specBUpdated, true).Return([]job.ResourceURN{"table-A"}, nil) pluginService.On("GenerateUpstreams", ctx, detailedTenant, specC, true).Return(nil, service.ErrUpstreamModNotFound) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - jobService := service.NewJobService(repo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.Validate(ctx, sampleTenant, specs, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) + err := jobService.Validate(ctx, sampleTenant, []*job.Spec{specAUpdated, specBUpdated, specC}, jobNamesWithInvalidSpec, logWriter) assert.Error(t, err) assert.ErrorContains(t, err, "a cycle dependency encountered in the tree:") }) @@ -2014,8 +3194,14 @@ func TestJobService(t *testing.T) { upstreamResolver := new(UpstreamResolver) defer upstreamResolver.AssertExpectations(t) - repo := new(JobRepository) - defer repo.AssertExpectations(t) + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) @@ -2029,15 +3215,15 @@ func TestJobService(t *testing.T) { specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTaskPython).WithSpecUpstream(upstreamsSpecC).Build() specs := []*job.Spec{specA, specB, specC} - repo.On("GetAllByProjectName", ctx, sampleTenant.ProjectName()).Return([]*job.Job{}, nil) + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return([]*job.Job{}, nil) pluginService.On("GenerateDestination", ctx, detailedTenant, mock.Anything).Return(job.ResourceURN(""), service.ErrUpstreamModNotFound) pluginService.On("GenerateUpstreams", ctx, detailedTenant, mock.Anything, true).Return(nil, service.ErrUpstreamModNotFound) logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) - jobService := service.NewJobService(repo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.Validate(ctx, sampleTenant, specs, logWriter) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) + err := jobService.Validate(ctx, sampleTenant, specs, jobNamesWithInvalidSpec, logWriter) assert.Error(t, err) assert.ErrorContains(t, err, "a cycle dependency encountered in the tree:") }) @@ -2052,8 +3238,14 @@ func TestJobService(t *testing.T) { upstreamResolver := new(UpstreamResolver) defer upstreamResolver.AssertExpectations(t) - repo := new(JobRepository) - defer repo.AssertExpectations(t) + jobRepo := new(JobRepository) + defer jobRepo.AssertExpectations(t) + + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) logWriter := new(mockWriter) defer logWriter.AssertExpectations(t) @@ -2066,27 +3258,25 @@ func TestJobService(t *testing.T) { jobTaskC := job.NewTask(taskName, jobTaskConfigC) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTaskA).Build() + specAUpdated, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner-updated", jobSchedule, jobWindow, jobTaskA).Build() specB, _ := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTaskB).Build() specC, _ := job.NewSpecBuilder(jobVersion, "job-C", "sample-owner", jobSchedule, jobWindow, jobTaskC).Build() - specs := []*job.Spec{specA, specB, specC} + specs := []*job.Spec{specAUpdated, specB} jobA := job.NewJob(sampleTenant, specA, "table-A", []job.ResourceURN{"table-Z"}) jobB := job.NewJob(sampleTenant, specB, "table-B", []job.ResourceURN{"table-A"}) jobC := job.NewJob(sampleTenant, specC, "table-C", []job.ResourceURN{"table-B"}) - repo.On("GetAllByProjectName", ctx, sampleTenant.ProjectName()).Return([]*job.Job{jobA, jobB, jobC}, nil) + jobRepo.On("GetAllByTenant", ctx, sampleTenant).Return([]*job.Job{jobA, jobB, jobC}, nil) pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskA).Return(job.ResourceURN("table-A"), nil) - pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskB).Return(job.ResourceURN("table-B"), nil) - pluginService.On("GenerateDestination", ctx, detailedTenant, jobTaskC).Return(job.ResourceURN("table-C"), nil) - pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return([]job.ResourceURN{"table-Z"}, nil) - pluginService.On("GenerateUpstreams", ctx, detailedTenant, specB, true).Return([]job.ResourceURN{"table-A"}, nil) - pluginService.On("GenerateUpstreams", ctx, detailedTenant, specC, true).Return([]job.ResourceURN{"table-B"}, nil) + pluginService.On("GenerateUpstreams", ctx, detailedTenant, specAUpdated, true).Return([]job.ResourceURN{"table-Z"}, nil) - logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specC.Name()).Return([]*job.Downstream{}, nil) - jobService := service.NewJobService(repo, pluginService, upstreamResolver, tenantDetailsGetter, log) - err := jobService.Validate(ctx, sampleTenant, specs, logWriter) + logWriter.On("Write", mock.Anything, mock.Anything).Return(nil) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) + err := jobService.Validate(ctx, sampleTenant, specs, jobNamesWithInvalidSpec, logWriter) assert.NoError(t, err) }) }) @@ -2096,6 +3286,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2110,9 +3306,9 @@ func TestJobService(t *testing.T) { upstreamB := job.NewUpstreamResolved("job-B", "", "resource-B", sampleTenant, "inferred", taskName, false) - jobRepo.On("GetUpstreams", ctx, project.Name(), jobA.Spec().Name()).Return([]*job.Upstream{upstreamB}, nil) + upstreamRepo.On("GetUpstreams", ctx, project.Name(), jobA.Spec().Name()).Return([]*job.Upstream{upstreamB}, nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, err := jobService.GetUpstreamsToInspect(ctx, jobA, false) assert.NoError(t, err) assert.EqualValues(t, []*job.Upstream{upstreamB}, result) @@ -2121,6 +3317,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2140,7 +3342,7 @@ func TestJobService(t *testing.T) { upstreamResolver.On("Resolve", ctx, jobA, mock.Anything).Return([]*job.Upstream{upstreamB}, nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, err := jobService.GetUpstreamsToInspect(ctx, jobA, true) assert.NoError(t, err) assert.EqualValues(t, []*job.Upstream{upstreamB}, result) @@ -2152,6 +3354,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2175,7 +3383,7 @@ func TestJobService(t *testing.T) { jobA := job.NewJob(sampleTenant, specA, jobADestination, jobASources) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, logger := jobService.GetJobBasicInfo(ctx, sampleTenant, "", specA) assert.Nil(t, logger.Messages) assert.Equal(t, jobA, result) @@ -2184,6 +3392,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2201,7 +3415,7 @@ func TestJobService(t *testing.T) { jobRepo.On("GetByJobName", ctx, project.Name(), specA.Name()).Return(jobA, nil) jobRepo.On("GetAllByResourceDestination", ctx, jobADestination).Return([]*job.Job{}, nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, logger := jobService.GetJobBasicInfo(ctx, sampleTenant, specA.Name(), nil) assert.Nil(t, logger.Messages) assert.Equal(t, jobA, result) @@ -2210,6 +3424,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2223,7 +3443,7 @@ func TestJobService(t *testing.T) { tenantDetailsGetter.On("GetDetails", ctx, sampleTenant).Return(detailedTenant, errors.New("sample error")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, logger := jobService.GetJobBasicInfo(ctx, sampleTenant, "", specA) assert.Contains(t, logger.Messages[0].Message, "sample error") assert.Nil(t, result) @@ -2232,6 +3452,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2251,7 +3477,7 @@ func TestJobService(t *testing.T) { jobAUpstreamName := []job.ResourceURN{"job-B"} pluginService.On("GenerateUpstreams", ctx, detailedTenant, specA, true).Return(jobAUpstreamName, errors.New("sample error")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, logger := jobService.GetJobBasicInfo(ctx, sampleTenant, "", specA) assert.Contains(t, logger.Messages[0].Message, "sample error") assert.Nil(t, result) @@ -2260,6 +3486,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2269,7 +3501,7 @@ func TestJobService(t *testing.T) { tenantDetailsGetter := new(TenantDetailsGetter) defer tenantDetailsGetter.AssertExpectations(t) - specASchedule, err := job.NewScheduleBuilder(startDate).WithCatchUp(true).Build() + specASchedule, err := job.NewScheduleBuilder(startDate).Build() assert.NoError(t, err) specA, _ := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", specASchedule, jobWindow, jobTask).Build() @@ -2279,17 +3511,22 @@ func TestJobService(t *testing.T) { jobRepo.On("GetByJobName", ctx, project.Name(), specA.Name()).Return(jobA, nil) jobRepo.On("GetAllByResourceDestination", ctx, jobADestination).Return([]*job.Job{}, errors.New("sample-error")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, logger := jobService.GetJobBasicInfo(ctx, sampleTenant, specA.Name(), nil) assert.Contains(t, logger.Messages[0].Message, "no job sources detected") - assert.Contains(t, logger.Messages[1].Message, "catchup is enabled") - assert.Contains(t, logger.Messages[2].Message, "could not perform duplicate job destination check") + assert.Contains(t, logger.Messages[1].Message, "could not perform duplicate job destination check") assert.Equal(t, jobA, result) }) t.Run("should return error if unable to get existing job", func(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2303,7 +3540,7 @@ func TestJobService(t *testing.T) { jobRepo.On("GetByJobName", ctx, project.Name(), specA.Name()).Return(nil, errors.New("internal error")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, logger := jobService.GetJobBasicInfo(ctx, sampleTenant, specA.Name(), nil) assert.Contains(t, logger.Messages[0].Message, "internal error") assert.Nil(t, result) @@ -2312,6 +3549,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2325,7 +3568,7 @@ func TestJobService(t *testing.T) { jobRepo.On("GetByJobName", ctx, project.Name(), specA.Name()).Return(nil, errors.New("job not found")) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, logger := jobService.GetJobBasicInfo(ctx, sampleTenant, specA.Name(), nil) assert.Contains(t, logger.Messages[0].Message, "job not found") assert.Nil(t, result) @@ -2334,6 +3577,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2356,7 +3605,7 @@ func TestJobService(t *testing.T) { jobRepo.On("GetByJobName", ctx, project.Name(), specA.Name()).Return(jobA, nil) jobRepo.On("GetAllByResourceDestination", ctx, jobADestination).Return([]*job.Job{jobB, jobA}, nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, logger := jobService.GetJobBasicInfo(ctx, sampleTenant, specA.Name(), nil) assert.Contains(t, logger.Messages[0].Message, "job already exists with same Destination") assert.Equal(t, jobA, result) @@ -2365,6 +3614,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2382,7 +3637,7 @@ func TestJobService(t *testing.T) { jobRepo.On("GetByJobName", ctx, project.Name(), specA.Name()).Return(jobA, nil) jobRepo.On("GetAllByResourceDestination", ctx, jobADestination).Return([]*job.Job{jobA}, nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, logger := jobService.GetJobBasicInfo(ctx, sampleTenant, specA.Name(), nil) assert.Nil(t, logger.Messages) assert.Equal(t, jobA, result) @@ -2394,6 +3649,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2409,9 +3670,9 @@ func TestJobService(t *testing.T) { jobADownstream := []*job.Downstream{ job.NewDownstream("job-B", project.Name(), namespace.Name(), taskName), } - jobRepo.On("GetDownstreamByDestination", ctx, project.Name(), jobA.Destination()).Return(jobADownstream, nil) + downstreamRepo.On("GetDownstreamByDestination", ctx, project.Name(), jobA.Destination()).Return(jobADownstream, nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, err := jobService.GetDownstream(ctx, jobA, true) assert.NoError(t, err) assert.Equal(t, jobADownstream, result) @@ -2420,6 +3681,12 @@ func TestJobService(t *testing.T) { jobRepo := new(JobRepository) defer jobRepo.AssertExpectations(t) + upstreamRepo := new(UpstreamRepository) + defer upstreamRepo.AssertExpectations(t) + + downstreamRepo := new(DownstreamRepository) + defer downstreamRepo.AssertExpectations(t) + pluginService := new(PluginService) defer pluginService.AssertExpectations(t) @@ -2435,14 +3702,60 @@ func TestJobService(t *testing.T) { jobADownstream := []*job.Downstream{ job.NewDownstream("job-B", project.Name(), namespace.Name(), taskName), } - jobRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(jobADownstream, nil) + downstreamRepo.On("GetDownstreamByJobName", ctx, project.Name(), specA.Name()).Return(jobADownstream, nil) - jobService := service.NewJobService(jobRepo, pluginService, upstreamResolver, tenantDetailsGetter, log) + jobService := service.NewJobService(jobRepo, upstreamRepo, downstreamRepo, pluginService, upstreamResolver, tenantDetailsGetter, nil, log, nil, nil) result, err := jobService.GetDownstream(ctx, jobA, false) assert.NoError(t, err) assert.Equal(t, jobADownstream, result) }) }) + t.Run("updateState", func(t *testing.T) { + jobName, _ := job.NameFrom("job-A") + jobsToUpdateState := []job.Name{jobName} + state := job.DISABLED + updateRemark := "job disable remark" + t.Run("should fail if scheduler state change request fails", func(t *testing.T) { + scheduler := new(mockScheduler) + scheduler.On("UpdateJobState", ctx, sampleTenant, jobsToUpdateState, state.String()).Return(fmt.Errorf("some error in update Job State")) + defer scheduler.AssertExpectations(t) + + jobService := service.NewJobService(nil, nil, nil, nil, nil, nil, nil, nil, nil, scheduler) + err := jobService.UpdateState(ctx, sampleTenant, jobsToUpdateState, state, "job disable remark") + assert.ErrorContains(t, err, "some error in update Job State") + }) + + t.Run("should fail if update state in job table fails", func(t *testing.T) { + scheduler := new(mockScheduler) + scheduler.On("UpdateJobState", ctx, sampleTenant, jobsToUpdateState, state.String()).Return(nil) + defer scheduler.AssertExpectations(t) + + jobRepo := new(JobRepository) + jobRepo.On("UpdateState", ctx, sampleTenant, jobsToUpdateState, state, updateRemark).Return(fmt.Errorf("some error in update Job State repo")) + defer jobRepo.AssertExpectations(t) + + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, nil, nil, nil, scheduler) + err := jobService.UpdateState(ctx, sampleTenant, jobsToUpdateState, state, updateRemark) + assert.ErrorContains(t, err, "some error in update Job State repo") + }) + + t.Run("should pass when no error in scheduler update and repo update", func(t *testing.T) { + scheduler := new(mockScheduler) + scheduler.On("UpdateJobState", ctx, sampleTenant, jobsToUpdateState, state.String()).Return(nil) + defer scheduler.AssertExpectations(t) + + jobRepo := new(JobRepository) + jobRepo.On("UpdateState", ctx, sampleTenant, jobsToUpdateState, state, updateRemark).Return(nil) + defer jobRepo.AssertExpectations(t) + + eventHandler := newEventHandler(t) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + + jobService := service.NewJobService(jobRepo, nil, nil, nil, nil, nil, eventHandler, nil, nil, scheduler) + err := jobService.UpdateState(ctx, sampleTenant, jobsToUpdateState, state, updateRemark) + assert.Nil(t, err) + }) + }) } // JobRepository is an autogenerated mock type for the JobRepository type @@ -2487,6 +3800,24 @@ func (_m *JobRepository) Delete(ctx context.Context, projectName tenant.ProjectN return r0 } +// ChangeJobNamespace provides a mock function with given fields: ctx, jobName, jobTenant, jobNewTenant +func (_m *JobRepository) ChangeJobNamespace(ctx context.Context, jobName job.Name, jobTenant, jobNewTenant tenant.Tenant) error { + ret := _m.Called(ctx, jobName, jobTenant, jobNewTenant) + return ret.Error(0) +} + +// UpdateState provides a mock function with given fields: ctx, jobName, jobTenant, jobNewTenant +func (_m *JobRepository) UpdateState(ctx context.Context, jobTenant tenant.Tenant, jobNames []job.Name, jobState job.State, remark string) error { + ret := _m.Called(ctx, jobTenant, jobNames, jobState, remark) + return ret.Error(0) +} + +// SyncState provides a mock function with given fields: ctx, jobTenant, disabledJobs, enabledJobs +func (_m *JobRepository) SyncState(ctx context.Context, jobTenant tenant.Tenant, disabledJobNames, enabledJobNames []job.Name) error { + ret := _m.Called(ctx, jobTenant, disabledJobNames, enabledJobNames) + return ret.Error(0) +} + // GetAllByProjectName provides a mock function with given fields: ctx, projectName func (_m *JobRepository) GetAllByProjectName(ctx context.Context, projectName tenant.ProjectName) ([]*job.Job, error) { ret := _m.Called(ctx, projectName) @@ -2579,9 +3910,36 @@ func (_m *JobRepository) GetByJobName(ctx context.Context, projectName tenant.Pr return r0, r1 } +// Update provides a mock function with given fields: _a0, _a1 +func (_m *JobRepository) Update(_a0 context.Context, _a1 []*job.Job) ([]*job.Job, error) { + ret := _m.Called(_a0, _a1) + + var r0 []*job.Job + if rf, ok := ret.Get(0).(func(context.Context, []*job.Job) []*job.Job); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*job.Job) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, []*job.Job) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +type DownstreamRepository struct { + mock.Mock +} + // GetDownstreamByDestination provides a mock function with given fields: ctx, projectName, destination -func (_m *JobRepository) GetDownstreamByDestination(ctx context.Context, projectName tenant.ProjectName, destination job.ResourceURN) ([]*job.Downstream, error) { - ret := _m.Called(ctx, projectName, destination) +func (_d *DownstreamRepository) GetDownstreamByDestination(ctx context.Context, projectName tenant.ProjectName, destination job.ResourceURN) ([]*job.Downstream, error) { + ret := _d.Called(ctx, projectName, destination) var r0 []*job.Downstream if rf, ok := ret.Get(0).(func(context.Context, tenant.ProjectName, job.ResourceURN) []*job.Downstream); ok { @@ -2603,8 +3961,8 @@ func (_m *JobRepository) GetDownstreamByDestination(ctx context.Context, project } // GetDownstreamByJobName provides a mock function with given fields: ctx, projectName, jobName -func (_m *JobRepository) GetDownstreamByJobName(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) ([]*job.Downstream, error) { - ret := _m.Called(ctx, projectName, jobName) +func (_d *DownstreamRepository) GetDownstreamByJobName(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) ([]*job.Downstream, error) { + ret := _d.Called(ctx, projectName, jobName) var r0 []*job.Downstream if rf, ok := ret.Get(0).(func(context.Context, tenant.ProjectName, job.Name) []*job.Downstream); ok { @@ -2625,9 +3983,36 @@ func (_m *JobRepository) GetDownstreamByJobName(ctx context.Context, projectName return r0, r1 } +// GetDownstreamBySources provides a mock function with given fields: ctx, sources +func (_d *DownstreamRepository) GetDownstreamBySources(ctx context.Context, sources []job.ResourceURN) ([]*job.Downstream, error) { + ret := _d.Called(ctx, sources) + + var r0 []*job.Downstream + if rf, ok := ret.Get(0).(func(context.Context, []job.ResourceURN) []*job.Downstream); ok { + r0 = rf(ctx, sources) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*job.Downstream) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, []job.ResourceURN) error); ok { + r1 = rf(ctx, sources) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +type UpstreamRepository struct { + mock.Mock +} + // GetJobNameWithInternalUpstreams provides a mock function with given fields: _a0, _a1, _a2 -func (_m *JobRepository) ResolveUpstreams(_a0 context.Context, _a1 tenant.ProjectName, _a2 []job.Name) (map[job.Name][]*job.Upstream, error) { - ret := _m.Called(_a0, _a1, _a2) +func (_u *UpstreamRepository) ResolveUpstreams(_a0 context.Context, _a1 tenant.ProjectName, _a2 []job.Name) (map[job.Name][]*job.Upstream, error) { + ret := _u.Called(_a0, _a1, _a2) var r0 map[job.Name][]*job.Upstream if rf, ok := ret.Get(0).(func(context.Context, tenant.ProjectName, []job.Name) map[job.Name][]*job.Upstream); ok { @@ -2649,8 +4034,8 @@ func (_m *JobRepository) ResolveUpstreams(_a0 context.Context, _a1 tenant.Projec } // GetUpstreams provides a mock function with given fields: ctx, projectName, jobName -func (_m *JobRepository) GetUpstreams(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) ([]*job.Upstream, error) { - ret := _m.Called(ctx, projectName, jobName) +func (_u *UpstreamRepository) GetUpstreams(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) ([]*job.Upstream, error) { + ret := _u.Called(ctx, projectName, jobName) var r0 []*job.Upstream if rf, ok := ret.Get(0).(func(context.Context, tenant.ProjectName, job.Name) []*job.Upstream); ok { @@ -2672,8 +4057,8 @@ func (_m *JobRepository) GetUpstreams(ctx context.Context, projectName tenant.Pr } // ReplaceUpstreams provides a mock function with given fields: _a0, _a1 -func (_m *JobRepository) ReplaceUpstreams(_a0 context.Context, _a1 []*job.WithUpstream) error { - ret := _m.Called(_a0, _a1) +func (_u *UpstreamRepository) ReplaceUpstreams(_a0 context.Context, _a1 []*job.WithUpstream) error { + ret := _u.Called(_a0, _a1) var r0 error if rf, ok := ret.Get(0).(func(context.Context, []*job.WithUpstream) error); ok { @@ -2685,29 +4070,6 @@ func (_m *JobRepository) ReplaceUpstreams(_a0 context.Context, _a1 []*job.WithUp return r0 } -// Update provides a mock function with given fields: _a0, _a1 -func (_m *JobRepository) Update(_a0 context.Context, _a1 []*job.Job) ([]*job.Job, error) { - ret := _m.Called(_a0, _a1) - - var r0 []*job.Job - if rf, ok := ret.Get(0).(func(context.Context, []*job.Job) []*job.Job); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*job.Job) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, []*job.Job) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - // PluginService is an autogenerated mock type for the PluginService type type PluginService struct { mock.Mock @@ -2866,3 +4228,53 @@ type mockWriter struct { func (m *mockWriter) Write(level writer.LogLevel, s string) error { return m.Called(level, s).Error(0) } + +type mockEventHandler struct { + mock.Mock +} + +func (m *mockEventHandler) HandleEvent(e moderator.Event) { + m.Called(e) +} + +type mockConstructorEventHandler interface { + mock.TestingT + Cleanup(func()) +} + +func newEventHandler(t mockConstructorEventHandler) *mockEventHandler { + mock := &mockEventHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// JobDeploymentService is an autogenerated mock type for the JobDeploymentService type +type JobDeploymentService struct { + mock.Mock +} + +// UploadJobs provides a mock function with given fields: ctx, jobTenant, toUpdate, toDelete +func (_m *JobDeploymentService) UploadJobs(ctx context.Context, jobTenant tenant.Tenant, toUpdate, toDelete []string) error { + ret := _m.Called(ctx, jobTenant, toUpdate, toDelete) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, tenant.Tenant, []string, []string) error); ok { + r0 = rf(ctx, jobTenant, toUpdate, toDelete) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +type mockScheduler struct { + mock.Mock +} + +func (ms *mockScheduler) UpdateJobState(ctx context.Context, tnnt tenant.Tenant, jobNames []job.Name, state string) error { + args := ms.Called(ctx, tnnt, jobNames, state) + return args.Error(0) +} diff --git a/core/job/service/plugin_service.go b/core/job/service/plugin_service.go index 5bc31836d0..082cd4bce4 100644 --- a/core/job/service/plugin_service.go +++ b/core/job/service/plugin_service.go @@ -5,13 +5,13 @@ import ( "fmt" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "golang.org/x/net/context" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/compiler" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/compiler" + "github.com/raystack/optimus/sdk/plugin" ) const ( @@ -55,10 +55,12 @@ func NewJobPluginService(pluginRepo PluginRepo, engine Engine, logger log.Logger func (p JobPluginService) Info(_ context.Context, taskName job.TaskName) (*plugin.Info, error) { taskPlugin, err := p.pluginRepo.GetByName(taskName.String()) if err != nil { + p.logger.Error("error getting plugin [%s]: %s", taskName.String(), err) return nil, err } if taskPlugin.YamlMod == nil { + p.logger.Error("task plugin yaml mod is not found") return nil, ErrYamlModNotExist } @@ -68,10 +70,12 @@ func (p JobPluginService) Info(_ context.Context, taskName job.TaskName) (*plugi func (p JobPluginService) GenerateDestination(ctx context.Context, tnnt *tenant.WithDetails, task job.Task) (job.ResourceURN, error) { taskPlugin, err := p.pluginRepo.GetByName(task.Name().String()) if err != nil { + p.logger.Error("error getting plugin [%s]: %s", task.Name().String(), err) return "", err } if taskPlugin.DependencyMod == nil { + p.logger.Error(ErrUpstreamModNotFound.Error()) return "", ErrUpstreamModNotFound } @@ -81,6 +85,7 @@ func (p JobPluginService) GenerateDestination(ctx context.Context, tnnt *tenant. Config: compiledConfig, }) if err != nil { + p.logger.Error("error generating destination: %s", err) return "", fmt.Errorf("failed to generate destination: %w", err) } @@ -90,16 +95,19 @@ func (p JobPluginService) GenerateDestination(ctx context.Context, tnnt *tenant. func (p JobPluginService) GenerateUpstreams(ctx context.Context, jobTenant *tenant.WithDetails, spec *job.Spec, dryRun bool) ([]job.ResourceURN, error) { taskPlugin, err := p.pluginRepo.GetByName(spec.Task().Name().String()) if err != nil { + p.logger.Error("error getting plugin [%s]: %s", spec.Task().Name().String(), err) return nil, err } if taskPlugin.DependencyMod == nil { + p.logger.Error(ErrUpstreamModNotFound.Error()) return nil, ErrUpstreamModNotFound } // TODO: this now will always be a same time for start of service, is it correct ? assets, err := p.compileAsset(ctx, taskPlugin, spec, p.now()) if err != nil { + p.logger.Error("error compiling asset: %s", err) return nil, fmt.Errorf("asset compilation failure: %w", err) } @@ -113,6 +121,7 @@ func (p JobPluginService) GenerateUpstreams(ctx context.Context, jobTenant *tena }, }) if err != nil { + p.logger.Error("error generating dependencies: %s", err) return nil, err } @@ -135,7 +144,7 @@ func (p JobPluginService) compileConfig(configs job.Config, tnnt *tenant.WithDet for key, val := range configs { compiledConf, err := p.engine.CompileString(val, tmplCtx) if err != nil { - p.logger.Warn("error in template compilation: ", err.Error()) + p.logger.Warn("template compilation encountered suppressed error: %s", err.Error()) compiledConf = val } pluginConfigs = append(pluginConfigs, plugin.Config{ @@ -161,6 +170,7 @@ func (p JobPluginService) compileAsset(ctx context.Context, taskPlugin *plugin.P }, }) if err != nil { + p.logger.Error("error generating destination: %s", err) return nil, err } jobDestination = jobDestinationResponse.Destination @@ -168,10 +178,12 @@ func (p JobPluginService) compileAsset(ctx context.Context, taskPlugin *plugin.P startTime, err := spec.Window().GetStartTime(scheduledAt) if err != nil { + p.logger.Error("error getting start time: %s", err) return nil, fmt.Errorf("error getting start time: %w", err) } endTime, err := spec.Window().GetEndTime(scheduledAt) if err != nil { + p.logger.Error("error getting end time: %s", err) return nil, fmt.Errorf("error getting end time: %w", err) } @@ -187,6 +199,7 @@ func (p JobPluginService) compileAsset(ctx context.Context, taskPlugin *plugin.P configKeyDestination: jobDestination, }) if err != nil { + p.logger.Error("error compiling asset: %s", err) return nil, fmt.Errorf("failed to compile templates: %w", err) } diff --git a/core/job/service/plugin_service_test.go b/core/job/service/plugin_service_test.go index db85fe7b50..2da1281a53 100644 --- a/core/job/service/plugin_service_test.go +++ b/core/job/service/plugin_service_test.go @@ -5,17 +5,17 @@ import ( "errors" "testing" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/job/service" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/compiler" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/sdk/plugin" - mockOpt "github.com/odpf/optimus/sdk/plugin/mock" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/job/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/compiler" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/sdk/plugin" + mockOpt "github.com/raystack/optimus/sdk/plugin/mock" ) func TestPluginService(t *testing.T) { @@ -52,13 +52,15 @@ func TestPluginService(t *testing.T) { assert.NoError(t, err) jobTask := job.NewTask("bq2bq", jobTaskConfig) + logger := log.NewLogrus() + t.Run("Info", func(t *testing.T) { t.Run("returns error when no plugin", func(t *testing.T) { pluginRepo := new(mockPluginRepo) pluginRepo.On("GetByName", jobTask.Name().String()).Return(nil, errors.New("some error when fetch plugin")) defer pluginRepo.AssertExpectations(t) - pluginService := service.NewJobPluginService(pluginRepo, nil, nil) + pluginService := service.NewJobPluginService(pluginRepo, nil, logger) result, err := pluginService.Info(ctx, jobTask.Name()) assert.Error(t, err) assert.Nil(t, result) @@ -77,7 +79,7 @@ func TestPluginService(t *testing.T) { newPlugin := &plugin.Plugin{DependencyMod: depMod} pluginRepo.On("GetByName", jobTask.Name().String()).Return(newPlugin, nil) - pluginService := service.NewJobPluginService(pluginRepo, nil, nil) + pluginService := service.NewJobPluginService(pluginRepo, nil, logger) result, err := pluginService.Info(ctx, jobTask.Name()) assert.Error(t, err) assert.Nil(t, result) @@ -103,7 +105,7 @@ func TestPluginService(t *testing.T) { }, nil) defer yamlMod.AssertExpectations(t) - pluginService := service.NewJobPluginService(pluginRepo, nil, nil) + pluginService := service.NewJobPluginService(pluginRepo, nil, logger) result, err := pluginService.Info(ctx, jobTask.Name()) assert.NoError(t, err) assert.NotNil(t, result) diff --git a/core/job/spec.go b/core/job/spec.go index 7396d51a10..fe6d3af686 100644 --- a/core/job/spec.go +++ b/core/job/spec.go @@ -5,12 +5,15 @@ import ( "strings" "time" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/models" ) -const DateLayout = "2006-01-02" +const ( + DateLayout = "2006-01-02" + maxJobNameLength = 125 +) type Spec struct { version int @@ -153,12 +156,58 @@ func (s Specs) ToNameAndSpecMap() map[Name]*Spec { return nameAndSpecMap } +func (s Specs) ToFullNameAndSpecMap(projectName tenant.ProjectName) map[FullName]*Spec { + fullnameAndSpecMap := make(map[FullName]*Spec, len(s)) + for _, spec := range s { + fullName := FullNameFrom(projectName, spec.Name()) + fullnameAndSpecMap[fullName] = spec + } + return fullnameAndSpecMap +} + +func (s Specs) Validate() error { + me := errors.NewMultiError("validate specs errors") + jobNameCount := s.getJobNameCount() + isJobNameVisited := map[Name]bool{} + for _, spec := range s { + if jobNameCount[spec.Name()] > 1 && !isJobNameVisited[spec.Name()] { + me.Append(fmt.Errorf("duplicate %s", spec.Name())) + } + isJobNameVisited[spec.Name()] = true + } + + return me.ToErr() +} + +func (s Specs) GetValid() []*Spec { + jobNameCount := s.getJobNameCount() + validSpecs := []*Spec{} + for _, spec := range s { + if jobNameCount[spec.Name()] == 1 { + validSpecs = append(validSpecs, spec) + } + } + + return validSpecs +} + +func (s Specs) getJobNameCount() map[Name]int { + jobNameCount := make(map[Name]int) + for _, spec := range s { + jobNameCount[spec.Name()]++ + } + return jobNameCount +} + type Name string func NameFrom(name string) (Name, error) { if name == "" { return "", errors.InvalidArgument(EntityJob, "name is empty") } + if len(name) > maxJobNameLength { + return "", errors.InvalidArgument(EntityJob, fmt.Sprintf("length of job name is %d, longer than the length allowed (%d)", len(name), maxJobNameLength)) + } return Name(name), nil } @@ -166,6 +215,31 @@ func (n Name) String() string { return string(n) } +type State string + +const ( + ENABLED State = "enabled" + DISABLED State = "disabled" +) + +func StateFrom(name string) (State, error) { + if name == "" { + return "", errors.InvalidArgument(EntityJob, "state is empty") + } + switch name { + case "JOB_STATE_ENABLED": + return ENABLED, nil + case "JOB_STATE_DISABLED": + return DISABLED, nil + default: + return "", errors.InvalidArgument(EntityJob, "invalid state") + } +} + +func (n State) String() string { + return string(n) +} + type ScheduleDate string func ScheduleDateFrom(date string) (ScheduleDate, error) { @@ -210,7 +284,6 @@ type Schedule struct { endDate ScheduleDate interval string dependsOnPast bool - catchUp bool retry *Retry } @@ -230,10 +303,6 @@ func (s Schedule) DependsOnPast() bool { return s.dependsOnPast } -func (s Schedule) CatchUp() bool { - return s.catchUp -} - func (s Schedule) Retry() *Retry { return s.retry } @@ -273,11 +342,6 @@ func (s *ScheduleBuilder) WithDependsOnPast(dependsOnPast bool) *ScheduleBuilder return s } -func (s *ScheduleBuilder) WithCatchUp(catchUp bool) *ScheduleBuilder { - s.schedule.catchUp = catchUp - return s -} - func (s *ScheduleBuilder) WithRetry(retry *Retry) *ScheduleBuilder { s.schedule.retry = retry return s @@ -500,7 +564,7 @@ func (s SpecHTTPUpstream) validate() error { me := errors.NewMultiError("errors on spec http upstream") me.Append(validateMap(s.headers)) me.Append(validateMap(s.params)) - return errors.MultiToError(me) + return me.ToErr() } type SpecHTTPUpstreamBuilder struct { @@ -581,7 +645,7 @@ func (s UpstreamSpec) validate() error { for _, u := range s.httpUpstreams { me.Append(u.validate()) } - return errors.MultiToError(me) + return me.ToErr() } type SpecUpstreamBuilder struct { diff --git a/core/job/spec_test.go b/core/job/spec_test.go index 9466d23e01..122bb5b895 100644 --- a/core/job/spec_test.go +++ b/core/job/spec_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/models" ) func TestEntitySpec(t *testing.T) { @@ -18,7 +18,6 @@ func TestEntitySpec(t *testing.T) { jobSchedule, _ := job.NewScheduleBuilder(startDate). WithEndDate(endDate). WithInterval("0 2 * * *"). - WithCatchUp(true). WithRetry(retry). WithDependsOnPast(false). Build() @@ -69,7 +68,6 @@ func TestEntitySpec(t *testing.T) { assert.Equal(t, jobSchedule.StartDate(), specA.Schedule().StartDate()) assert.Equal(t, jobSchedule.StartDate().String(), specA.Schedule().StartDate().String()) assert.Equal(t, jobSchedule.DependsOnPast(), specA.Schedule().DependsOnPast()) - assert.Equal(t, jobSchedule.CatchUp(), specA.Schedule().CatchUp()) assert.Equal(t, jobSchedule.Interval(), specA.Schedule().Interval()) assert.Equal(t, jobWindow, specA.Window()) @@ -135,6 +133,57 @@ func TestEntitySpec(t *testing.T) { assert.EqualValues(t, expectedMap, resultMap) }) + t.Run("ToFullNameAndSpecMap should return map with fullname key and spec value", func(t *testing.T) { + projectName := tenant.ProjectName("sample-project") + specA, err := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + + specB, err := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + + expectedMap := map[job.FullName]*job.Spec{ + "sample-project/job-A": specA, + "sample-project/job-B": specB, + } + + specs := job.Specs([]*job.Spec{specA, specB}) + resultMap := specs.ToFullNameAndSpecMap(projectName) + + assert.EqualValues(t, expectedMap, resultMap) + }) + + t.Run("Validate should return error for duplicate jobs", func(t *testing.T) { + specA1, err := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + + specA2, err := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + + specB, err := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + + specs := job.Specs([]*job.Spec{specA1, specA2, specB}) + err = specs.Validate() + + assert.ErrorContains(t, err, "duplicate job-A") + }) + t.Run("GetValid should return valid specs", func(t *testing.T) { + specA1, err := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + + specA2, err := job.NewSpecBuilder(jobVersion, "job-A", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + + specB, err := job.NewSpecBuilder(jobVersion, "job-B", "sample-owner", jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + + expectedValidSpecs := []*job.Spec{specB} + + specs := job.Specs([]*job.Spec{specA1, specA2, specB}) + actualValidSpecs := specs.GetValid() + + assert.EqualValues(t, expectedValidSpecs, actualValidSpecs) + }) }) t.Run("SpecUpstreamName", func(t *testing.T) { @@ -218,6 +267,11 @@ func TestEntitySpec(t *testing.T) { assert.ErrorContains(t, err, "name is empty") assert.Empty(t, name) }) + t.Run("should return error if name length is more than maximum allowed", func(t *testing.T) { + name, err := job.NameFrom("QEQFbm'mWufBaUrkccHlFeEDXHaFBOYFRAYGmjwuuTvEhkMekpHVocCBfpX'XBghyFiTTqbYQAseWcfJJsUAdbHRWoWGODoINrglgDsxJjwrmoYRIrGxMAifCGJUqD") + assert.ErrorContains(t, err, "length of job name is 126, longer than the length allowed (125)") + assert.Empty(t, name) + }) }) t.Run("ScheduleDateFrom", func(t *testing.T) { diff --git a/core/resource/backup.go b/core/resource/backup.go index a38fedc2ce..2fc290400f 100644 --- a/core/resource/backup.go +++ b/core/resource/backup.go @@ -5,8 +5,8 @@ import ( "github.com/google/uuid" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( diff --git a/core/resource/backup_test.go b/core/resource/backup_test.go index 932e8e14f0..8c8058a957 100644 --- a/core/resource/backup_test.go +++ b/core/resource/backup_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" ) func TestBackup(t *testing.T) { diff --git a/core/resource/handler/v1beta1/backup.go b/core/resource/handler/v1beta1/backup.go index 13314f8711..787c9e0f35 100644 --- a/core/resource/handler/v1beta1/backup.go +++ b/core/resource/handler/v1beta1/backup.go @@ -4,13 +4,13 @@ import ( "context" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type BackupService interface { @@ -29,21 +29,25 @@ type BackupHandler struct { func (b BackupHandler) CreateBackup(ctx context.Context, req *pb.CreateBackupRequest) (*pb.CreateBackupResponse, error) { tnnt, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) if err != nil { + b.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, errors.GRPCErr(err, "invalid backup request") } store, err := resource.FromStringToStore(req.GetDatastoreName()) if err != nil { + b.l.Error("invalid datastore name [%s]: %s", req.GetDatastoreName(), err) return nil, errors.GRPCErr(err, "invalid backup request") } backup, err := resource.NewBackup(store, tnnt, req.ResourceNames, req.Description, time.Now(), req.Config) if err != nil { + b.l.Error("error initializing backup: %s", err) return nil, errors.GRPCErr(err, "invalid backup request") } result, err := b.service.Create(ctx, backup) if err != nil { + b.l.Error("error creating backup: %s", err) return nil, errors.GRPCErr(err, "error during backup") } @@ -57,16 +61,19 @@ func (b BackupHandler) CreateBackup(ctx context.Context, req *pb.CreateBackupReq func (b BackupHandler) ListBackups(ctx context.Context, req *pb.ListBackupsRequest) (*pb.ListBackupsResponse, error) { tnnt, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) if err != nil { + b.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, errors.GRPCErr(err, "invalid list backup request") } store, err := resource.FromStringToStore(req.GetDatastoreName()) if err != nil { + b.l.Error("invalid datastore name [%s]: %s", req.GetDatastoreName(), err) return nil, errors.GRPCErr(err, "invalid list backup request") } results, err := b.service.List(ctx, tnnt, store) if err != nil { + b.l.Error("error listing backups: %s", err) return nil, errors.GRPCErr(err, "error in getting list of backup") } @@ -82,11 +89,13 @@ func (b BackupHandler) ListBackups(ctx context.Context, req *pb.ListBackupsReque func (b BackupHandler) GetBackup(ctx context.Context, req *pb.GetBackupRequest) (*pb.GetBackupResponse, error) { backupID, err := resource.BackupIDFrom(req.GetId()) if err != nil { + b.l.Error("cannot adapt backup id [%s]: %s", req.GetId(), err) return nil, errors.GRPCErr(err, "invalid get backup request") } backupDetail, err := b.service.Get(ctx, backupID) if err != nil { + b.l.Error("error getting backup [%s]: %s", req.GetId(), err) return nil, errors.GRPCErr(err, "invalid get backup request for "+backupID.UUID().String()) } diff --git a/core/resource/handler/v1beta1/backup_test.go b/core/resource/handler/v1beta1/backup_test.go index 76d7e69a37..f955a99543 100644 --- a/core/resource/handler/v1beta1/backup_test.go +++ b/core/resource/handler/v1beta1/backup_test.go @@ -7,14 +7,14 @@ import ( "time" "github.com/google/uuid" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/resource/handler/v1beta1" - "github.com/odpf/optimus/core/tenant" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/resource/handler/v1beta1" + "github.com/raystack/optimus/core/tenant" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) func TestBackupHandler(t *testing.T) { diff --git a/core/resource/handler/v1beta1/resource.go b/core/resource/handler/v1beta1/resource.go index be37c85cee..2cb65e2caf 100644 --- a/core/resource/handler/v1beta1/resource.go +++ b/core/resource/handler/v1beta1/resource.go @@ -7,39 +7,30 @@ import ( "strings" "time" - "github.com/odpf/salt/log" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/raystack/salt/log" "google.golang.org/protobuf/types/known/structpb" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/writer" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/telemetry" + "github.com/raystack/optimus/internal/writer" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) -var ( - totalSkippedBatchUpdateGauge = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "resources_batch_update_skipped_total", - Help: "The total number of skipped resources in batch update", - }) - totalSuccessBatchUpdateGauge = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "resources_batch_update_success_total", - Help: "The total number of failure resources in batch update", - }) - totalFailureBatchUpdateGauge = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "resources_batch_update_failure_total", - Help: "The total number of failure resources in batch update", - }) +const ( + metricResourceEvents = "resource_events_total" + metricResourcesUploadAllDuration = "resource_upload_all_duration_seconds_total" ) type ResourceService interface { Create(ctx context.Context, res *resource.Resource) error - Update(ctx context.Context, res *resource.Resource) error + Update(ctx context.Context, res *resource.Resource, logWriter writer.LogWriter) error + ChangeNamespace(ctx context.Context, datastore resource.Store, resourceFullName string, oldTenant, newTenant tenant.Tenant) error Get(ctx context.Context, tnnt tenant.Tenant, store resource.Store, resourceName string) (*resource.Resource, error) GetAll(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Resource, error) - Deploy(ctx context.Context, tnnt tenant.Tenant, store resource.Store, resources []*resource.Resource) error + Deploy(ctx context.Context, tnnt tenant.Tenant, store resource.Store, resources []*resource.Resource, logWriter writer.LogWriter) error + SyncResources(ctx context.Context, tnnt tenant.Tenant, store resource.Store, names []string) (*resource.SyncResponse, error) } type ResourceHandler struct { @@ -50,7 +41,6 @@ type ResourceHandler struct { } func (rh ResourceHandler) DeployResourceSpecification(stream pb.ResourceService_DeployResourceSpecificationServer) error { - startTime := time.Now() responseWriter := writer.NewDeployResourceSpecificationResponseWriter(stream) var errNamespaces []string @@ -60,12 +50,16 @@ func (rh ResourceHandler) DeployResourceSpecification(stream pb.ResourceService_ if errors.Is(err, io.EOF) { break } + errMsg := fmt.Sprintf("error encountered when receiving stream request: %s", err) + rh.l.Error(errMsg) + responseWriter.Write(writer.LogLevelError, errMsg) return err } + startTime := time.Now() tnnt, err := tenant.NewTenant(request.GetProjectName(), request.GetNamespaceName()) if err != nil { - errMsg := fmt.Sprintf("invalid deploy request for %s: %s", request.GetNamespaceName(), err.Error()) + errMsg := fmt.Sprintf("invalid tenant information request project [%s] namespace [%s]: %s", request.GetProjectName(), request.GetNamespaceName(), err) rh.l.Error(errMsg) responseWriter.Write(writer.LogLevelError, errMsg) errNamespaces = append(errNamespaces, request.NamespaceName) @@ -74,7 +68,7 @@ func (rh ResourceHandler) DeployResourceSpecification(stream pb.ResourceService_ store, err := resource.FromStringToStore(request.GetDatastoreName()) if err != nil { - errMsg := fmt.Sprintf("invalid store name for %s: %s", request.GetDatastoreName(), err.Error()) + errMsg := fmt.Sprintf("invalid store name [%s]: %s", request.GetDatastoreName(), err) rh.l.Error(errMsg) responseWriter.Write(writer.LogLevelError, errMsg) errNamespaces = append(errNamespaces, request.NamespaceName) @@ -85,7 +79,7 @@ func (rh ResourceHandler) DeployResourceSpecification(stream pb.ResourceService_ for _, resourceProto := range request.GetResources() { adapted, err := fromResourceProto(resourceProto, tnnt, store) if err != nil { - errMsg := fmt.Sprintf("%s: cannot adapt resource %s", err.Error(), resourceProto.GetName()) + errMsg := fmt.Sprintf("error adapting resource [%s]: %s", resourceProto.GetName(), err) rh.l.Error(errMsg) responseWriter.Write(writer.LogLevelError, errMsg) continue @@ -96,7 +90,7 @@ func (rh ResourceHandler) DeployResourceSpecification(stream pb.ResourceService_ errNamespaces = append(errNamespaces, request.GetNamespaceName()) } - err = rh.service.Deploy(stream.Context(), tnnt, store, resourceSpecs) + err = rh.service.Deploy(stream.Context(), tnnt, store, resourceSpecs, responseWriter) successResources := getResourcesByStatuses(resourceSpecs, resource.StatusSuccess) skippedResources := getResourcesByStatuses(resourceSpecs, resource.StatusSkipped) failureResources := getResourcesByStatuses(resourceSpecs, resource.StatusCreateFailure, resource.StatusUpdateFailure, resource.StatusValidationFailure) @@ -120,17 +114,23 @@ func (rh ResourceHandler) DeployResourceSpecification(stream pb.ResourceService_ continue } - successMsg := fmt.Sprintf("resources with namespace [%s] are deployed successfully", request.GetNamespaceName()) + successMsg := fmt.Sprintf("[%d] resources with namespace [%s] are deployed successfully", len(resourceSpecs), request.GetNamespaceName()) responseWriter.Write(writer.LogLevelInfo, successMsg) - totalSuccessBatchUpdateGauge.Set(float64(len(successResources))) - totalSkippedBatchUpdateGauge.Set(float64(len(skippedResources))) - totalFailureBatchUpdateGauge.Set(float64(len(failureResources))) + for _, resourceSpec := range resourceSpecs { + raiseResourceDatastoreEventMetric(tnnt, resourceSpec.Store().String(), resourceSpec.Kind(), resourceSpec.Status().String()) + } + + processDuration := time.Since(startTime) + telemetry.NewGauge(metricResourcesUploadAllDuration, map[string]string{ + "project": tnnt.ProjectName().String(), + "namespace": tnnt.NamespaceName().String(), + }).Add(processDuration.Seconds()) } - rh.l.Info("Finished resource deployment in %v", time.Since(startTime)) + if len(errNamespaces) > 0 { namespacesWithError := strings.Join(errNamespaces, ", ") - rh.l.Error("Error while deploying namespaces: [%s]", namespacesWithError) + rh.l.Error("error when deploying namespaces: [%s]", namespacesWithError) return fmt.Errorf("error when deploying: [%s]", namespacesWithError) } return nil @@ -139,16 +139,19 @@ func (rh ResourceHandler) DeployResourceSpecification(stream pb.ResourceService_ func (rh ResourceHandler) ListResourceSpecification(ctx context.Context, req *pb.ListResourceSpecificationRequest) (*pb.ListResourceSpecificationResponse, error) { store, err := resource.FromStringToStore(req.GetDatastoreName()) if err != nil { + rh.l.Error("invalid store name [%s]: %s", req.GetDatastoreName(), err) return nil, errors.GRPCErr(err, "invalid list resource request") } tnnt, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) if err != nil { + rh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, errors.GRPCErr(err, "failed to list resource for "+req.GetDatastoreName()) } resources, err := rh.service.GetAll(ctx, tnnt, store) if err != nil { + rh.l.Error("error getting all resources: %s", err) return nil, errors.GRPCErr(err, "failed to list resource for "+req.GetDatastoreName()) } @@ -156,6 +159,7 @@ func (rh ResourceHandler) ListResourceSpecification(ctx context.Context, req *pb for _, resourceSpec := range resources { resourceProto, err := toResourceProto(resourceSpec) if err != nil { + rh.l.Error("error adapting resource [%s]: %s", resourceSpec.FullName(), err) return nil, errors.GRPCErr(err, "failed to parse resource "+resourceSpec.FullName()) } resourceProtos = append(resourceProtos, resourceProto) @@ -169,48 +173,59 @@ func (rh ResourceHandler) ListResourceSpecification(ctx context.Context, req *pb func (rh ResourceHandler) CreateResource(ctx context.Context, req *pb.CreateResourceRequest) (*pb.CreateResourceResponse, error) { tnnt, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) if err != nil { + rh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, errors.GRPCErr(err, "failed to create resource") } store, err := resource.FromStringToStore(req.GetDatastoreName()) if err != nil { + rh.l.Error("invalid datastore name [%s]: %s", req.GetDatastoreName(), err) return nil, errors.GRPCErr(err, "invalid create resource request") } res, err := fromResourceProto(req.Resource, tnnt, store) if err != nil { + rh.l.Error("error adapting resource [%s]: %s", req.GetResource().GetName(), err) return nil, errors.GRPCErr(err, "failed to create resource") } err = rh.service.Create(ctx, res) + raiseResourceDatastoreEventMetric(tnnt, res.Store().String(), res.Kind(), res.Status().String()) if err != nil { + rh.l.Error("error creating resource [%s]: %s", res.FullName(), err) return nil, errors.GRPCErr(err, "failed to create resource "+res.FullName()) } + return &pb.CreateResourceResponse{}, nil } func (rh ResourceHandler) ReadResource(ctx context.Context, req *pb.ReadResourceRequest) (*pb.ReadResourceResponse, error) { if req.GetResourceName() == "" { + rh.l.Error("resource name is empty") return nil, errors.GRPCErr(errors.InvalidArgument(resource.EntityResource, "empty resource name"), "invalid read resource request") } store, err := resource.FromStringToStore(req.GetDatastoreName()) if err != nil { + rh.l.Error("invalid datastore name [%s]: %s", req.GetDatastoreName(), err) return nil, errors.GRPCErr(err, "invalid read resource request") } tnnt, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) if err != nil { + rh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, errors.GRPCErr(err, "failed to read resource "+req.GetResourceName()) } response, err := rh.service.Get(ctx, tnnt, store, req.GetResourceName()) if err != nil { + rh.l.Error("error getting resource [%s]: %s", req.GetResourceName(), err) return nil, errors.GRPCErr(err, "failed to read resource "+req.GetResourceName()) } protoResource, err := toResourceProto(response) if err != nil { + rh.l.Error("error adapting resource [%s]: %s", req.GetResourceName(), err) return nil, errors.GRPCErr(err, "failed to read resource "+req.GetResourceName()) } @@ -222,26 +237,101 @@ func (rh ResourceHandler) ReadResource(ctx context.Context, req *pb.ReadResource func (rh ResourceHandler) UpdateResource(ctx context.Context, req *pb.UpdateResourceRequest) (*pb.UpdateResourceResponse, error) { tnnt, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) if err != nil { + rh.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, errors.GRPCErr(err, "failed to update resource") } store, err := resource.FromStringToStore(req.GetDatastoreName()) if err != nil { + rh.l.Error("invalid datastore name [%s]: %s", req.GetDatastoreName(), err) return nil, errors.GRPCErr(err, "invalid update resource request") } res, err := fromResourceProto(req.Resource, tnnt, store) if err != nil { + rh.l.Error("error adapting resource [%s]: %s", req.GetResource().GetName(), err) return nil, errors.GRPCErr(err, "failed to update resource") } - err = rh.service.Update(ctx, res) + logWriter := writer.NewLogWriter(rh.l) + + err = rh.service.Update(ctx, res, logWriter) + raiseResourceDatastoreEventMetric(tnnt, res.Store().String(), res.Kind(), res.Status().String()) if err != nil { + rh.l.Error("error updating resource [%s]: %s", res.FullName(), err) return nil, errors.GRPCErr(err, "failed to update resource "+res.FullName()) } + return &pb.UpdateResourceResponse{}, nil } +func (rh ResourceHandler) ChangeResourceNamespace(ctx context.Context, req *pb.ChangeResourceNamespaceRequest) (*pb.ChangeResourceNamespaceResponse, error) { + tnnt, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) + if err != nil { + return nil, errors.GRPCErr(err, "failed to adapt to existing tenant details") + } + + newTnnt, err := tenant.NewTenant(req.GetProjectName(), req.GetNewNamespaceName()) + if err != nil { + return nil, errors.GRPCErr(err, "failed to adapt to new tenant") + } + + store, err := resource.FromStringToStore(req.GetDatastoreName()) + if err != nil { + return nil, errors.GRPCErr(err, "invalid Datastore Name") + } + + err = rh.service.ChangeNamespace(ctx, store, req.GetResourceName(), tnnt, newTnnt) + if err != nil { + return nil, errors.GRPCErr(err, "failed to update resource "+req.GetResourceName()) + } + + telemetry.NewCounter("resource_namespace_migrations_total", map[string]string{ + "project": tnnt.ProjectName().String(), + "namespace_source": tnnt.NamespaceName().String(), + "namespace_destination": newTnnt.NamespaceName().String(), + }).Inc() + + return &pb.ChangeResourceNamespaceResponse{}, nil +} + +func (rh ResourceHandler) ApplyResources(ctx context.Context, req *pb.ApplyResourcesRequest) (*pb.ApplyResourcesResponse, error) { + tnnt, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) + if err != nil { + return nil, errors.GRPCErr(err, "invalid tenant details") + } + + store, err := resource.FromStringToStore(req.GetDatastoreName()) + if err != nil { + return nil, errors.GRPCErr(err, "invalid datastore Name") + } + + if len(req.ResourceNames) == 0 { + return nil, errors.GRPCErr(errors.InvalidArgument(resource.EntityResource, "empty resource names"), "unable to apply resources") + } + + statuses, err := rh.service.SyncResources(ctx, tnnt, store, req.ResourceNames) + if err != nil { + return nil, errors.GRPCErr(err, "unable to sync to datastore") + } + + var respStatuses []*pb.ApplyResourcesResponse_ResourceStatus + for _, r := range statuses.ResourceNames { + respStatuses = append(respStatuses, &pb.ApplyResourcesResponse_ResourceStatus{ + ResourceName: r, + Status: "success", + }) + } + for _, r := range statuses.IgnoredResources { + respStatuses = append(respStatuses, &pb.ApplyResourcesResponse_ResourceStatus{ + ResourceName: r.Name, + Status: "failure", + Reason: r.Reason, + }) + } + return &pb.ApplyResourcesResponse{Statuses: respStatuses}, nil +} + func writeError(logWriter writer.LogWriter, err error) { if err == nil { return @@ -331,6 +421,16 @@ func toResourceProto(res *resource.Resource) (*pb.ResourceSpecification, error) }, nil } +func raiseResourceDatastoreEventMetric(jobTenant tenant.Tenant, datastoreName, resourceKind, state string) { + telemetry.NewCounter(metricResourceEvents, map[string]string{ + "project": jobTenant.ProjectName().String(), + "namespace": jobTenant.NamespaceName().String(), + "datastore": datastoreName, + "type": resourceKind, + "status": state, + }).Inc() +} + func NewResourceHandler(l log.Logger, resourceService ResourceService) *ResourceHandler { return &ResourceHandler{ l: l, diff --git a/core/resource/handler/v1beta1/resource_test.go b/core/resource/handler/v1beta1/resource_test.go index 99ff738089..69afb75abc 100644 --- a/core/resource/handler/v1beta1/resource_test.go +++ b/core/resource/handler/v1beta1/resource_test.go @@ -6,16 +6,17 @@ import ( "io" "testing" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc/metadata" "google.golang.org/protobuf/types/known/structpb" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/resource/handler/v1beta1" - "github.com/odpf/optimus/core/tenant" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/resource/handler/v1beta1" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/writer" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) func TestResourceHandler(t *testing.T) { @@ -31,6 +32,7 @@ func TestResourceHandler(t *testing.T) { stream := new(resourceStreamMock) stream.On("Context").Return(ctx) stream.On("Recv").Return(nil, errors.New("req timeout")).Once() + stream.On("Send", mock.Anything).Return(nil) err := handler.DeployResourceSpecification(stream) assert.NotNil(t, err) @@ -48,7 +50,7 @@ func TestResourceHandler(t *testing.T) { } argMatcher := mock.MatchedBy(func(req *pb.DeployResourceSpecificationResponse) bool { - return req.LogStatus.Message == "invalid deploy request for ns: invalid argument for entity project: project name is empty" + return req.LogStatus.Message == "invalid tenant information request project [] namespace [ns]: invalid argument for entity project: project name is empty" }) stream := new(resourceStreamMock) stream.On("Context").Return(ctx) @@ -72,7 +74,7 @@ func TestResourceHandler(t *testing.T) { } argMatcher := mock.MatchedBy(func(req *pb.DeployResourceSpecificationResponse) bool { - return req.LogStatus.Message == "invalid store name for unknown: invalid argument for entity resource: unknown store unknown" + return req.LogStatus.Message == "invalid store name [unknown]: invalid argument for entity resource: unknown store unknown" }) stream := new(resourceStreamMock) stream.On("Context").Return(ctx) @@ -86,8 +88,7 @@ func TestResourceHandler(t *testing.T) { }) t.Run("returns error log when conversion fails", func(t *testing.T) { service := new(resourceService) - service.On("Deploy", ctx, mock.Anything, resource.Bigquery, mock.Anything). - Return(nil) + service.On("Deploy", ctx, mock.Anything, resource.Bigquery, mock.Anything, mock.Anything).Return(nil) defer service.AssertExpectations(t) handler := v1beta1.NewResourceHandler(logger, service) @@ -186,7 +187,7 @@ func TestResourceHandler(t *testing.T) { } argMatcher := mock.MatchedBy(func(req *pb.DeployResourceSpecificationResponse) bool { - return req.LogStatus.Message == "resources with namespace [ns] are deployed successfully" + return req.LogStatus.Message == "[1] resources with namespace [ns] are deployed successfully" }) stream := new(resourceStreamMock) stream.On("Context").Return(ctx) @@ -665,7 +666,7 @@ func TestResourceHandler(t *testing.T) { }) t.Run("returns error when service returns error", func(t *testing.T) { service := new(resourceService) - service.On("Update", ctx, mock.Anything).Return(errors.New("validation failure")) + service.On("Update", ctx, mock.Anything, mock.Anything).Return(errors.New("validation failure")) defer service.AssertExpectations(t) handler := v1beta1.NewResourceHandler(logger, service) @@ -690,7 +691,7 @@ func TestResourceHandler(t *testing.T) { }) t.Run("updates the resource successfully", func(t *testing.T) { service := new(resourceService) - service.On("Update", ctx, mock.Anything).Return(nil) + service.On("Update", ctx, mock.Anything, mock.Anything).Return(nil) defer service.AssertExpectations(t) handler := v1beta1.NewResourceHandler(logger, service) @@ -712,6 +713,100 @@ func TestResourceHandler(t *testing.T) { assert.Nil(t, err) }) }) + t.Run("ApplyResource", func(t *testing.T) { + t.Run("returns error when tenant is invalid", func(t *testing.T) { + service := new(resourceService) + handler := v1beta1.NewResourceHandler(logger, service) + + req := &pb.ApplyResourcesRequest{ + ProjectName: "", + DatastoreName: "bigquery", + ResourceNames: nil, + NamespaceName: "", + } + + _, err := handler.ApplyResources(ctx, req) + assert.NotNil(t, err) + assert.EqualError(t, err, "rpc error: code = InvalidArgument desc = invalid argument for entity "+ + "project: project name is empty: invalid tenant details") + }) + t.Run("returns error when store is invalid", func(t *testing.T) { + service := new(resourceService) + handler := v1beta1.NewResourceHandler(logger, service) + + req := &pb.ApplyResourcesRequest{ + ProjectName: "proj", + DatastoreName: "", + ResourceNames: nil, + NamespaceName: "ns", + } + + _, err := handler.ApplyResources(ctx, req) + assert.NotNil(t, err) + assert.EqualError(t, err, "rpc error: code = InvalidArgument desc = invalid argument for entity "+ + "resource: unknown store : invalid datastore Name") + }) + t.Run("returns error when resource names are empty", func(t *testing.T) { + service := new(resourceService) + handler := v1beta1.NewResourceHandler(logger, service) + + req := &pb.ApplyResourcesRequest{ + ProjectName: "proj", + DatastoreName: "bigquery", + ResourceNames: nil, + NamespaceName: "ns", + } + + _, err := handler.ApplyResources(ctx, req) + assert.NotNil(t, err) + assert.EqualError(t, err, "rpc error: code = InvalidArgument desc = invalid argument for entity "+ + "resource: empty resource names: unable to apply resources") + }) + t.Run("returns error when service returns error", func(t *testing.T) { + names := []string{"project.dataset.test_table"} + + service := new(resourceService) + service.On("SyncResources", ctx, tnnt, resource.Bigquery, names).Return(nil, errors.New("something went wrong")) + defer service.AssertExpectations(t) + + handler := v1beta1.NewResourceHandler(logger, service) + + req := &pb.ApplyResourcesRequest{ + ProjectName: "proj", + NamespaceName: "ns", + DatastoreName: "bigquery", + ResourceNames: names, + } + + _, err := handler.ApplyResources(ctx, req) + assert.NotNil(t, err) + assert.EqualError(t, err, "rpc error: code = Internal desc = something went wrong: "+ + "unable to sync to datastore") + }) + t.Run("syncs the resources successfully", func(t *testing.T) { + names := []string{"project.dataset.test_table"} + + service := new(resourceService) + service.On("SyncResources", ctx, tnnt, resource.Bigquery, names).Return( + &resource.SyncResponse{ResourceNames: names}, nil) + defer service.AssertExpectations(t) + + handler := v1beta1.NewResourceHandler(logger, service) + + req := &pb.ApplyResourcesRequest{ + ProjectName: "proj", + NamespaceName: "ns", + DatastoreName: "bigquery", + ResourceNames: names, + } + + resp, err := handler.ApplyResources(ctx, req) + assert.Nil(t, err) + + assert.Equal(t, "success", resp.Statuses[0].Status) + assert.Equal(t, names[0], resp.Statuses[0].ResourceName) + }) + }) } type resourceService struct { @@ -723,8 +818,8 @@ func (r *resourceService) Create(ctx context.Context, res *resource.Resource) er return args.Error(0) } -func (r *resourceService) Update(ctx context.Context, res *resource.Resource) error { - args := r.Called(ctx, res) +func (r *resourceService) Update(ctx context.Context, res *resource.Resource, logWriter writer.LogWriter) error { + args := r.Called(ctx, res, logWriter) return args.Error(0) } @@ -746,11 +841,24 @@ func (r *resourceService) GetAll(ctx context.Context, tnnt tenant.Tenant, store return resources, args.Error(1) } -func (r *resourceService) Deploy(ctx context.Context, tnnt tenant.Tenant, store resource.Store, resources []*resource.Resource) error { - args := r.Called(ctx, tnnt, store, resources) +func (r *resourceService) Deploy(ctx context.Context, tnnt tenant.Tenant, store resource.Store, resources []*resource.Resource, logWriter writer.LogWriter) error { + args := r.Called(ctx, tnnt, store, resources, logWriter) return args.Error(0) } +func (r *resourceService) ChangeNamespace(ctx context.Context, datastore resource.Store, resourceFullName string, oldTenant, newTenant tenant.Tenant) error { + return r.Called(ctx, datastore, resourceFullName, oldTenant, newTenant).Error(0) +} + +func (r *resourceService) SyncResources(ctx context.Context, tnnt tenant.Tenant, store resource.Store, names []string) (*resource.SyncResponse, error) { + args := r.Called(ctx, tnnt, store, names) + var resources *resource.SyncResponse + if args.Get(0) != nil { + resources = args.Get(0).(*resource.SyncResponse) + } + return resources, args.Error(1) +} + type resourceStreamMock struct { mock.Mock } diff --git a/core/resource/resource.go b/core/resource/resource.go index 91e1dfaf50..51d500325b 100644 --- a/core/resource/resource.go +++ b/core/resource/resource.go @@ -4,8 +4,8 @@ import ( "reflect" "strings" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( @@ -94,6 +94,10 @@ func (r *Resource) UpdateURN(urn string) error { return errors.InvalidArgument(EntityResource, "urn already present for "+r.FullName()) } +func (r *Resource) UpdateTenant(tnnt tenant.Tenant) { + r.tenant = tnnt +} + func (r *Resource) Metadata() *Metadata { return r.metadata } diff --git a/core/resource/resource_status.go b/core/resource/resource_status.go index d36ab38e65..4d7dbb1f16 100644 --- a/core/resource/resource_status.go +++ b/core/resource/resource_status.go @@ -3,7 +3,7 @@ package resource import ( "fmt" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/internal/errors" ) func (r *Resource) MarkValidationSuccess() error { diff --git a/core/resource/resource_test.go b/core/resource/resource_test.go index adda8b4daa..1054187b96 100644 --- a/core/resource/resource_test.go +++ b/core/resource/resource_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" ) func TestName(t *testing.T) { diff --git a/core/resource/service/backup_service.go b/core/resource/service/backup_service.go index b0d3c04f17..e96d212e20 100644 --- a/core/resource/service/backup_service.go +++ b/core/resource/service/backup_service.go @@ -2,15 +2,25 @@ package service import ( "context" + "strings" "time" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/salt/log" + + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/telemetry" ) -// recentBackupWindowMonths contains the window interval to consider for recent backups -const recentBackupWindowMonths = -3 +const ( + // recentBackupWindowMonths contains the window interval to consider for recent backups + recentBackupWindowMonths = -3 + + metricBackupRequest = "resource_backup_requests_total" + backupRequestStatusSuccess = "success" + backupRequestStatusFailed = "failed" +) type BackupRepository interface { GetByID(ctx context.Context, id resource.BackupID) (*resource.Backup, error) @@ -31,32 +41,40 @@ type BackupService struct { resources ResourceProvider backupManager BackupManager + + logger log.Logger } func (s BackupService) Create(ctx context.Context, backup *resource.Backup) (*resource.BackupResult, error) { resources, err := s.resources.GetResources(ctx, backup.Tenant(), backup.Store(), backup.ResourceNames()) if err != nil { + s.logger.Error("error getting resources [%s] from db: %s", strings.Join(backup.ResourceNames(), ", "), err) return nil, err } ignored := findMissingResources(backup.ResourceNames(), resources) backupInfo, err := s.backupManager.Backup(ctx, backup, resources) if err != nil { + s.logger.Error("error backup up through manager: %s", err) return nil, err } backupInfo.IgnoredResources = append(backupInfo.IgnoredResources, ignored...) err = s.repo.Create(ctx, backup) if err != nil { + s.logger.Error("error creating backup record to db: %s", err) return backupInfo, err } + raiseBackupRequestMetrics(backup.Tenant(), backupInfo) + backupInfo.ID = backup.ID() return backupInfo, nil } func (s BackupService) Get(ctx context.Context, backupID resource.BackupID) (*resource.Backup, error) { if backupID.IsInvalid() { + s.logger.Error("backup id [%s] is invalid", backupID.String()) return nil, errors.InvalidArgument("backup", "the backup id is not valid") } return s.repo.GetByID(ctx, backupID) @@ -65,6 +83,7 @@ func (s BackupService) Get(ctx context.Context, backupID resource.BackupID) (*re func (s BackupService) List(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Backup, error) { backups, err := s.repo.GetAll(ctx, tnnt, store) if err != nil { + s.logger.Error("error getting all backups from db: %s", err) return nil, err } @@ -101,10 +120,29 @@ func findMissingResources(names []string, resources []*resource.Resource) []reso return ignored } -func NewBackupService(repo BackupRepository, resources ResourceProvider, manager BackupManager) *BackupService { +func NewBackupService(repo BackupRepository, resources ResourceProvider, manager BackupManager, logger log.Logger) *BackupService { return &BackupService{ repo: repo, resources: resources, backupManager: manager, + logger: logger, } } + +func raiseBackupRequestMetrics(jobTenant tenant.Tenant, backupResult *resource.BackupResult) { + for _, ignoredResource := range backupResult.IgnoredResources { + raiseBackupRequestMetric(jobTenant, ignoredResource.Name, backupRequestStatusFailed) + } + for _, resourceName := range backupResult.ResourceNames { + raiseBackupRequestMetric(jobTenant, resourceName, backupRequestStatusSuccess) + } +} + +func raiseBackupRequestMetric(jobTenant tenant.Tenant, resourceName, state string) { + telemetry.NewCounter(metricBackupRequest, map[string]string{ + "project": jobTenant.ProjectName().String(), + "namespace": jobTenant.NamespaceName().String(), + "resource": resourceName, + "status": state, + }).Inc() +} diff --git a/core/resource/service/backup_service_test.go b/core/resource/service/backup_service_test.go index 5b5afe4d67..08683fe1c3 100644 --- a/core/resource/service/backup_service_test.go +++ b/core/resource/service/backup_service_test.go @@ -6,13 +6,14 @@ import ( "time" "github.com/google/uuid" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/resource/service" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/resource/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) func TestBackupService(t *testing.T) { @@ -29,6 +30,8 @@ func TestBackupService(t *testing.T) { validID := "dda7b864-4268-4107-a096-dcf5343a0959" id, _ := uuid.Parse(validID) + logger := log.NewLogrus() + t.Run("Create", func(t *testing.T) { t.Run("returns error when cannot get resources", func(t *testing.T) { resourceProvider := new(mockResourceProvider) @@ -36,7 +39,7 @@ func TestBackupService(t *testing.T) { Return(nil, errors.InternalError("repo", "cannot get", nil)) defer resourceProvider.AssertExpectations(t) - backupService := service.NewBackupService(nil, resourceProvider, nil) + backupService := service.NewBackupService(nil, resourceProvider, nil, logger) _, err := backupService.Create(ctx, backup) assert.Error(t, err) assert.EqualError(t, err, "internal error for entity repo: cannot get") @@ -53,7 +56,7 @@ func TestBackupService(t *testing.T) { Return(nil, errors.InternalError("bq", "something wrong", nil)) defer backupManager.AssertExpectations(t) - backupService := service.NewBackupService(nil, resourceProvider, backupManager) + backupService := service.NewBackupService(nil, resourceProvider, backupManager, logger) _, err := backupService.Create(ctx, backup) assert.Error(t, err) assert.EqualError(t, err, "internal error for entity bq: something wrong") @@ -74,7 +77,7 @@ func TestBackupService(t *testing.T) { repo.On("Create", ctx, backup).Return(errors.InternalError("repo", "cannot save", nil)) defer repo.AssertExpectations(t) - backupService := service.NewBackupService(repo, resourceProvider, backupManager) + backupService := service.NewBackupService(repo, resourceProvider, backupManager, logger) _, err := backupService.Create(ctx, backup) assert.Error(t, err) assert.EqualError(t, err, "internal error for entity repo: cannot save") @@ -95,7 +98,7 @@ func TestBackupService(t *testing.T) { repo.On("Create", ctx, backup).Return(nil) defer repo.AssertExpectations(t) - backupService := service.NewBackupService(repo, resourceProvider, backupManager) + backupService := service.NewBackupService(repo, resourceProvider, backupManager, logger) result, err := backupService.Create(ctx, backup) assert.NoError(t, err) assert.Equal(t, "p.d.t", result.ResourceNames[0]) @@ -119,7 +122,7 @@ func TestBackupService(t *testing.T) { repo.On("Create", ctx, bk1).Return(nil) defer repo.AssertExpectations(t) - backupService := service.NewBackupService(repo, resourceProvider, backupManager) + backupService := service.NewBackupService(repo, resourceProvider, backupManager, logger) result, err := backupService.Create(ctx, bk1) assert.NoError(t, err) assert.Equal(t, "p.d.t", result.ResourceNames[0]) @@ -133,7 +136,7 @@ func TestBackupService(t *testing.T) { id := uuid.Nil backupID := resource.BackupID(id) - backupService := service.NewBackupService(nil, nil, nil) + backupService := service.NewBackupService(nil, nil, nil, logger) _, err := backupService.Get(ctx, backupID) assert.Error(t, err) assert.EqualError(t, err, "invalid argument for entity backup: the backup id is not valid") @@ -144,7 +147,7 @@ func TestBackupService(t *testing.T) { repo.On("GetByID", ctx, backupID).Return(backup, nil) defer repo.AssertExpectations(t) - backupService := service.NewBackupService(repo, nil, nil) + backupService := service.NewBackupService(repo, nil, nil, logger) bkup, err := backupService.Get(ctx, backupID) assert.NoError(t, err) assert.Equal(t, "p.d.t", bkup.ResourceNames()[0]) @@ -156,7 +159,7 @@ func TestBackupService(t *testing.T) { repo.On("GetAll", ctx, tnnt, store).Return(nil, errors.NotFound("backup", "error in list backups")) defer repo.AssertExpectations(t) - backupService := service.NewBackupService(repo, nil, nil) + backupService := service.NewBackupService(repo, nil, nil, logger) _, err := backupService.List(ctx, tnnt, store) assert.Error(t, err) assert.EqualError(t, err, "not found for entity backup: error in list backups") @@ -175,7 +178,7 @@ func TestBackupService(t *testing.T) { repo.On("GetAll", ctx, tnnt, store).Return([]*resource.Backup{bk1, bk2}, nil) defer repo.AssertExpectations(t) - backupService := service.NewBackupService(repo, nil, nil) + backupService := service.NewBackupService(repo, nil, nil, logger) lst, err := backupService.List(ctx, tnnt, store) assert.NoError(t, err) diff --git a/core/resource/service/resource_manager.go b/core/resource/service/resource_manager.go index 06e52266f9..fc19530dab 100644 --- a/core/resource/service/resource_manager.go +++ b/core/resource/service/resource_manager.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" ) type DataStore interface { @@ -48,14 +48,14 @@ func (m *ResourceMgr) CreateResource(ctx context.Context, res *resource.Resource me.Append(res.MarkExistInStore()) } else { me.Append(res.MarkFailure()) + me.Append(err) } - me.Append(err) } else { me.Append(res.MarkSuccess()) } me.Append(m.repo.UpdateStatus(ctx, res)) - return errors.MultiToError(me) + return me.ToErr() } func (m *ResourceMgr) UpdateResource(ctx context.Context, res *resource.Resource) error { @@ -77,7 +77,32 @@ func (m *ResourceMgr) UpdateResource(ctx context.Context, res *resource.Resource } me.Append(m.repo.UpdateStatus(ctx, res)) - return errors.MultiToError(me) + return me.ToErr() +} + +func (m *ResourceMgr) SyncResource(ctx context.Context, res *resource.Resource) error { + store := res.Store() + datastore, ok := m.datastoreMap[store] + if !ok { + msg := fmt.Sprintf("datastore [%s] for resource [%s] is not found", store.String(), res.FullName()) + m.logger.Error(msg) + return errors.InternalError(resource.EntityResource, msg, nil) + } + + if err := datastore.Create(ctx, res); err != nil { + if !errors.IsErrorType(err, errors.ErrAlreadyExists) { + return errors.AddErrContext(err, resource.EntityResource, "unable to create on datastore") + } else if errUpdate := datastore.Update(ctx, res); errUpdate != nil { + return errors.AddErrContext(errUpdate, resource.EntityResource, "unable to update on datastore") + } + } + + resNew := resource.FromExisting(res, resource.ReplaceStatus(resource.StatusSuccess)) + if err := m.repo.UpdateStatus(ctx, resNew); err != nil { + return errors.AddErrContext(err, resource.EntityResource, "unable to update status in database") + } + + return nil } func (m *ResourceMgr) Validate(res *resource.Resource) error { @@ -111,16 +136,17 @@ func (m *ResourceMgr) BatchUpdate(ctx context.Context, store resource.Store, res return errors.InvalidArgument(resource.EntityResource, "data store service not found for "+store.String()) } - err := errors.NewMultiError("error in batch update") - err.Append(datastore.BatchUpdate(ctx, resources)) - err.Append(m.repo.UpdateStatus(ctx, resources...)) + me := errors.NewMultiError("error in batch update") + me.Append(datastore.BatchUpdate(ctx, resources)) + me.Append(m.repo.UpdateStatus(ctx, resources...)) - return errors.MultiToError(err) + return me.ToErr() } func (m *ResourceMgr) Backup(ctx context.Context, details *resource.Backup, resources []*resource.Resource) (*resource.BackupResult, error) { datastore, ok := m.datastoreMap[details.Store()] if !ok { + m.logger.Error("datastore [%s] is not found", details.Store()) return nil, errors.InvalidArgument(resource.EntityResource, "data store service not found for "+details.Store().String()) } diff --git a/core/resource/service/resource_manager_test.go b/core/resource/service/resource_manager_test.go index be3f8b563b..e3a564e456 100644 --- a/core/resource/service/resource_manager_test.go +++ b/core/resource/service/resource_manager_test.go @@ -5,14 +5,14 @@ import ( "testing" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/resource/service" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/resource/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) func TestResourceManager(t *testing.T) { @@ -115,7 +115,7 @@ func TestResourceManager(t *testing.T) { manager.RegisterDatastore(store, storeService) err = manager.CreateResource(ctx, createRequest) - assert.Error(t, err) + assert.NoError(t, err) }) t.Run("creates the resource on the datastore", func(t *testing.T) { spec := map[string]any{"description": "test spec"} @@ -448,6 +448,129 @@ func TestResourceManager(t *testing.T) { assert.Equal(t, "proj.ds.name1", result.ResourceNames[0]) }) }) + t.Run("SyncResource", func(t *testing.T) { + t.Run("returns error when store name is invalid", func(t *testing.T) { + repo := new(mockRepo) + logger := log.NewLogrus() + manager := service.NewResourceManager(repo, logger) + + spec := map[string]any{"description": "test spec"} + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + assert.Nil(t, err) + + err = manager.SyncResource(ctx, res) + assert.NotNil(t, err) + assert.EqualError(t, err, "internal error for entity resource: datastore [snowflake] for resource [proj.ds.name1] is not found") + }) + t.Run("returns error when create fails", func(t *testing.T) { + spec := map[string]any{"description": "test spec"} + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + assert.Nil(t, err) + + argMatcher := mock.MatchedBy(func(r []*resource.Resource) bool { + if len(r) != 1 { + return false + } + return r[0].Name() == res.Name() + }) + repo := new(mockRepo) + repo.On("UpdateStatus", ctx, argMatcher).Return(nil) + logger := log.NewLogrus() + manager := service.NewResourceManager(repo, logger) + + storeService := new(mockDataStore) + storeService.On("Create", ctx, res).Return(errors.InternalError("resource", "error in create", nil)) + defer storeService.AssertExpectations(t) + + manager.RegisterDatastore(store, storeService) + + err = manager.SyncResource(ctx, res) + assert.NotNil(t, err) + assert.EqualError(t, err, "internal error for entity resource: unable to create on datastore: "+ + "internal error for entity resource: error in create") + }) + t.Run("returns error when update fails", func(t *testing.T) { + spec := map[string]any{"description": "test spec"} + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + assert.Nil(t, err) + + argMatcher := mock.MatchedBy(func(r []*resource.Resource) bool { + if len(r) != 1 { + return false + } + return r[0].Name() == res.Name() + }) + repo := new(mockRepo) + repo.On("UpdateStatus", ctx, argMatcher).Return(nil) + logger := log.NewLogrus() + manager := service.NewResourceManager(repo, logger) + + storeService := new(mockDataStore) + storeService.On("Create", ctx, res).Return(errors.AlreadyExists(resource.EntityResource, "table already exists")) + storeService.On("Update", ctx, res).Return(errors.InternalError("resource", "error in update", nil)) + defer storeService.AssertExpectations(t) + + manager.RegisterDatastore(store, storeService) + + err = manager.SyncResource(ctx, res) + assert.NotNil(t, err) + assert.EqualError(t, err, "internal error for entity resource: unable to update on datastore: "+ + "internal error for entity resource: error in update") + }) + t.Run("returns error when fails to update in db", func(t *testing.T) { + spec := map[string]any{"description": "test spec"} + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + assert.Nil(t, err) + + argMatcher := mock.MatchedBy(func(r []*resource.Resource) bool { + if len(r) != 1 { + return false + } + return r[0].Name() == res.Name() + }) + repo := new(mockRepo) + repo.On("UpdateStatus", ctx, argMatcher).Return(errors.InternalError(resource.EntityResource, "error", nil)) + logger := log.NewLogrus() + manager := service.NewResourceManager(repo, logger) + + storeService := new(mockDataStore) + storeService.On("Create", ctx, res).Return(nil) + defer storeService.AssertExpectations(t) + + manager.RegisterDatastore(store, storeService) + + err = manager.SyncResource(ctx, res) + assert.NotNil(t, err) + assert.EqualError(t, err, "internal error for entity resource: unable to update status in database: "+ + "internal error for entity resource: error") + }) + t.Run("returns success when successful", func(t *testing.T) { + spec := map[string]any{"description": "test spec"} + res, err := resource.NewResource("proj.ds.name1", "table", store, tnnt, meta, spec) + assert.Nil(t, err) + + argMatcher := mock.MatchedBy(func(r []*resource.Resource) bool { + if len(r) != 1 { + return false + } + return r[0].Name() == res.Name() + }) + repo := new(mockRepo) + repo.On("UpdateStatus", ctx, argMatcher).Return(nil) + logger := log.NewLogrus() + manager := service.NewResourceManager(repo, logger) + + storeService := new(mockDataStore) + storeService.On("Create", ctx, res).Return(errors.AlreadyExists(resource.EntityResource, "table already exists")) + storeService.On("Update", ctx, res).Return(nil) + defer storeService.AssertExpectations(t) + + manager.RegisterDatastore(store, storeService) + + err = manager.SyncResource(ctx, res) + assert.Nil(t, err) + }) + }) } type mockRepo struct { diff --git a/core/resource/service/resource_service.go b/core/resource/service/resource_service.go index 23584329d9..89a17e3672 100644 --- a/core/resource/service/resource_service.go +++ b/core/resource/service/resource_service.go @@ -3,55 +3,79 @@ package service import ( "context" "fmt" - - "github.com/odpf/salt/log" - - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "reflect" + "strings" + + "github.com/raystack/salt/log" + + "github.com/raystack/optimus/core/event" + "github.com/raystack/optimus/core/event/moderator" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/writer" ) type ResourceRepository interface { Create(ctx context.Context, res *resource.Resource) error Update(ctx context.Context, res *resource.Resource) error + ChangeNamespace(ctx context.Context, res *resource.Resource, newTenant tenant.Tenant) error ReadByFullName(ctx context.Context, tnnt tenant.Tenant, store resource.Store, fullName string) (*resource.Resource, error) ReadAll(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Resource, error) + GetResources(ctx context.Context, tnnt tenant.Tenant, store resource.Store, names []string) ([]*resource.Resource, error) } type ResourceManager interface { CreateResource(ctx context.Context, res *resource.Resource) error UpdateResource(ctx context.Context, res *resource.Resource) error + SyncResource(ctx context.Context, res *resource.Resource) error BatchUpdate(ctx context.Context, store resource.Store, resources []*resource.Resource) error Validate(res *resource.Resource) error GetURN(res *resource.Resource) (string, error) } +type DownstreamRefresher interface { + RefreshResourceDownstream(ctx context.Context, resourceURNs []job.ResourceURN, logWriter writer.LogWriter) error +} + type TenantDetailsGetter interface { GetDetails(ctx context.Context, tnnt tenant.Tenant) (*tenant.WithDetails, error) } +type EventHandler interface { + HandleEvent(moderator.Event) +} + type ResourceService struct { - repo ResourceRepository - mgr ResourceManager - tnntDetailsGetter TenantDetailsGetter + repo ResourceRepository + mgr ResourceManager + refresher DownstreamRefresher - logger log.Logger + logger log.Logger + eventHandler EventHandler } -func NewResourceService(logger log.Logger, repo ResourceRepository, mgr ResourceManager, tnntDetailsGetter TenantDetailsGetter) *ResourceService { +func NewResourceService( + logger log.Logger, + repo ResourceRepository, downstreamRefresher DownstreamRefresher, mgr ResourceManager, + eventHandler EventHandler, +) *ResourceService { return &ResourceService{ - repo: repo, - mgr: mgr, - tnntDetailsGetter: tnntDetailsGetter, - logger: logger, + repo: repo, + mgr: mgr, + refresher: downstreamRefresher, + logger: logger, + eventHandler: eventHandler, } } -func (rs ResourceService) Create(ctx context.Context, incoming *resource.Resource) error { +func (rs ResourceService) Create(ctx context.Context, incoming *resource.Resource) error { // nolint:gocritic if err := rs.mgr.Validate(incoming); err != nil { rs.logger.Error("error validating resource [%s]: %s", incoming.FullName(), err) return err } + incoming.MarkValidationSuccess() urn, err := rs.mgr.GetURN(incoming) if err != nil { @@ -69,11 +93,6 @@ func (rs ResourceService) Create(ctx context.Context, incoming *resource.Resourc rs.logger.Error("error getting resource [%s]: %s", incoming.FullName(), err) return err } - - if _, err := rs.tnntDetailsGetter.GetDetails(ctx, incoming.Tenant()); err != nil { - rs.logger.Error("error getting tenant for resource [%s] details: %s", incoming.FullName(), err) - return err - } incoming.MarkToCreate() if err := rs.repo.Create(ctx, incoming); err != nil { @@ -81,6 +100,9 @@ func (rs ResourceService) Create(ctx context.Context, incoming *resource.Resourc return err } } else { + if existing.Status() == resource.StatusSuccess || existing.Status() == resource.StatusExistInStore { + return nil // Note: return in case resource already exists + } if !resource.StatusForToCreate(existing.Status()) { msg := fmt.Sprintf("cannot create resource [%s] since it already exists with status [%s]", incoming.FullName(), existing.Status()) rs.logger.Error(msg) @@ -93,14 +115,22 @@ func (rs ResourceService) Create(ctx context.Context, incoming *resource.Resourc return err } } - return rs.mgr.CreateResource(ctx, incoming) + + if err := rs.mgr.CreateResource(ctx, incoming); err != nil { + rs.logger.Error("error creating resource [%s] to manager: %s", incoming.FullName(), err) + return err + } + + rs.raiseCreateEvent(incoming) + return nil } -func (rs ResourceService) Update(ctx context.Context, incoming *resource.Resource) error { +func (rs ResourceService) Update(ctx context.Context, incoming *resource.Resource, logWriter writer.LogWriter) error { // nolint:gocritic if err := rs.mgr.Validate(incoming); err != nil { rs.logger.Error("error validating resource [%s]: %s", incoming.FullName(), err) return err } + incoming.MarkValidationSuccess() urn, err := rs.mgr.GetURN(incoming) if err != nil { @@ -131,10 +161,41 @@ func (rs ResourceService) Update(ctx context.Context, incoming *resource.Resourc return err } - return rs.mgr.UpdateResource(ctx, incoming) + if err := rs.mgr.UpdateResource(ctx, incoming); err != nil { + rs.logger.Error("error updating resource [%s] to manager: %s", incoming.FullName(), err) + return err + } + + rs.raiseUpdateEvent(incoming) + + err = rs.handleRefreshDownstream(ctx, + []*resource.Resource{incoming}, + map[string]*resource.Resource{existing.FullName(): existing}, + logWriter, + ) + if err != nil { + rs.logger.Error("error refreshing downstream for resource [%s]: %s", incoming.FullName(), err) + return err + } + return nil } -func (rs ResourceService) Get(ctx context.Context, tnnt tenant.Tenant, store resource.Store, resourceFullName string) (*resource.Resource, error) { +func (rs ResourceService) ChangeNamespace(ctx context.Context, datastore resource.Store, resourceFullName string, oldTenant, newTenant tenant.Tenant) error { // nolint:gocritic + resourceSpec, err := rs.Get(ctx, oldTenant, datastore, resourceFullName) + if err != nil { + rs.logger.Error("failed to read existing resource [%s]: %s", resourceFullName, err) + return err + } + if err := rs.repo.ChangeNamespace(ctx, resourceSpec, newTenant); err != nil { + rs.logger.Error("error changing namespace of stored resource [%s]: %s", resourceSpec.FullName(), err) + return err + } + resourceSpec.UpdateTenant(newTenant) + rs.raiseUpdateEvent(resourceSpec) + return nil +} + +func (rs ResourceService) Get(ctx context.Context, tnnt tenant.Tenant, store resource.Store, resourceFullName string) (*resource.Resource, error) { // nolint:gocritic if resourceFullName == "" { rs.logger.Error("resource full name is empty") return nil, errors.InvalidArgument(resource.EntityResource, "empty resource full name") @@ -142,13 +203,43 @@ func (rs ResourceService) Get(ctx context.Context, tnnt tenant.Tenant, store res return rs.repo.ReadByFullName(ctx, tnnt, store, resourceFullName) } -func (rs ResourceService) GetAll(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Resource, error) { +func (rs ResourceService) GetAll(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Resource, error) { // nolint:gocritic return rs.repo.ReadAll(ctx, tnnt, store) } -func (rs ResourceService) Deploy(ctx context.Context, tnnt tenant.Tenant, store resource.Store, resources []*resource.Resource) error { - multiError := errors.NewMultiError("error batch updating resources") +func (rs ResourceService) SyncResources(ctx context.Context, tnnt tenant.Tenant, store resource.Store, names []string) (*resource.SyncResponse, error) { // nolint:gocritic + resources, err := rs.repo.GetResources(ctx, tnnt, store, names) + if err != nil { + rs.logger.Error("error getting resources [%s] from db: %s", strings.Join(names, ", "), err) + return nil, err + } + + synced := &resource.SyncResponse{ + IgnoredResources: findMissingResources(names, resources), + } + + if len(resources) == 0 { + return synced, nil + } + for _, r := range resources { + err := rs.mgr.SyncResource(ctx, r) + if err != nil { + synced.IgnoredResources = append(synced.IgnoredResources, resource.IgnoredResource{ + Name: r.Name().String(), + Reason: err.Error(), + }) + continue + } + synced.ResourceNames = append(synced.ResourceNames, r.FullName()) + } + + return synced, nil +} + +func (rs ResourceService) Deploy(ctx context.Context, tnnt tenant.Tenant, store resource.Store, incomings []*resource.Resource, logWriter writer.LogWriter) error { // nolint:gocritic + multiError := errors.NewMultiError("error batch updating resources") + for _, r := range incomings { if err := rs.mgr.Validate(r); err != nil { msg := fmt.Sprintf("error validating [%s]: %s", r.FullName(), err) multiError.Append(errors.Wrap(resource.EntityResource, msg, err)) @@ -173,27 +264,50 @@ func (rs ResourceService) Deploy(ctx context.Context, tnnt tenant.Tenant, store r.MarkValidationSuccess() } - toUpdateOnStore, err := rs.getResourcesToBatchUpdate(ctx, tnnt, store, resources) + existingResources, err := rs.repo.ReadAll(ctx, tnnt, store) + if err != nil { + rs.logger.Error("error reading all existing resources: %s", err) + multiError.Append(err) + return multiError.ToErr() + } + existingMappedByFullName := createFullNameToResourceMap(existingResources) + + toUpdateOnStore, err := rs.getResourcesToBatchUpdate(ctx, incomings, existingMappedByFullName) multiError.Append(err) if len(toUpdateOnStore) == 0 { rs.logger.Warn("no resources to be batch updated") - return errors.MultiToError(multiError) + return multiError.ToErr() + } + + var toCreate []*resource.Resource + var toUpdate []*resource.Resource + for _, r := range toUpdateOnStore { + if r.Status() == resource.StatusToCreate { + toCreate = append(toCreate, r) + } else if r.Status() == resource.StatusToUpdate { + toUpdate = append(toUpdate, r) + } } multiError.Append(rs.mgr.BatchUpdate(ctx, store, toUpdateOnStore)) - return errors.MultiToError(multiError) -} -func (rs ResourceService) getResourcesToBatchUpdate(ctx context.Context, tnnt tenant.Tenant, store resource.Store, incomings []*resource.Resource) ([]*resource.Resource, error) { - existingResources, readErr := rs.repo.ReadAll(ctx, tnnt, store) - if readErr != nil { - rs.logger.Error("error reading all existing resources: %s", readErr) - return nil, readErr + for _, r := range toCreate { + rs.raiseCreateEvent(r) } - existingMappedByFullName := createFullNameToResourceMap(existingResources) + for _, r := range toUpdate { + rs.raiseUpdateEvent(r) + } + + if err = rs.handleRefreshDownstream(ctx, toUpdate, existingMappedByFullName, logWriter); err != nil { + multiError.Append(err) + } + return multiError.ToErr() +} + +func (rs ResourceService) getResourcesToBatchUpdate(ctx context.Context, incomings []*resource.Resource, existingMappedByFullName map[string]*resource.Resource) ([]*resource.Resource, error) { // nolint:gocritic var toUpdateOnStore []*resource.Resource me := errors.NewMultiError("error in resources to batch update") @@ -231,7 +345,90 @@ func (rs ResourceService) getResourcesToBatchUpdate(ctx context.Context, tnnt te } me.Append(err) } - return toUpdateOnStore, errors.MultiToError(me) + return toUpdateOnStore, me.ToErr() +} + +func (rs ResourceService) raiseCreateEvent(res *resource.Resource) { // nolint:gocritic + if res.Status() != resource.StatusSuccess { + return + } + + ev, err := event.NewResourceCreatedEvent(res) + if err != nil { + rs.logger.Error("error creating event for resource create: %s", err) + return + } + rs.eventHandler.HandleEvent(ev) +} + +func (rs ResourceService) raiseUpdateEvent(res *resource.Resource) { // nolint:gocritic + if res.Status() != resource.StatusSuccess { + return + } + + ev, err := event.NewResourceUpdatedEvent(res) + if err != nil { + rs.logger.Error("error creating event for resource update: %s", err) + return + } + rs.eventHandler.HandleEvent(ev) +} + +func (rs ResourceService) handleRefreshDownstream( // nolint:gocritic + ctx context.Context, + incomings []*resource.Resource, + existingMappedByFullName map[string]*resource.Resource, + logWriter writer.LogWriter, +) error { + var resourceURNsToRefresh []job.ResourceURN + for _, incoming := range incomings { + if incoming.Status() != resource.StatusSuccess { + continue + } + + existing, ok := existingMappedByFullName[incoming.FullName()] + + skipMessage := fmt.Sprintf("downstream refresh for resource [%s] is skipped", existing.FullName()) + if !ok { + rs.logger.Warn(skipMessage) + logWriter.Write(writer.LogLevelWarning, skipMessage) + continue + } + + if rs.isToRefreshDownstream(incoming, existing) { + resourceURNsToRefresh = append(resourceURNsToRefresh, job.ResourceURN(incoming.URN())) + } else { + rs.logger.Warn(skipMessage) + logWriter.Write(writer.LogLevelWarning, skipMessage) + } + } + + if len(resourceURNsToRefresh) == 0 { + rs.logger.Info("no resource urns to which the refresh will be done upon") + return nil + } + + return rs.refresher.RefreshResourceDownstream(ctx, resourceURNsToRefresh, logWriter) +} + +func (ResourceService) isToRefreshDownstream(incoming, existing *resource.Resource) bool { + var key []string + for k := range incoming.Spec() { + key = append(key, k) + } + for k := range existing.Spec() { + key = append(key, k) + } + + // TODO: this is not ideal solution, we need to see how to get these 'special' fields + for _, k := range key { + switch strings.ToLower(k) { + case "view_query", "schema", "source": + return !reflect.DeepEqual(incoming.Spec()[k], existing.Spec()[k]) + } + } + + return false } func createFullNameToResourceMap(resources []*resource.Resource) map[string]*resource.Resource { diff --git a/core/resource/service/resource_service_test.go b/core/resource/service/resource_service_test.go index f1475dfdc4..ddcd83f78f 100644 --- a/core/resource/service/resource_service_test.go +++ b/core/resource/service/resource_service_test.go @@ -5,19 +5,23 @@ import ( "errors" "testing" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/resource/service" - "github.com/odpf/optimus/core/tenant" - oErrors "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/event/moderator" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/resource/service" + "github.com/raystack/optimus/core/tenant" + oErrors "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/writer" ) func TestResourceService(t *testing.T) { ctx := context.Background() logger := log.NewLogrus() + logWriter := writer.NewLogWriter(logger) tnnt, tenantErr := tenant.NewTenant("project_test", "namespace_tes") assert.NoError(t, tenantErr) meta := &resource.Metadata{ @@ -36,7 +40,7 @@ func TestResourceService(t *testing.T) { mgr := newResourceManager(t) mgr.On("Validate", invalid).Return(errors.New("validation error")) - rscService := service.NewResourceService(logger, nil, mgr, nil) + rscService := service.NewResourceService(logger, nil, nil, mgr, nil) actualError := rscService.Create(ctx, invalid) assert.Error(t, actualError) @@ -50,7 +54,7 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", incoming).Return(nil) mgr.On("GetURN", incoming).Return("", errors.New("urn error")) - rscService := service.NewResourceService(logger, nil, mgr, nil) + rscService := service.NewResourceService(logger, nil, nil, mgr, nil) actualError := rscService.Create(ctx, incoming) assert.Error(t, actualError) @@ -67,7 +71,7 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", incoming).Return(nil) mgr.On("GetURN", incoming).Return(urn, nil) - rscService := service.NewResourceService(logger, nil, mgr, nil) + rscService := service.NewResourceService(logger, nil, nil, mgr, nil) actualError := rscService.Create(ctx, incoming) assert.Error(t, actualError) @@ -85,33 +89,13 @@ func TestResourceService(t *testing.T) { repo := newResourceRepository(t) repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, incoming.FullName()).Return(nil, errors.New("unknown error")) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) actualError := rscService.Create(ctx, incoming) assert.ErrorContains(t, actualError, "unknown error") }) t.Run("resource does not exist in repository", func(t *testing.T) { - t.Run("returns error if error is encountered when getting tenant for the resource", func(t *testing.T) { - incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) - assert.NoError(t, err) - - mgr := newResourceManager(t) - mgr.On("Validate", incoming).Return(nil) - mgr.On("GetURN", incoming).Return("bigquery://project:dataset", nil) - - repo := newResourceRepository(t) - repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, incoming.FullName()).Return(nil, oErrors.NotFound(resource.EntityResource, "resource not found")) - - tnntDetailsGetter := newTenantDetailsGetter(t) - tnntDetailsGetter.On("GetDetails", ctx, tnnt).Return(nil, errors.New("error getting tenant")) - - rscService := service.NewResourceService(logger, repo, mgr, tnntDetailsGetter) - - actualError := rscService.Create(ctx, incoming) - assert.ErrorContains(t, actualError, "error getting tenant") - }) - t.Run("returns error if error is encountered when creating resource to repository", func(t *testing.T) { incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) assert.NoError(t, err) @@ -120,14 +104,11 @@ func TestResourceService(t *testing.T) { repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, incoming.FullName()).Return(nil, oErrors.NotFound(resource.EntityResource, "resource not found")) repo.On("Create", ctx, mock.Anything).Return(errors.New("error creating resource")) - tnntDetailsGetter := newTenantDetailsGetter(t) - tnntDetailsGetter.On("GetDetails", ctx, tnnt).Return(nil, nil) - mgr := newResourceManager(t) mgr.On("Validate", incoming).Return(nil) mgr.On("GetURN", incoming).Return("bigquery://project:dataset", nil) - rscService := service.NewResourceService(logger, repo, mgr, tnntDetailsGetter) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) actualError := rscService.Create(ctx, incoming) assert.ErrorContains(t, actualError, "error creating resource") @@ -135,7 +116,7 @@ func TestResourceService(t *testing.T) { }) t.Run("resource already exists in repository", func(t *testing.T) { - t.Run("returns error if status is neither create_failure nor to_create", func(t *testing.T) { + t.Run("returns no error if status is success or exists_in_store", func(t *testing.T) { existing, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) assert.NoError(t, err) @@ -143,8 +124,34 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", mock.Anything).Return(nil) mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset", nil) - repo := newResourceRepository(t) - rscService := service.NewResourceService(logger, repo, mgr, nil) + statusToTest := []resource.Status{ + resource.StatusExistInStore, + resource.StatusSuccess, + } + + for _, status := range statusToTest { + incoming, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + assert.NoError(t, err) + + existingWithStatus := resource.FromExisting(existing, resource.ReplaceStatus(status)) + + repo := newResourceRepository(t) + repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, incoming.FullName()).Return(existingWithStatus, nil) + + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) + + err = rscService.Create(ctx, incoming) + assert.NoError(t, err) + repo.AssertExpectations(t) + } + }) + t.Run("returns error if status is neither create_failure nor to_create", func(t *testing.T) { + existing, err := resource.NewResource("project.dataset", "dataset", resource.Bigquery, tnnt, meta, spec) + assert.NoError(t, err) + + mgr := newResourceManager(t) + mgr.On("Validate", mock.Anything).Return(nil) + mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset", nil) unacceptableStatuses := []resource.Status{ resource.StatusUnknown, @@ -153,8 +160,6 @@ func TestResourceService(t *testing.T) { resource.StatusToUpdate, resource.StatusSkipped, resource.StatusUpdateFailure, - resource.StatusExistInStore, - resource.StatusSuccess, } for _, status := range unacceptableStatuses { @@ -163,6 +168,9 @@ func TestResourceService(t *testing.T) { existingWithStatus := resource.FromExisting(existing, resource.ReplaceStatus(status)) + repo := newResourceRepository(t) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) + repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, incoming.FullName()).Return(existingWithStatus, nil) actualError := rscService.Create(ctx, incoming) @@ -186,7 +194,7 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", incoming).Return(nil) mgr.On("GetURN", incoming).Return("bigquery://project:dataset", nil) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) actualError := rscService.Create(ctx, incoming) assert.ErrorContains(t, actualError, "error updating resource") @@ -206,10 +214,7 @@ func TestResourceService(t *testing.T) { mgr.On("GetURN", incoming).Return("bigquery://project:dataset", nil) mgr.On("CreateResource", ctx, incoming).Return(errors.New("error creating to store")) - tnntDetailsGetter := newTenantDetailsGetter(t) - tnntDetailsGetter.On("GetDetails", ctx, tnnt).Return(nil, nil) - - rscService := service.NewResourceService(logger, repo, mgr, tnntDetailsGetter) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) actualError := rscService.Create(ctx, incoming) assert.ErrorContains(t, actualError, "error creating to store") @@ -223,15 +228,14 @@ func TestResourceService(t *testing.T) { repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, incoming.FullName()).Return(nil, oErrors.NotFound(resource.EntityResource, "resource not found")) repo.On("Create", ctx, incoming).Return(nil) - tnntDetailsGetter := newTenantDetailsGetter(t) - tnntDetailsGetter.On("GetDetails", ctx, tnnt).Return(nil, nil) - mgr := newResourceManager(t) mgr.On("Validate", incoming).Return(nil) mgr.On("GetURN", incoming).Return("bigquery://project:dataset", nil) mgr.On("CreateResource", ctx, incoming).Return(nil) - rscService := service.NewResourceService(logger, repo, mgr, tnntDetailsGetter) + eventHandler := newEventHandler(t) + + rscService := service.NewResourceService(logger, repo, nil, mgr, eventHandler) actualError := rscService.Create(ctx, incoming) assert.NoError(t, actualError) @@ -245,9 +249,9 @@ func TestResourceService(t *testing.T) { mgr := newResourceManager(t) mgr.On("Validate", invalidResource).Return(errors.New("validation error")) - rscService := service.NewResourceService(logger, nil, mgr, nil) + rscService := service.NewResourceService(logger, nil, nil, mgr, nil) - actualError := rscService.Update(ctx, invalidResource) + actualError := rscService.Update(ctx, invalidResource, logWriter) assert.Error(t, actualError) }) t.Run("returns error cannot get resource urn", func(t *testing.T) { @@ -258,9 +262,9 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", incoming).Return(nil) mgr.On("GetURN", incoming).Return("", errors.New("urn error")) - rscService := service.NewResourceService(logger, nil, mgr, nil) + rscService := service.NewResourceService(logger, nil, nil, mgr, nil) - actualError := rscService.Update(ctx, incoming) + actualError := rscService.Update(ctx, incoming, logWriter) assert.Error(t, actualError) assert.ErrorContains(t, actualError, "urn error") }) @@ -275,9 +279,9 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", incoming).Return(nil) mgr.On("GetURN", incoming).Return(urn, nil) - rscService := service.NewResourceService(logger, nil, mgr, nil) + rscService := service.NewResourceService(logger, nil, nil, mgr, nil) - actualError := rscService.Update(ctx, incoming) + actualError := rscService.Update(ctx, incoming, logWriter) assert.Error(t, actualError) assert.ErrorContains(t, actualError, "urn already present") }) @@ -294,9 +298,9 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", resourceToUpdate).Return(nil) mgr.On("GetURN", resourceToUpdate).Return("bigquery://project:dataset", nil) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) - actualError := rscService.Update(ctx, resourceToUpdate) + actualError := rscService.Update(ctx, resourceToUpdate, logWriter) assert.ErrorContains(t, actualError, "unknown error") }) @@ -309,7 +313,7 @@ func TestResourceService(t *testing.T) { mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset", nil) repo := newResourceRepository(t) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) unacceptableStatuses := []resource.Status{ resource.StatusUnknown, @@ -328,7 +332,7 @@ func TestResourceService(t *testing.T) { repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, resourceToUpdate.FullName()).Return(existingWithStatus, nil) - actualError := rscService.Update(ctx, resourceToUpdate) + actualError := rscService.Update(ctx, resourceToUpdate, logWriter) assert.ErrorContains(t, actualError, "cannot update resource") } }) @@ -349,9 +353,9 @@ func TestResourceService(t *testing.T) { repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, fullName).Return(existingResource, nil) repo.On("Update", ctx, mock.Anything).Return(errors.New("unknown error")) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) - actualError := rscService.Update(ctx, resourceToUpdate) + actualError := rscService.Update(ctx, resourceToUpdate, logWriter) assert.ErrorContains(t, actualError, "unknown error") }) @@ -372,17 +376,55 @@ func TestResourceService(t *testing.T) { mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset", nil) mgr.On("UpdateResource", ctx, mock.Anything).Return(errors.New("unknown error")) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) - actualError := rscService.Update(ctx, resourceToUpdate) + actualError := rscService.Update(ctx, resourceToUpdate, logWriter) + assert.ErrorContains(t, actualError, "unknown error") + }) + + t.Run("returns error if encountered error when refreshing downstream", func(t *testing.T) { + fullName := "project.dataset" + incomingSpec := map[string]any{"view_query": "select 1;"} + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, incomingSpec) + assert.NoError(t, err) + existingSpec := map[string]any{"view_query": "select 2;"} + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, existingSpec) + assert.NoError(t, err) + existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) + + repo := newResourceRepository(t) + repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, fullName).Return(existingResource, nil) + repo.On("Update", ctx, mock.Anything).Return(nil) + + mgr := newResourceManager(t) + mgr.On("Validate", mock.Anything).Return(nil) + mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset", nil) + mgr.On("UpdateResource", ctx, mock.Anything).Run(func(args mock.Arguments) { + res, ok := args[1].(*resource.Resource) + if ok { + res.MarkSuccess() + } + }).Return(nil) + + eventHandler := newEventHandler(t) + eventHandler.On("HandleEvent", mock.Anything) + + refresher := new(mockDownstreamRefresher) + refresher.On("RefreshResourceDownstream", ctx, mock.Anything, logWriter).Return(errors.New("unknown error")) + + rscService := service.NewResourceService(logger, repo, refresher, mgr, eventHandler) + + actualError := rscService.Update(ctx, resourceToUpdate, logWriter) assert.ErrorContains(t, actualError, "unknown error") }) t.Run("returns nil if no error is encountered", func(t *testing.T) { fullName := "project.dataset" - resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + incomingSpec := map[string]any{"view_query": "select 1;"} + resourceToUpdate, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, incomingSpec) assert.NoError(t, err) - existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + existingSpec := map[string]any{"view_query": "select 2;"} + existingResource, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, existingSpec) assert.NoError(t, err) existingResource = resource.FromExisting(existingResource, resource.ReplaceStatus(resource.StatusToUpdate)) @@ -395,16 +437,21 @@ func TestResourceService(t *testing.T) { mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset", nil) mgr.On("UpdateResource", ctx, mock.Anything).Return(nil) - rscService := service.NewResourceService(logger, repo, mgr, nil) + eventHandler := newEventHandler(t) + + refresher := new(mockDownstreamRefresher) + refresher.On("RefreshResourceDownstream", ctx, mock.Anything, logWriter).Return(nil) + + rscService := service.NewResourceService(logger, repo, refresher, mgr, eventHandler) - actualError := rscService.Update(ctx, resourceToUpdate) + actualError := rscService.Update(ctx, resourceToUpdate, logWriter) assert.NoError(t, actualError) }) }) t.Run("Get", func(t *testing.T) { t.Run("returns nil and error if resource name is empty", func(t *testing.T) { - rscService := service.NewResourceService(logger, nil, nil, nil) + rscService := service.NewResourceService(logger, nil, nil, nil, nil) store := resource.Bigquery actualResource, actualError := rscService.Get(ctx, tnnt, store, "") @@ -417,7 +464,9 @@ func TestResourceService(t *testing.T) { fullName := "project.dataset" repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, fullName).Return(nil, errors.New("unknown error")) - rscService := service.NewResourceService(logger, repo, nil, nil) + refresher := new(mockDownstreamRefresher) + + rscService := service.NewResourceService(logger, repo, refresher, nil, nil) actualResource, actualError := rscService.Get(ctx, tnnt, resource.Bigquery, fullName) assert.Nil(t, actualResource) @@ -432,7 +481,9 @@ func TestResourceService(t *testing.T) { repo := newResourceRepository(t) repo.On("ReadByFullName", ctx, tnnt, resource.Bigquery, fullName).Return(existingResource, nil) - rscService := service.NewResourceService(logger, repo, nil, nil) + refresher := new(mockDownstreamRefresher) + + rscService := service.NewResourceService(logger, repo, refresher, nil, nil) actualResource, actualError := rscService.Get(ctx, tnnt, resource.Bigquery, fullName) assert.EqualValues(t, existingResource, actualResource) @@ -445,7 +496,9 @@ func TestResourceService(t *testing.T) { repo := newResourceRepository(t) repo.On("ReadAll", ctx, tnnt, resource.Bigquery).Return(nil, errors.New("unknown error")) - rscService := service.NewResourceService(logger, repo, nil, nil) + refresher := new(mockDownstreamRefresher) + + rscService := service.NewResourceService(logger, repo, refresher, nil, nil) actualResources, actualError := rscService.GetAll(ctx, tnnt, resource.Bigquery) assert.Nil(t, actualResources) @@ -459,7 +512,9 @@ func TestResourceService(t *testing.T) { repo := newResourceRepository(t) repo.On("ReadAll", ctx, tnnt, resource.Bigquery).Return([]*resource.Resource{existingResource}, nil) - rscService := service.NewResourceService(logger, repo, nil, nil) + refresher := new(mockDownstreamRefresher) + + rscService := service.NewResourceService(logger, repo, refresher, nil, nil) actualResources, actualError := rscService.GetAll(ctx, tnnt, resource.Bigquery) assert.EqualValues(t, []*resource.Resource{existingResource}, actualResources) @@ -471,8 +526,8 @@ func TestResourceService(t *testing.T) { viewSpec := map[string]any{ "view_query": "select * from `proj.dataset.table`", } - resourceWithStatus := func(name string, status resource.Status) *resource.Resource { - existingResource, resErr := resource.NewResource(name, "view", resource.Bigquery, tnnt, meta, viewSpec) + resourceWithStatus := func(name string, spec map[string]any, status resource.Status) *resource.Resource { + existingResource, resErr := resource.NewResource(name, "view", resource.Bigquery, tnnt, meta, spec) assert.NoError(t, resErr) return resource.FromExisting(existingResource, resource.ReplaceStatus(status)) } @@ -487,9 +542,9 @@ func TestResourceService(t *testing.T) { mgr := newResourceManager(t) mgr.On("Validate", invalidResourceToUpdate).Return(errors.New("error validating")) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) - actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, resourcesToUpdate) + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, resourcesToUpdate, logWriter) assert.Error(t, actualError) assert.ErrorContains(t, actualError, "error validating") }) @@ -505,9 +560,9 @@ func TestResourceService(t *testing.T) { repo := newResourceRepository(t) repo.On("ReadAll", ctx, tnnt, resource.Bigquery).Return([]*resource.Resource{}, nil) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) - actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incoming}) + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incoming}, logWriter) assert.Error(t, actualError) assert.ErrorContains(t, actualError, "urn error") assert.Equal(t, "unknown", incoming.Status().String()) @@ -527,16 +582,16 @@ func TestResourceService(t *testing.T) { repo := newResourceRepository(t) repo.On("ReadAll", ctx, tnnt, resource.Bigquery).Return([]*resource.Resource{}, nil) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) - actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incoming}) + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incoming}, logWriter) assert.Error(t, actualError) assert.ErrorContains(t, actualError, "urn already present for") assert.Equal(t, "unknown", incoming.Status().String()) }) t.Run("returns error if error is encountered when reading from repo", func(t *testing.T) { - incomingResourceToUpdate := resourceWithStatus("project.dataset.table1", resource.StatusValidationSuccess) + incomingResourceToUpdate := resourceWithStatus("project.dataset.table1", viewSpec, resource.StatusValidationSuccess) resourcesToUpdate := []*resource.Resource{incomingResourceToUpdate} repo := newResourceRepository(t) @@ -546,16 +601,16 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", incomingResourceToUpdate).Return(nil) mgr.On("GetURN", incomingResourceToUpdate).Return("bigquery://project:dataset.table1", nil) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) - actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, resourcesToUpdate) + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, resourcesToUpdate, logWriter) assert.ErrorContains(t, actualError, "error while read all") }) t.Run("returns nil if there is no resource to create or modify", func(t *testing.T) { incomingResourceToUpdate, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec) assert.NoError(t, resErr) - existing := resourceWithStatus("project.dataset.view1", resource.StatusSuccess) + existing := resourceWithStatus("project.dataset.view1", viewSpec, resource.StatusSuccess) repo := newResourceRepository(t) repo.On("ReadAll", ctx, tnnt, resource.Bigquery).Return([]*resource.Resource{existing}, nil) @@ -564,9 +619,9 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", mock.Anything).Return(nil) mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset.view1", nil) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) - actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incomingResourceToUpdate}) + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incomingResourceToUpdate}, logWriter) assert.NoError(t, actualError) }) @@ -586,9 +641,11 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", mock.Anything).Return(nil) mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset", nil) - rscService := service.NewResourceService(logger, repo, mgr, nil) + eventHandler := newEventHandler(t) + + rscService := service.NewResourceService(logger, repo, nil, mgr, eventHandler) - actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incomingResourceToUpdate}) + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incomingResourceToUpdate}, logWriter) assert.ErrorContains(t, actualError, "error in create") }) @@ -601,7 +658,7 @@ func TestResourceService(t *testing.T) { incomingResourceToUpdate, err := resource.NewResource(fullName, "view", resource.Bigquery, tnnt, incomingMetadata, viewSpec) assert.NoError(t, err) - existing := resourceWithStatus(fullName, resource.StatusSuccess) + existing := resourceWithStatus(fullName, viewSpec, resource.StatusSuccess) repo := newResourceRepository(t) repo.On("ReadAll", ctx, tnnt, resource.Bigquery).Return([]*resource.Resource{existing}, nil) @@ -611,9 +668,10 @@ func TestResourceService(t *testing.T) { mgr.On("Validate", mock.Anything).Return(nil) mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset.view1", nil) - rscService := service.NewResourceService(logger, repo, mgr, nil) + eventHandler := newEventHandler(t) + rscService := service.NewResourceService(logger, repo, nil, mgr, eventHandler) - actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incomingResourceToUpdate}) + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incomingResourceToUpdate}, logWriter) assert.ErrorContains(t, actualError, "error in update") }) @@ -626,7 +684,7 @@ func TestResourceService(t *testing.T) { incomingResourceToUpdate, err := resource.NewResource(fullName, "view", resource.Bigquery, tnnt, incomingMetadata, viewSpec) assert.NoError(t, err) - existing := resourceWithStatus(fullName, resource.StatusCreateFailure) + existing := resourceWithStatus(fullName, viewSpec, resource.StatusCreateFailure) repo := newResourceRepository(t) repo.On("ReadAll", ctx, tnnt, resource.Bigquery).Return([]*resource.Resource{existing}, nil) @@ -637,9 +695,10 @@ func TestResourceService(t *testing.T) { mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset.view1", nil) mgr.On("BatchUpdate", ctx, resource.Bigquery, mock.Anything).Return(errors.New("unknown error")) - rscService := service.NewResourceService(logger, repo, mgr, nil) + eventHandler := newEventHandler(t) + rscService := service.NewResourceService(logger, repo, nil, mgr, eventHandler) - actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incomingResourceToUpdate}) + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incomingResourceToUpdate}, logWriter) assert.ErrorContains(t, actualError, "unknown error") }) @@ -665,21 +724,71 @@ func TestResourceService(t *testing.T) { mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset.view1", nil) mgr.On("BatchUpdate", ctx, resource.Bigquery, mock.Anything).Return(errors.New("unknown error")) - rscService := service.NewResourceService(logger, repo, mgr, nil) + eventHandler := newEventHandler(t) + rscService := service.NewResourceService(logger, repo, nil, mgr, eventHandler) - actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incomingResourceToUpdate}) + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, []*resource.Resource{incomingResourceToUpdate}, logWriter) + assert.ErrorContains(t, actualError, "unknown error") + }) + + t.Run("returns nil if encountered error when refreshing downstream", func(t *testing.T) { + existingToCreate := resourceWithStatus("project.dataset.view1", viewSpec, resource.StatusCreateFailure) + existingToSkip := resourceWithStatus("project.dataset.view2", viewSpec, resource.StatusSuccess) + existingToUpdate := resourceWithStatus("project.dataset.view3", viewSpec, resource.StatusUpdateFailure) + + updatedViewSpec := map[string]any{ + "view_query": "select 1;", + } + incomingToUpdate, err := resource.NewResource("project.dataset.view3", "view", resource.Bigquery, tnnt, meta, updatedViewSpec) + assert.NoError(t, err) + incomingToCreateExisting, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec) + assert.NoError(t, resErr) + incomingToSkip, resErr := resource.NewResource("project.dataset.view2", "view", resource.Bigquery, tnnt, meta, viewSpec) + assert.NoError(t, resErr) + incomingToCreate, resErr := resource.NewResource("project.dataset.view5", "view", resource.Bigquery, tnnt, meta, viewSpec) + assert.NoError(t, resErr) + + repo := newResourceRepository(t) + repo.On("ReadAll", ctx, tnnt, resource.Bigquery).Return([]*resource.Resource{existingToCreate, existingToSkip, existingToUpdate}, nil) + repo.On("Create", ctx, incomingToCreate).Return(nil) + repo.On("Update", ctx, incomingToUpdate).Return(nil) + repo.On("Update", ctx, incomingToCreateExisting).Return(nil) + + mgr := newResourceManager(t) + mgr.On("Validate", mock.Anything).Return(nil) + mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset.view1", nil) + mgr.On("BatchUpdate", ctx, resource.Bigquery, []*resource.Resource{incomingToCreate, incomingToUpdate, incomingToCreateExisting}).Run(func(args mock.Arguments) { + res := args.Get(2).([]*resource.Resource) + for _, r := range res { + r.MarkSuccess() + } + }).Return(nil) + + eventHandler := newEventHandler(t) + argMatcher := mock.MatchedBy(func(ev moderator.Event) bool { + return ev != nil + }) + eventHandler.On("HandleEvent", argMatcher).Return().Times(3) + + refresher := new(mockDownstreamRefresher) + refresher.On("RefreshResourceDownstream", ctx, mock.Anything, logWriter).Return(errors.New("unknown error")) + + rscService := service.NewResourceService(logger, repo, refresher, mgr, eventHandler) + + incomings := []*resource.Resource{incomingToCreate, incomingToSkip, incomingToUpdate, incomingToCreateExisting} + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, incomings, logWriter) assert.ErrorContains(t, actualError, "unknown error") }) t.Run("returns nil if no error is encountered", func(t *testing.T) { - existingToCreate := resourceWithStatus("project.dataset.view1", resource.StatusCreateFailure) - existingToSkip := resourceWithStatus("project.dataset.view2", resource.StatusSuccess) - existingToUpdate := resourceWithStatus("project.dataset.view3", resource.StatusUpdateFailure) + existingToCreate := resourceWithStatus("project.dataset.view1", viewSpec, resource.StatusCreateFailure) + existingToSkip := resourceWithStatus("project.dataset.view2", viewSpec, resource.StatusSuccess) + existingToUpdate := resourceWithStatus("project.dataset.view3", viewSpec, resource.StatusUpdateFailure) - incomingMetadata := &resource.Metadata{ - Description: "incoming resource metadata", + updatedViewSpec := map[string]any{ + "view_query": "select 1;", } - incomingToUpdate, err := resource.NewResource("project.dataset.view3", "view", resource.Bigquery, tnnt, incomingMetadata, viewSpec) + incomingToUpdate, err := resource.NewResource("project.dataset.view3", "view", resource.Bigquery, tnnt, meta, updatedViewSpec) assert.NoError(t, err) incomingToCreateExisting, resErr := resource.NewResource("project.dataset.view1", "view", resource.Bigquery, tnnt, meta, viewSpec) assert.NoError(t, resErr) @@ -697,15 +806,99 @@ func TestResourceService(t *testing.T) { mgr := newResourceManager(t) mgr.On("Validate", mock.Anything).Return(nil) mgr.On("GetURN", mock.Anything).Return("bigquery://project:dataset.view1", nil) - mgr.On("BatchUpdate", ctx, resource.Bigquery, []*resource.Resource{incomingToCreate, incomingToUpdate, incomingToCreateExisting}).Return(nil) + mgr.On("BatchUpdate", ctx, resource.Bigquery, []*resource.Resource{incomingToCreate, incomingToUpdate, incomingToCreateExisting}).Run(func(args mock.Arguments) { + res := args.Get(2).([]*resource.Resource) + for _, r := range res { + r.MarkSuccess() + } + }).Return(nil) + + eventHandler := newEventHandler(t) + argMatcher := mock.MatchedBy(func(ev moderator.Event) bool { + return ev != nil + }) + eventHandler.On("HandleEvent", argMatcher).Return().Times(3) + + refresher := new(mockDownstreamRefresher) + refresher.On("RefreshResourceDownstream", ctx, mock.Anything, logWriter).Return(nil) - rscService := service.NewResourceService(logger, repo, mgr, nil) + rscService := service.NewResourceService(logger, repo, refresher, mgr, eventHandler) incomings := []*resource.Resource{incomingToCreate, incomingToSkip, incomingToUpdate, incomingToCreateExisting} - actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, incomings) + actualError := rscService.Deploy(ctx, tnnt, resource.Bigquery, incomings, logWriter) assert.NoError(t, actualError) }) }) + + t.Run("SyncResource", func(t *testing.T) { + t.Run("returns error when get resources returns error", func(t *testing.T) { + fullName := "project.dataset" + repo := newResourceRepository(t) + repo.On("GetResources", ctx, tnnt, resource.Bigquery, []string{fullName}).Return(nil, errors.New("unknown error")) + + mgr := newResourceManager(t) + + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) + + resp, actualError := rscService.SyncResources(ctx, tnnt, resource.Bigquery, []string{fullName}) + assert.ErrorContains(t, actualError, "unknown error") + assert.Nil(t, resp) + }) + t.Run("returns if no resources to sync", func(t *testing.T) { + fullName := "project.dataset" + repo := newResourceRepository(t) + repo.On("GetResources", ctx, tnnt, resource.Bigquery, []string{fullName}).Return([]*resource.Resource{}, nil) + + mgr := newResourceManager(t) + + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) + + response, actualError := rscService.SyncResources(ctx, tnnt, resource.Bigquery, []string{fullName}) + assert.Nil(t, actualError) + assert.Equal(t, fullName, response.IgnoredResources[0].Name) + assert.Equal(t, "no resource found in namespace", response.IgnoredResources[0].Reason) + assert.Equal(t, 0, len(response.ResourceNames)) + }) + t.Run("returns error while syncing resource", func(t *testing.T) { + fullName := "project.dataset" + incoming, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + assert.NoError(t, err) + + repo := newResourceRepository(t) + repo.On("GetResources", ctx, tnnt, resource.Bigquery, []string{fullName}). + Return([]*resource.Resource{incoming}, nil) + + mgr := newResourceManager(t) + mgr.On("SyncResource", ctx, incoming).Return(errors.New("unable to create")) + + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) + + response, actualError := rscService.SyncResources(ctx, tnnt, resource.Bigquery, []string{fullName}) + assert.Nil(t, actualError) + assert.Equal(t, fullName, response.IgnoredResources[0].Name) + assert.Equal(t, "unable to create", response.IgnoredResources[0].Reason) + assert.Equal(t, 0, len(response.ResourceNames)) + }) + t.Run("syncs the resource successfully", func(t *testing.T) { + fullName := "project.dataset" + incoming, err := resource.NewResource(fullName, "dataset", resource.Bigquery, tnnt, meta, spec) + assert.NoError(t, err) + + repo := newResourceRepository(t) + repo.On("GetResources", ctx, tnnt, resource.Bigquery, []string{fullName}). + Return([]*resource.Resource{incoming}, nil) + + mgr := newResourceManager(t) + mgr.On("SyncResource", ctx, incoming).Return(nil) + + rscService := service.NewResourceService(logger, repo, nil, mgr, nil) + + response, actualError := rscService.SyncResources(ctx, tnnt, resource.Bigquery, []string{fullName}) + assert.Nil(t, actualError) + assert.Equal(t, fullName, response.ResourceNames[0]) + assert.Equal(t, 0, len(response.IgnoredResources)) + }) + }) } type mockResourceRepository struct { @@ -736,6 +929,18 @@ func (m *mockResourceRepository) Update(ctx context.Context, res *resource.Resou return m.Called(ctx, res).Error(0) } +func (m *mockResourceRepository) ChangeNamespace(ctx context.Context, res *resource.Resource, newTenant tenant.Tenant) error { + return m.Called(ctx, res, newTenant).Error(0) +} + +func (m *mockResourceRepository) GetResources(ctx context.Context, tnnt tenant.Tenant, store resource.Store, names []string) ([]*resource.Resource, error) { + args := m.Called(ctx, tnnt, store, names) + if args.Get(0) == nil { + return nil, args.Error(1) + } + return args.Get(0).([]*resource.Resource), args.Error(1) +} + type mockConstructorTestingTNewResourceRepository interface { mock.TestingT Cleanup(func()) @@ -775,6 +980,10 @@ func (m *mockResourceManager) GetURN(res *resource.Resource) (string, error) { return args.Get(0).(string), args.Error(1) } +func (m *mockResourceManager) SyncResource(ctx context.Context, res *resource.Resource) error { + return m.Called(ctx, res).Error(0) +} + type mockConstructorTestingTNewResourceManager interface { mock.TestingT Cleanup(func()) @@ -789,28 +998,32 @@ func newResourceManager(t mockConstructorTestingTNewResourceManager) *mockResour return mock } -type mockTenantDetailsGetter struct { +type mockEventHandler struct { mock.Mock } -func (m *mockTenantDetailsGetter) GetDetails(ctx context.Context, tnnt tenant.Tenant) (*tenant.WithDetails, error) { - args := m.Called(ctx, tnnt) - if args.Get(0) == nil { - return nil, args.Error(1) - } - return args.Get(0).(*tenant.WithDetails), args.Error(1) +func (m *mockEventHandler) HandleEvent(e moderator.Event) { + m.Called(e) } -type mockConstructorTestingTNewTenantDetailsGetter interface { +type mockConstructorEventHandler interface { mock.TestingT Cleanup(func()) } -func newTenantDetailsGetter(t mockConstructorTestingTNewTenantDetailsGetter) *mockTenantDetailsGetter { - mock := &mockTenantDetailsGetter{} +func newEventHandler(t mockConstructorEventHandler) *mockEventHandler { + mock := &mockEventHandler{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } + +type mockDownstreamRefresher struct { + mock.Mock +} + +func (m *mockDownstreamRefresher) RefreshResourceDownstream(ctx context.Context, resourceURNs []job.ResourceURN, logWriter writer.LogWriter) error { + return m.Called(ctx, resourceURNs, logWriter).Error(0) +} diff --git a/core/resource/status.go b/core/resource/status.go index e3f2ab9462..f9d5927ef2 100644 --- a/core/resource/status.go +++ b/core/resource/status.go @@ -60,3 +60,8 @@ func StatusForToUpdate(status Status) bool { func StatusIsSuccess(status Status) bool { return status == StatusSuccess } + +type SyncResponse struct { + ResourceNames []string + IgnoredResources []IgnoredResource +} diff --git a/core/resource/status_test.go b/core/resource/status_test.go index 4f84ff749c..2e7a183657 100644 --- a/core/resource/status_test.go +++ b/core/resource/status_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/resource" + "github.com/raystack/optimus/core/resource" ) func TestStatus(t *testing.T) { diff --git a/core/resource/store.go b/core/resource/store.go index 506e3cc4d9..20daee9973 100644 --- a/core/resource/store.go +++ b/core/resource/store.go @@ -1,6 +1,6 @@ package resource -import "github.com/odpf/optimus/internal/errors" +import "github.com/raystack/optimus/internal/errors" const ( Bigquery Store = "bigquery" diff --git a/core/resource/store_test.go b/core/resource/store_test.go index 7b9cdbd19c..3ea5258f45 100644 --- a/core/resource/store_test.go +++ b/core/resource/store_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/resource" + "github.com/raystack/optimus/core/resource" ) func TestDataStore(t *testing.T) { diff --git a/core/scheduler/event.go b/core/scheduler/event.go index 6de531ccaa..55f32ae4e0 100644 --- a/core/scheduler/event.go +++ b/core/scheduler/event.go @@ -7,9 +7,9 @@ import ( "github.com/mitchellh/mapstructure" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/utils" ) type ( diff --git a/core/scheduler/event_test.go b/core/scheduler/event_test.go index 6896566aa6..955f3319a8 100644 --- a/core/scheduler/event_test.go +++ b/core/scheduler/event_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" ) func TestFromStringToEventType(t *testing.T) { diff --git a/core/scheduler/executor.go b/core/scheduler/executor.go index bfc6f95047..3a3b8df69d 100644 --- a/core/scheduler/executor.go +++ b/core/scheduler/executor.go @@ -4,8 +4,8 @@ import ( "strings" "time" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/utils" ) const ( diff --git a/core/scheduler/executor_test.go b/core/scheduler/executor_test.go index c0c78678a5..edb54dd43c 100644 --- a/core/scheduler/executor_test.go +++ b/core/scheduler/executor_test.go @@ -7,7 +7,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler" ) func TestExecutor(t *testing.T) { diff --git a/core/scheduler/handler/v1beta1/job_run.go b/core/scheduler/handler/v1beta1/job_run.go index 4ad3afbcc8..c72a7ff7a2 100644 --- a/core/scheduler/handler/v1beta1/job_run.go +++ b/core/scheduler/handler/v1beta1/job_run.go @@ -2,15 +2,14 @@ package v1beta1 import ( "context" - "encoding/json" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type JobRunService interface { @@ -35,31 +34,37 @@ type JobRunHandler struct { func (h JobRunHandler) JobRunInput(ctx context.Context, req *pb.JobRunInputRequest) (*pb.JobRunInputResponse, error) { projectName, err := tenant.ProjectNameFrom(req.GetProjectName()) if err != nil { + h.l.Error("error adapting project name [%s]: %s", req.GetProjectName(), err) return nil, errors.GRPCErr(err, "unable to get job run input for "+req.GetJobName()) } jobName, err := scheduler.JobNameFrom(req.GetJobName()) if err != nil { + h.l.Error("error adapting job name [%s]: %s", req.GetJobName(), err) return nil, errors.GRPCErr(err, "unable to get job run input for "+req.GetJobName()) } executor, err := scheduler.ExecutorFromEnum(req.InstanceName, req.InstanceType.String()) if err != nil { + h.l.Error("error adapting executor: %s", err) return nil, errors.GRPCErr(err, "unable to get job run input for "+req.GetJobName()) } err = req.ScheduledAt.CheckValid() if err != nil { + h.l.Error("invalid scheduled at: %s", err) return nil, errors.GRPCErr(errors.InvalidArgument(scheduler.EntityJobRun, "invalid scheduled_at"), "unable to get job run input for "+req.GetJobName()) } runConfig, err := scheduler.RunConfigFrom(executor, req.ScheduledAt.AsTime(), req.JobrunId) if err != nil { + h.l.Error("error adapting run config: %s", err) return nil, errors.GRPCErr(err, "unable to get job run input for "+req.GetJobName()) } input, err := h.service.JobRunInput(ctx, projectName, jobName, runConfig) if err != nil { + h.l.Error("error getting job run input: %s", err) return nil, errors.GRPCErr(err, "unable to get job run input for "+req.GetJobName()) } @@ -75,22 +80,26 @@ func (h JobRunHandler) JobRunInput(ctx context.Context, req *pb.JobRunInputReque func (h JobRunHandler) JobRun(ctx context.Context, req *pb.JobRunRequest) (*pb.JobRunResponse, error) { projectName, err := tenant.ProjectNameFrom(req.GetProjectName()) if err != nil { + h.l.Error("error adapting project name [%s]: %s", req.GetProjectName(), err) return nil, errors.GRPCErr(err, "unable to get job run for "+req.GetJobName()) } jobName, err := scheduler.JobNameFrom(req.GetJobName()) if err != nil { + h.l.Error("error adapting job name [%s]: %s", req.GetJobName(), err) return nil, errors.GRPCErr(err, "unable to get job run for "+req.GetJobName()) } criteria, err := buildCriteriaForJobRun(req) if err != nil { + h.l.Error("error building job run criteria: %s", err) return nil, errors.GRPCErr(err, "unable to get job run for "+req.GetJobName()) } var jobRuns []*scheduler.JobRunStatus jobRuns, err = h.service.GetJobRuns(ctx, projectName, jobName, criteria) if err != nil { + h.l.Error("error getting job runs: %s", err) return nil, errors.GRPCErr(err, "unable to get job run for "+req.GetJobName()) } @@ -126,15 +135,18 @@ func buildCriteriaForJobRun(req *pb.JobRunRequest) (*scheduler.JobRunsCriteria, }, nil } -func (h JobRunHandler) UploadToScheduler(ctx context.Context, req *pb.UploadToSchedulerRequest) (*pb.UploadToSchedulerResponse, error) { +func (h JobRunHandler) UploadToScheduler(_ context.Context, req *pb.UploadToSchedulerRequest) (*pb.UploadToSchedulerResponse, error) { projectName, err := tenant.ProjectNameFrom(req.GetProjectName()) if err != nil { + h.l.Error("error adapting project name [%s]: %s", req.GetProjectName(), err) return nil, errors.GRPCErr(err, "unable to get projectName") } - err = h.service.UploadToScheduler(ctx, projectName) - if err != nil { - return nil, errors.GRPCErr(err, "\nuploaded to scheduler with error") - } + go func() { + err = h.service.UploadToScheduler(context.Background(), projectName) + if err != nil { + h.l.Error("Finished upload to scheduler with error: %s", err) + } + }() return &pb.UploadToSchedulerResponse{}, nil } @@ -142,33 +154,33 @@ func (h JobRunHandler) UploadToScheduler(ctx context.Context, req *pb.UploadToSc func (h JobRunHandler) RegisterJobEvent(ctx context.Context, req *pb.RegisterJobEventRequest) (*pb.RegisterJobEventResponse, error) { tnnt, err := tenant.NewTenant(req.GetProjectName(), req.GetNamespaceName()) if err != nil { + h.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, errors.GRPCErr(err, "unable to get tenant") } jobName, err := scheduler.JobNameFrom(req.GetJobName()) if err != nil { + h.l.Error("error adapting job name [%s]: %s", jobName, err) return nil, errors.GRPCErr(err, "unable to get job name"+req.GetJobName()) } event, err := scheduler.EventFrom(req.GetEvent().Type.String(), req.GetEvent().Value.AsMap(), jobName, tnnt) if err != nil { + h.l.Error("error adapting event: %s", err) return nil, errors.GRPCErr(err, "unable to parse event") } - multiError := errors.NewMultiError("errors in RegisterJobEvent") + me := errors.NewMultiError("errors in RegisterJobEvent") err = h.service.UpdateJobState(ctx, event) if err != nil { - jobEventByteString, _ := json.Marshal(req.GetEvent()) - h.l.Error(errors.InternalError(scheduler.EntityJobRun, "scheduler could not update job run state, event Payload::"+string(jobEventByteString), err).Error()) - multiError.Append(errors.InternalError(scheduler.EntityJobRun, "scheduler could not update job run state, err:"+err.Error(), err)) + h.l.Error("error updating job run state for Job: %s, Project: %s, eventType: %s, schedule_at: %s, err: %s", jobName, tnnt.ProjectName(), event.Type, event.JobScheduledAt.String(), err.Error()) + me.Append(errors.AddErrContext(err, scheduler.EntityJobRun, "scheduler could not update job run state")) } err = h.notifier.Push(ctx, event) - if err != nil { - multiError.Append(err) - } + me.Append(err) - return &pb.RegisterJobEventResponse{}, errors.MultiToError(multiError) + return &pb.RegisterJobEventResponse{}, me.ToErr() } func NewJobRunHandler(l log.Logger, service JobRunService, notifier Notifier) *JobRunHandler { diff --git a/core/scheduler/handler/v1beta1/job_run_test.go b/core/scheduler/handler/v1beta1/job_run_test.go index 7d49320a04..0142c5cd92 100644 --- a/core/scheduler/handler/v1beta1/job_run_test.go +++ b/core/scheduler/handler/v1beta1/job_run_test.go @@ -6,16 +6,16 @@ import ( "testing" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/protobuf/types/known/structpb" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/handler/v1beta1" - "github.com/odpf/optimus/core/tenant" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/handler/v1beta1" + "github.com/raystack/optimus/core/tenant" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( @@ -356,24 +356,7 @@ func TestJobRunHandler(t *testing.T) { assert.EqualError(t, err, "rpc error: code = InvalidArgument desc = invalid argument for entity project: project name is empty: unable to get projectName") assert.Nil(t, resp) }) - t.Run("should fail deployment if UploadToScheduler service fails", func(t *testing.T) { - namespaceName := "namespace-name" - req := &pb.UploadToSchedulerRequest{ - ProjectName: projectName, - NamespaceName: &namespaceName, - } - jobRunService := new(mockJobRunService) - jobRunService.On("UploadToScheduler", ctx, tenant.ProjectName(projectName)). - Return(fmt.Errorf("some error")) - defer jobRunService.AssertExpectations(t) - jobRunHandler := v1beta1.NewJobRunHandler(logger, jobRunService, nil) - - resp, err := jobRunHandler.UploadToScheduler(ctx, req) - assert.NotNil(t, err) - assert.EqualError(t, err, "rpc error: code = Internal desc = some error: \nuploaded to scheduler with error") - assert.Nil(t, resp) - }) - t.Run("should return success if deployment succeeds", func(t *testing.T) { + t.Run("should return after triggering deploy to scheduler", func(t *testing.T) { namespaceName := "namespace-name" req := &pb.UploadToSchedulerRequest{ ProjectName: projectName, @@ -381,7 +364,6 @@ func TestJobRunHandler(t *testing.T) { } jobRunService := new(mockJobRunService) jobRunService.On("UploadToScheduler", ctx, tenant.ProjectName(projectName)).Return(nil) - defer jobRunService.AssertExpectations(t) jobRunHandler := v1beta1.NewJobRunHandler(logger, jobRunService, nil) _, err := jobRunHandler.UploadToScheduler(ctx, req) @@ -522,7 +504,7 @@ func TestJobRunHandler(t *testing.T) { resp, err := jobRunHandler.RegisterJobEvent(ctx, req) assert.NotNil(t, err) - assert.EqualError(t, err, "errors in RegisterJobEvent:\n internal error for entity jobRun: scheduler could not update job run state, err:some error") + assert.ErrorContains(t, err, "scheduler could not update job run state") assert.Equal(t, &pb.RegisterJobEventResponse{}, resp) }) t.Run("should return error if notify Push fails", func(t *testing.T) { diff --git a/core/scheduler/handler/v1beta1/replay.go b/core/scheduler/handler/v1beta1/replay.go index cca0da6ffa..2aa675b5dd 100644 --- a/core/scheduler/handler/v1beta1/replay.go +++ b/core/scheduler/handler/v1beta1/replay.go @@ -1,21 +1,23 @@ package v1beta1 import ( - "fmt" "strings" "github.com/google/uuid" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "golang.org/x/net/context" + "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type ReplayService interface { CreateReplay(ctx context.Context, tenant tenant.Tenant, jobName scheduler.JobName, config *scheduler.ReplayConfig) (replayID uuid.UUID, err error) + GetReplayList(ctx context.Context, projectName tenant.ProjectName) (replays []*scheduler.Replay, err error) + GetReplayByID(ctx context.Context, replayID uuid.UUID) (replay *scheduler.ReplayWithRun, err error) } type ReplayHandler struct { @@ -28,20 +30,24 @@ type ReplayHandler struct { func (h ReplayHandler) Replay(ctx context.Context, req *pb.ReplayRequest) (*pb.ReplayResponse, error) { replayTenant, err := tenant.NewTenant(req.GetProjectName(), req.NamespaceName) if err != nil { + h.l.Error("invalid tenant information request project [%s] namespace [%s]: %s", req.GetProjectName(), req.GetNamespaceName(), err) return nil, errors.GRPCErr(err, "unable to start replay for "+req.GetJobName()) } jobName, err := scheduler.JobNameFrom(req.GetJobName()) if err != nil { + h.l.Error("error adapting job name [%s]: %s", req.GetJobName(), err) return nil, errors.GRPCErr(err, "unable to start replay for "+req.GetJobName()) } if err = req.GetStartTime().CheckValid(); err != nil { + h.l.Error("error validating start time: %s", err) return nil, errors.GRPCErr(errors.InvalidArgument(scheduler.EntityJobRun, "invalid start_time"), "unable to start replay for "+req.GetJobName()) } if req.GetEndTime() != nil { if err = req.GetEndTime().CheckValid(); err != nil { + h.l.Error("error validating end time: %s", err) return nil, errors.GRPCErr(errors.InvalidArgument(scheduler.EntityJobRun, "invalid end_time"), "unable to start replay for "+req.GetJobName()) } } @@ -50,6 +56,7 @@ func (h ReplayHandler) Replay(ctx context.Context, req *pb.ReplayRequest) (*pb.R if req.JobConfig != "" { jobConfig, err = parseJobConfig(req.JobConfig) if err != nil { + h.l.Error("error parsing job config: %s", err) return nil, errors.GRPCErr(err, "unable to parse replay job config for "+req.JobName) } } @@ -57,19 +64,88 @@ func (h ReplayHandler) Replay(ctx context.Context, req *pb.ReplayRequest) (*pb.R replayConfig := scheduler.NewReplayConfig(req.GetStartTime().AsTime(), req.GetEndTime().AsTime(), req.Parallel, jobConfig, req.Description) replayID, err := h.service.CreateReplay(ctx, replayTenant, jobName, replayConfig) if err != nil { + h.l.Error("error creating replay for job [%s]: %s", jobName, err) return nil, errors.GRPCErr(err, "unable to start replay for "+req.GetJobName()) } return &pb.ReplayResponse{Id: replayID.String()}, nil } +func (h ReplayHandler) ListReplay(ctx context.Context, req *pb.ListReplayRequest) (*pb.ListReplayResponse, error) { + projectName, err := tenant.ProjectNameFrom(req.GetProjectName()) + if err != nil { + h.l.Error("error adapting project name [%s]: %s", req.GetProjectName(), err) + return nil, errors.GRPCErr(err, "unable to get replay list for "+req.GetProjectName()) + } + + replays, err := h.service.GetReplayList(ctx, projectName) + if err != nil { + h.l.Error("error getting replay list for project [%s]: %s", projectName, err) + return nil, errors.GRPCErr(err, "unable to get replay list for "+req.GetProjectName()) + } + + replayProtos := make([]*pb.GetReplayResponse, len(replays)) + for i, replay := range replays { + replayProtos[i] = replayToProto(replay) + } + + return &pb.ListReplayResponse{Replays: replayProtos}, nil +} + +func (h ReplayHandler) GetReplay(ctx context.Context, req *pb.GetReplayRequest) (*pb.GetReplayResponse, error) { + id, err := uuid.Parse(req.GetReplayId()) + if err != nil { + h.l.Error("error parsing replay id [%s]: %s", req.GetReplayId(), err) + err = errors.InvalidArgument(scheduler.EntityReplay, err.Error()) + return nil, errors.GRPCErr(err, "unable to get replay for replayID "+req.GetReplayId()) + } + + replay, err := h.service.GetReplayByID(ctx, id) + if err != nil { + if errors.IsErrorType(err, errors.ErrNotFound) { + h.l.Warn("replay with id [%s] is not found", id.String()) + return &pb.GetReplayResponse{}, nil + } + h.l.Error("error getting replay with id [%s]: %s", id.String(), err) + return nil, errors.GRPCErr(err, "unable to get replay for replayID "+req.GetReplayId()) + } + + runs := make([]*pb.ReplayRun, len(replay.Runs)) + for i, run := range replay.Runs { + runs[i] = &pb.ReplayRun{ + ScheduledAt: timestamppb.New(run.ScheduledAt), + Status: run.State.String(), + } + } + + replayProto := replayToProto(replay.Replay) + replayProto.ReplayRuns = runs + + return replayProto, nil +} + +func replayToProto(replay *scheduler.Replay) *pb.GetReplayResponse { + return &pb.GetReplayResponse{ + Id: replay.ID().String(), + JobName: replay.JobName().String(), + Status: replay.UserState().String(), + ReplayConfig: &pb.ReplayConfig{ + StartTime: timestamppb.New(replay.Config().StartTime), + EndTime: timestamppb.New(replay.Config().EndTime), + Parallel: replay.Config().Parallel, + JobConfig: replay.Config().JobConfig, + Description: replay.Config().Description, + }, + } +} + func parseJobConfig(jobConfig string) (map[string]string, error) { configs := map[string]string{} for _, config := range strings.Split(jobConfig, ",") { keyValue := strings.Split(config, "=") valueLen := 2 if len(keyValue) != valueLen { - return nil, fmt.Errorf("error on job config value, %s", config) + return nil, errors.InvalidArgument(scheduler.EntityReplay, "error on job config value, "+config) } key := strings.TrimSpace(strings.ToUpper(keyValue[0])) value := keyValue[1] diff --git a/core/scheduler/handler/v1beta1/replay_test.go b/core/scheduler/handler/v1beta1/replay_test.go index 5d53b70727..65abf3408b 100644 --- a/core/scheduler/handler/v1beta1/replay_test.go +++ b/core/scheduler/handler/v1beta1/replay_test.go @@ -7,15 +7,16 @@ import ( "time" "github.com/google/uuid" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/handler/v1beta1" - "github.com/odpf/optimus/core/tenant" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/handler/v1beta1" + "github.com/raystack/optimus/core/tenant" + errs "github.com/raystack/optimus/internal/errors" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) func TestReplayHandler(t *testing.T) { @@ -196,6 +197,156 @@ func TestReplayHandler(t *testing.T) { assert.Nil(t, result) }) }) + + t.Run("GetReplayList", func(t *testing.T) { + t.Run("return error when project name is not provided", func(t *testing.T) { + service := new(mockReplayService) + defer service.AssertExpectations(t) + + replayHandler := v1beta1.NewReplayHandler(logger, service) + + req := &pb.ListReplayRequest{ + ProjectName: "", + } + + result, err := replayHandler.ListReplay(ctx, req) + assert.ErrorContains(t, err, "project name is empty") + assert.Nil(t, result) + }) + t.Run("return error when get replay list failed", func(t *testing.T) { + service := new(mockReplayService) + service.On("GetReplayList", ctx, tenant.ProjectName("project-test")).Return(nil, errors.New("some error")) + defer service.AssertExpectations(t) + + replayHandler := v1beta1.NewReplayHandler(logger, service) + + req := &pb.ListReplayRequest{ + ProjectName: "project-test", + } + + result, err := replayHandler.ListReplay(ctx, req) + assert.Error(t, err) + assert.Nil(t, result) + }) + t.Run("return empty list when no replay found in project", func(t *testing.T) { + service := new(mockReplayService) + service.On("GetReplayList", ctx, tenant.ProjectName("project-test")).Return([]*scheduler.Replay{}, nil) + defer service.AssertExpectations(t) + + replayHandler := v1beta1.NewReplayHandler(logger, service) + + req := &pb.ListReplayRequest{ + ProjectName: "project-test", + } + + result, err := replayHandler.ListReplay(ctx, req) + assert.NoError(t, err) + assert.Empty(t, result.Replays) + }) + t.Run("return replay list when success", func(t *testing.T) { + tnnt, _ := tenant.NewTenant("project-test", "ns-1") + startTimeStr := "2023-01-02T15:00:00Z" + startTime, _ := time.Parse(scheduler.ISODateFormat, startTimeStr) + endTime := startTime.Add(48 * time.Hour) + replayConfig := scheduler.NewReplayConfig(startTime, endTime, true, map[string]string{}, description) + + replay1 := scheduler.NewReplayRequest("sample-job-A", tnnt, replayConfig, scheduler.ReplayStateInProgress) + replay2 := scheduler.NewReplayRequest("sample-job-B", tnnt, replayConfig, scheduler.ReplayStateCreated) + replay3 := scheduler.NewReplayRequest("sample-job-C", tnnt, replayConfig, scheduler.ReplayStateFailed) + service := new(mockReplayService) + service.On("GetReplayList", ctx, tenant.ProjectName("project-test")).Return([]*scheduler.Replay{replay1, replay2, replay3}, nil) + defer service.AssertExpectations(t) + + replayHandler := v1beta1.NewReplayHandler(logger, service) + + req := &pb.ListReplayRequest{ + ProjectName: "project-test", + } + + result, err := replayHandler.ListReplay(ctx, req) + assert.NoError(t, err) + assert.Len(t, result.Replays, 3) + }) + }) + + t.Run("GetReplay", func(t *testing.T) { + t.Run("returns error when uuid is not valid", func(t *testing.T) { + replayHandler := v1beta1.NewReplayHandler(logger, nil) + + req := &pb.GetReplayRequest{ + ProjectName: projectName, + ReplayId: "invalid-id", + } + result, err := replayHandler.GetReplay(ctx, req) + assert.ErrorContains(t, err, "invalid UUID") + assert.Nil(t, result) + }) + t.Run("returns error when service get replay by id is failed", func(t *testing.T) { + service := new(mockReplayService) + defer service.AssertExpectations(t) + + replayID := uuid.New() + service.On("GetReplayByID", ctx, replayID).Return(nil, errors.New("internal error")) + + replayHandler := v1beta1.NewReplayHandler(logger, service) + + req := &pb.GetReplayRequest{ + ProjectName: projectName, + ReplayId: replayID.String(), + } + result, err := replayHandler.GetReplay(ctx, req) + assert.ErrorContains(t, err, "internal error") + assert.Nil(t, result) + }) + t.Run("returns empty if replay not exist", func(t *testing.T) { + service := new(mockReplayService) + defer service.AssertExpectations(t) + + replayID := uuid.New() + service.On("GetReplayByID", ctx, replayID).Return(nil, errs.NotFound("entity", "not found")) + + replayHandler := v1beta1.NewReplayHandler(logger, service) + + req := &pb.GetReplayRequest{ + ProjectName: projectName, + ReplayId: replayID.String(), + } + result, err := replayHandler.GetReplay(ctx, req) + assert.NoError(t, err) + assert.Empty(t, result) + }) + t.Run("returns success if replay is exist", func(t *testing.T) { + service := new(mockReplayService) + defer service.AssertExpectations(t) + + replayID := uuid.New() + tnnt, _ := tenant.NewTenant("project-test", "ns-1") + startTimeStr := "2023-01-02T15:00:00Z" + startTime, _ := time.Parse(scheduler.ISODateFormat, startTimeStr) + endTime := startTime.Add(48 * time.Hour) + replayConfig := scheduler.NewReplayConfig(startTime, endTime, true, map[string]string{}, description) + replay := scheduler.NewReplay(replayID, "sample-job-A", tnnt, replayConfig, scheduler.ReplayStateInProgress, startTime) + service.On("GetReplayByID", ctx, replayID).Return(&scheduler.ReplayWithRun{ + Replay: replay, + Runs: []*scheduler.JobRunStatus{ + { + ScheduledAt: startTime, + State: scheduler.StatePending, + }, + }, + }, nil) + + replayHandler := v1beta1.NewReplayHandler(logger, service) + + req := &pb.GetReplayRequest{ + ProjectName: projectName, + ReplayId: replayID.String(), + } + result, err := replayHandler.GetReplay(ctx, req) + assert.NoError(t, err) + assert.NotEmpty(t, result) + }) + }) } // mockReplayService is an autogenerated mock type for the ReplayService type @@ -203,6 +354,32 @@ type mockReplayService struct { mock.Mock } +// GetReplayByID provides a mock function with given fields: ctx, replayID +func (_m *mockReplayService) GetReplayByID(ctx context.Context, replayID uuid.UUID) (*scheduler.ReplayWithRun, error) { + ret := _m.Called(ctx, replayID) + + var r0 *scheduler.ReplayWithRun + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID) (*scheduler.ReplayWithRun, error)); ok { + return rf(ctx, replayID) + } + if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID) *scheduler.ReplayWithRun); ok { + r0 = rf(ctx, replayID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*scheduler.ReplayWithRun) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uuid.UUID) error); ok { + r1 = rf(ctx, replayID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // CreateReplay provides a mock function with given fields: ctx, _a1, jobName, config func (_m *mockReplayService) CreateReplay(ctx context.Context, _a1 tenant.Tenant, jobName scheduler.JobName, config *scheduler.ReplayConfig) (uuid.UUID, error) { ret := _m.Called(ctx, _a1, jobName, config) @@ -225,3 +402,29 @@ func (_m *mockReplayService) CreateReplay(ctx context.Context, _a1 tenant.Tenant return r0, r1 } + +// GetReplayList provides a mock function with given fields: ctx, projectName +func (_m *mockReplayService) GetReplayList(ctx context.Context, projectName tenant.ProjectName) ([]*scheduler.Replay, error) { + ret := _m.Called(ctx, projectName) + + var r0 []*scheduler.Replay + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, tenant.ProjectName) ([]*scheduler.Replay, error)); ok { + return rf(ctx, projectName) + } + if rf, ok := ret.Get(0).(func(context.Context, tenant.ProjectName) []*scheduler.Replay); ok { + r0 = rf(ctx, projectName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*scheduler.Replay) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, tenant.ProjectName) error); ok { + r1 = rf(ctx, projectName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/core/scheduler/job.go b/core/scheduler/job.go index 197735e33d..1c4458e942 100644 --- a/core/scheduler/job.go +++ b/core/scheduler/job.go @@ -5,9 +5,9 @@ import ( "strings" "time" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/models" ) type ( @@ -125,7 +125,6 @@ type JobMetadata struct { type Schedule struct { DependsOnPast bool - CatchUp bool StartDate time.Time EndDate *time.Time Interval string @@ -139,6 +138,18 @@ func (j *JobWithDetails) GetLabelsAsString() string { return strings.TrimRight(labels, ",") } +func (j *JobWithDetails) GetUniqueLabelValues() []string { + labelValues := []string{} + m := map[string]bool{} + for _, v := range j.JobMetadata.Labels { + if _, ok := m[v]; !ok { + labelValues = append(labelValues, v) + } + m[v] = true + } + return labelValues +} + type Retry struct { ExponentialBackoff bool Count int diff --git a/core/scheduler/job_run.go b/core/scheduler/job_run.go index 25304e1afd..015d68e3ed 100644 --- a/core/scheduler/job_run.go +++ b/core/scheduler/job_run.go @@ -5,8 +5,8 @@ import ( "github.com/google/uuid" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) type JobRunID uuid.UUID @@ -35,12 +35,13 @@ func (i JobRunID) IsEmpty() bool { type JobRun struct { ID uuid.UUID - JobName JobName - Tenant tenant.Tenant - State State - StartTime time.Time - SLAAlert bool - EndTime time.Time + JobName JobName + Tenant tenant.Tenant + State State + ScheduledAt time.Time + StartTime time.Time + SLAAlert bool + EndTime time.Time Monitoring map[string]any } @@ -61,3 +62,9 @@ type NotifyAttrs struct { Route string Secret string } + +const ( + MetricNotificationQueue = "notification_queue_total" + MetricNotificationWorkerBatch = "notification_worker_batch_total" + MetricNotificationWorkerSendErr = "notification_worker_send_err_total" +) diff --git a/core/scheduler/job_test.go b/core/scheduler/job_test.go index 5f5bca9d78..c77375625d 100644 --- a/core/scheduler/job_test.go +++ b/core/scheduler/job_test.go @@ -6,8 +6,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" ) func TestJob(t *testing.T) { @@ -136,6 +136,20 @@ func TestJob(t *testing.T) { labels := jobWithDetails.GetLabelsAsString() assert.Equal(t, labels, "label1=someVale") }) + t.Run("GetUniqueLabelValues", func(t *testing.T) { + jobWithDetails := scheduler.JobWithDetails{ + Name: "jobName", + JobMetadata: &scheduler.JobMetadata{ + Labels: map[string]string{ + "label1": "someVale", + "label2": "someVale", + "label3": "another", + }, + }, + } + labels := jobWithDetails.GetUniqueLabelValues() + assert.ElementsMatch(t, labels, []string{"someVale", "another"}) + }) t.Run("GroupJobsByTenant", func(t *testing.T) { t1, _ := tenant.NewTenant("proj", "ns1") t2, _ := tenant.NewTenant("proj", "ns1") diff --git a/core/scheduler/replay.go b/core/scheduler/replay.go index 8cd3b1942f..fdce7c3f0e 100644 --- a/core/scheduler/replay.go +++ b/core/scheduler/replay.go @@ -1,29 +1,43 @@ package scheduler import ( - "sort" "strings" "time" "github.com/google/uuid" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( + // initial state ReplayStateCreated ReplayState = "created" + // running state ReplayStateInProgress ReplayState = "in progress" - ReplayStateInvalid ReplayState = "invalid" ReplayStatePartialReplayed ReplayState = "partial replayed" ReplayStateReplayed ReplayState = "replayed" + // terminal state + ReplayStateInvalid ReplayState = "invalid" ReplayStateSuccess ReplayState = "success" ReplayStateFailed ReplayState = "failed" + + // state on presentation layer + ReplayUserStateCreated ReplayUserState = "created" + ReplayUserStateInProgress ReplayUserState = "in progress" + ReplayUserStateInvalid ReplayUserState = "invalid" + ReplayUserStateSuccess ReplayUserState = "success" + ReplayUserStateFailed ReplayUserState = "failed" + + EntityReplay = "replay" ) -type ReplayState string +type ( + ReplayState string // contract status for business layer + ReplayUserState string // contract status for presentation layer +) func ReplayStateFromString(state string) (ReplayState, error) { switch strings.ToLower(state) { @@ -50,6 +64,10 @@ func (j ReplayState) String() string { return string(j) } +func (j ReplayUserState) String() string { + return string(j) +} + type Replay struct { id uuid.UUID @@ -83,6 +101,23 @@ func (r *Replay) State() ReplayState { return r.state } +func (r *Replay) UserState() ReplayUserState { + switch r.state { + case ReplayStateCreated: + return ReplayUserStateCreated + case ReplayStateInProgress, ReplayStatePartialReplayed, ReplayStateReplayed: + return ReplayUserStateInProgress + case ReplayStateInvalid: + return ReplayUserStateInvalid + case ReplayStateSuccess: + return ReplayUserStateSuccess + case ReplayStateFailed: + return ReplayUserStateFailed + default: + return "" + } +} + func (r *Replay) Message() string { return r.message } @@ -105,17 +140,19 @@ type ReplayWithRun struct { } func (r *ReplayWithRun) GetFirstExecutableRun() *JobRunStatus { - sort.Slice(r.Runs, func(i, j int) bool { - return r.Runs[i].ScheduledAt.Before(r.Runs[j].ScheduledAt) - }) - return r.Runs[0] + runs := JobRunStatusList(r.Runs).GetSortedRunsByStates([]State{StatePending}) + if len(runs) > 0 { + return runs[0] + } + return nil } func (r *ReplayWithRun) GetLastExecutableRun() *JobRunStatus { - sort.Slice(r.Runs, func(i, j int) bool { - return r.Runs[i].ScheduledAt.After(r.Runs[j].ScheduledAt) - }) - return r.Runs[0] + runs := JobRunStatusList(r.Runs).GetSortedRunsByStates([]State{StatePending}) + if len(runs) > 0 { + return runs[len(runs)-1] + } + return nil } type ReplayConfig struct { diff --git a/core/scheduler/replay_test.go b/core/scheduler/replay_test.go index d30e0cde74..8c9a2436c6 100644 --- a/core/scheduler/replay_test.go +++ b/core/scheduler/replay_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" ) func TestReplay(t *testing.T) { @@ -26,6 +26,8 @@ func TestReplay(t *testing.T) { scheduledTimeStr1 := "2023-01-02T12:00:00Z" scheduledTime1, _ := time.Parse(scheduler.ISODateFormat, scheduledTimeStr1) scheduledTime2 := scheduledTime1.Add(24 * time.Hour) + scheduledTime3 := scheduledTime1.Add(2 * 24 * time.Hour) + scheduledTime4 := scheduledTime1.Add(3 * 24 * time.Hour) t.Run("NewReplay", func(t *testing.T) { createdTime := time.Now() @@ -54,12 +56,20 @@ func TestReplay(t *testing.T) { t.Run("ReplayWithRun", func(t *testing.T) { firstRun := &scheduler.JobRunStatus{ ScheduledAt: scheduledTime1, - State: scheduler.StatePending, + State: scheduler.StateInProgress, } secondRun := &scheduler.JobRunStatus{ ScheduledAt: scheduledTime2, State: scheduler.StatePending, } + thirdRun := &scheduler.JobRunStatus{ + ScheduledAt: scheduledTime3, + State: scheduler.StatePending, + } + fourthRun := &scheduler.JobRunStatus{ + ScheduledAt: scheduledTime4, + State: scheduler.StateInProgress, + } t.Run("GetFirstExecutableRun", func(t *testing.T) { replay := scheduler.NewReplay(replayID, jobNameA, tnnt, replayConfig, scheduler.ReplayStateCreated, time.Now()) @@ -68,10 +78,12 @@ func TestReplay(t *testing.T) { Runs: []*scheduler.JobRunStatus{ firstRun, secondRun, + thirdRun, + fourthRun, }, } firstExecutableRun := replayWithRun.GetFirstExecutableRun() - assert.Equal(t, firstRun, firstExecutableRun) + assert.Equal(t, firstExecutableRun, secondRun) }) t.Run("GetLastExecutableRun", func(t *testing.T) { replay := scheduler.NewReplay(replayID, jobNameA, tnnt, replayConfig, scheduler.ReplayStateCreated, time.Now()) @@ -80,10 +92,12 @@ func TestReplay(t *testing.T) { Runs: []*scheduler.JobRunStatus{ firstRun, secondRun, + thirdRun, + fourthRun, }, } lastExecutableRun := replayWithRun.GetLastExecutableRun() - assert.Equal(t, secondRun, lastExecutableRun) + assert.Equal(t, lastExecutableRun, thirdRun) }) }) diff --git a/core/scheduler/resolver/priority_resolver.go b/core/scheduler/resolver/priority_resolver.go deleted file mode 100644 index f02e318142..0000000000 --- a/core/scheduler/resolver/priority_resolver.go +++ /dev/null @@ -1,144 +0,0 @@ -package resolver - -import ( - "context" - "errors" - "fmt" - - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/internal/lib/tree" -) - -const ( - // MinPriorityWeight - what's the minimum weight that we want to give to a DAG. - // airflow also sets the default priority weight as 1 - MinPriorityWeight = 1 - - // MaxPriorityWeight - is the maximus weight a DAG will be given. - MaxPriorityWeight = 10000 - - // PriorityWeightGap - while giving weights to the DAG, what's the GAP - // do we want to consider. PriorityWeightGap = 1 means, weights will be 1, 2, 3 etc. - PriorityWeightGap = 10 -) - -// ErrPriorityNotFound is thrown when priority of a given spec is not found -var ErrPriorityNotFound = errors.New("priority weight not found") - -// PriorityResolver runs a breadth first traversal on DAG/Job dependencies trees -// and returns highest weight for the DAG that do not have any dependencies, dynamically. -// eg, consider following DAGs and dependencies: [dag1 <- dag2 <- dag3] [dag4] [dag5 <- dag6] -// In this example, we've 6 DAGs in which dag1, dag2, dag5 have dependent DAGs. which means, -// It'd be preferable to run dag1, dag4, dag5 before other DAGs. Results would be: -// dag1, dag4, dag5 will get highest weight (maxWeight) -// dag2, dag6 will get weight of maxWeight-1 -// dag3 will get maxWeight-2 -// Note: it's crucial that dependencies of all Jobs are already resolved -type PriorityResolver struct{} - -// NewPriorityResolver create an instance of PriorityResolver -func NewPriorityResolver() *PriorityResolver { - return &PriorityResolver{} -} - -// Resolve takes jobsWithDetails and returns them with resolved priorities -func (a *PriorityResolver) Resolve(_ context.Context, jobWithDetails []*scheduler.JobWithDetails) error { - if err := a.resolvePriorities(jobWithDetails); err != nil { - return fmt.Errorf("error occurred while resolving priority: %w", err) - } - return nil -} - -// resolvePriorities resolves priorities of all provided jobs -func (a *PriorityResolver) resolvePriorities(jobsWithDetails []*scheduler.JobWithDetails) error { - // build a multi-root tree from all jobs based on their dependencies - multiRootTree, err := a.buildMultiRootDependencyTree(jobsWithDetails) - if err != nil { - return err - } - - // perform a breadth first traversal on all trees and assign weights. - // higher weights are assign to the nodes on the top, and the weight - // reduces as we go down the tree level - taskPriorityMap := map[string]int{} - a.assignWeight(multiRootTree.GetRootNodes(), MaxPriorityWeight, taskPriorityMap) - - for _, jobWithDetails := range jobsWithDetails { - priority, ok := taskPriorityMap[jobWithDetails.Name.String()] - if !ok { - return fmt.Errorf("%s: %w", jobWithDetails.Name, ErrPriorityNotFound) - } - jobWithDetails.Priority = priority - } - - return nil -} - -func (a *PriorityResolver) assignWeight(rootNodes []*tree.TreeNode, weight int, taskPriorityMap map[string]int) { - subChildren := []*tree.TreeNode{} - for _, rootNode := range rootNodes { - taskPriorityMap[rootNode.GetName()] = weight - subChildren = append(subChildren, rootNode.Dependents...) - } - if len(subChildren) > 0 { - a.assignWeight(subChildren, weight-PriorityWeightGap, taskPriorityMap) - } -} - -// buildMultiRootDependencyTree - converts []jobWithDetails into a MultiRootTree -// based on the dependencies of each DAG. -func (a *PriorityResolver) buildMultiRootDependencyTree(jobsWithDetails []*scheduler.JobWithDetails) (*tree.MultiRootTree, error) { - // creates map[jobName]jobWithDetails for faster retrieval - jobWithDetailsMap := make(map[string]*scheduler.JobWithDetails) - for _, dagSpec := range jobsWithDetails { - jobWithDetailsMap[dagSpec.Name.String()] = dagSpec - } - - // build a multi root tree and assign dependencies - // ignore any other dependency apart from intra-tenant - multiRootTree := tree.NewMultiRootTree() - for _, childSpec := range jobWithDetailsMap { - childNode := a.findOrCreateDAGNode(multiRootTree, childSpec) - for _, upstream := range childSpec.Upstreams.UpstreamJobs { - missingParent := false - parentSpec, ok := jobWithDetailsMap[upstream.JobName] - if !ok { - // when the dependency of a jobWithDetails belong to some other tenant or is external, the jobWithDetails won't - // be available in jobsWithDetails []job_run.jobWithDetails object (which is tenant specific) - // so we'll add a dummy jobWithDetails for that cross tenant/external dependency. - parentSpec = &scheduler.JobWithDetails{ - Name: scheduler.JobName(upstream.JobName), - Upstreams: scheduler.Upstreams{}, - } - missingParent = true - } - parentNode := a.findOrCreateDAGNode(multiRootTree, parentSpec) - parentNode.AddDependent(childNode) - multiRootTree.AddNode(parentNode) - if missingParent { - // dependency that are outside current project will be considered as root because - // optimus don't know dependencies of those external parents - multiRootTree.MarkRoot(parentNode) - } - } - - // the DAGs with no dependencies are root nodes for the tree - if len(childSpec.Upstreams.UpstreamJobs) == 0 { - multiRootTree.MarkRoot(childNode) - } - } - - if _, err := multiRootTree.ValidateCyclic(); err != nil { - return nil, err - } - return multiRootTree, nil -} - -func (*PriorityResolver) findOrCreateDAGNode(dagTree *tree.MultiRootTree, jobDetails *scheduler.JobWithDetails) *tree.TreeNode { - node, ok := dagTree.GetNodeByName(jobDetails.Name.String()) - if !ok { - node = tree.NewTreeNode(jobDetails) - dagTree.AddNode(node) - } - return node -} diff --git a/core/scheduler/resolver/priority_resolver_test.go b/core/scheduler/resolver/priority_resolver_test.go deleted file mode 100644 index c8f9e06d5c..0000000000 --- a/core/scheduler/resolver/priority_resolver_test.go +++ /dev/null @@ -1,463 +0,0 @@ -package resolver_test - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/resolver" - "github.com/odpf/optimus/internal/lib/tree" -) - -func getJobWithUpstream(name string, upstreams ...string) *scheduler.JobWithDetails { - var jobUpstreams []*scheduler.JobUpstream - for _, n := range upstreams { - jobUpstreams = append(jobUpstreams, &scheduler.JobUpstream{ - JobName: n, - }) - } - return &scheduler.JobWithDetails{ - Name: scheduler.JobName(name), - Upstreams: scheduler.Upstreams{UpstreamJobs: jobUpstreams}, - } -} - -func TestPriorityWeightResolver(t *testing.T) { - // noDependency := job_run.Upstreams{} - ctx := context.Background() - - t.Run("Resolve should assign correct weights to the DAGs with mentioned dependencies", func(t *testing.T) { - spec1 := "dag1-no-deps" - spec2 := "dag2-deps-on-dag1" - spec3 := "dag3-deps-on-dag2" - spec4 := "dag4-no-deps" - spec5 := "dag5-deps-on-dag1" - spec6 := "dag6-no-deps" - spec7 := "dag7-deps-on-dag6" - spec8 := "dag8-no-deps" - spec9 := "dag9-deps-on-dag8" - spec10 := "dag10-deps-on-dag9" - spec11 := "dag11-deps-on-dag10" - - s1 := getJobWithUpstream(spec1) - s2 := getJobWithUpstream(spec2, spec1) - s3 := getJobWithUpstream(spec3, spec2) - s4 := getJobWithUpstream(spec4) - s5 := getJobWithUpstream(spec5, spec1) - s6 := getJobWithUpstream(spec6) - s7 := getJobWithUpstream(spec7, spec6) - s8 := getJobWithUpstream(spec8) - s9 := getJobWithUpstream(spec9, spec8) - s10 := getJobWithUpstream(spec10, spec9) - s11 := getJobWithUpstream(spec11, spec10) - - dagSpec := []*scheduler.JobWithDetails{s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11} - assigner := resolver.NewPriorityResolver() - err := assigner.Resolve(ctx, dagSpec) - assert.Nil(t, err) - - max := resolver.MaxPriorityWeight - max1 := max - resolver.PriorityWeightGap*1 - max2 := max - resolver.PriorityWeightGap*2 - max3 := max - resolver.PriorityWeightGap*3 - expectedWeights := map[scheduler.JobName]int{ - s1.Name: max, s2.Name: max1, s3.Name: max2, s4.Name: max, s5.Name: max1, - s6.Name: max, s7.Name: max1, s8.Name: max, s9.Name: max1, s10.Name: max2, s11.Name: max3, - } - - for _, jobSpec := range dagSpec { - assert.Equal(t, expectedWeights[jobSpec.Name], jobSpec.Priority) - } - }) - - t.Run("Resolve should assign correct weights to the DAGs with mentioned dependencies", func(t *testing.T) { - // run the test multiple times - for i := 1; i < 10; i++ { - spec1 := "dag1" - spec11 := "dag1-1" - spec12 := "dag1-2" - spec111 := "dag1-1-1" - spec112 := "dag1-1-2" - spec121 := "dag1-2-1" - spec122 := "dag1-2-2" - s1 := getJobWithUpstream(spec1) - s11 := getJobWithUpstream(spec11, spec1) - s12 := getJobWithUpstream(spec12, spec1) - s111 := getJobWithUpstream(spec111, spec11) - s112 := getJobWithUpstream(spec112, spec12) - s121 := getJobWithUpstream(spec121, spec12) - s122 := getJobWithUpstream(spec122, spec12) - - spec2 := "dag2" - spec21 := "dag2-1" - spec22 := "dag2-2" - spec211 := "dag2-1-1" - spec212 := "dag2-1-2" - spec221 := "dag2-2-1" - spec222 := "dag2-2-2" - s2 := getJobWithUpstream(spec2) - s21 := getJobWithUpstream(spec21, spec2) - s22 := getJobWithUpstream(spec22, spec2) - s211 := getJobWithUpstream(spec211, spec21) - s212 := getJobWithUpstream(spec212, spec21) - s221 := getJobWithUpstream(spec221, spec22) - s222 := getJobWithUpstream(spec222, spec22) - - dagSpec := []*scheduler.JobWithDetails{s1, s11, s12, s111, s112, s121, s122, s2, s21, s22, s211, s212, s221, s222} - - assigner := resolver.NewPriorityResolver() - err := assigner.Resolve(ctx, dagSpec) - assert.Nil(t, err) - - max := resolver.MaxPriorityWeight - max1 := max - resolver.PriorityWeightGap*1 - max2 := max - resolver.PriorityWeightGap*2 - expectedWeights := map[string]int{ - spec1: max, spec11: max1, spec12: max1, spec111: max2, spec112: max2, spec121: max2, spec122: max2, - spec2: max, spec21: max1, spec22: max1, spec211: max2, spec212: max2, spec221: max2, spec222: max2, - } - - for _, jobSpec := range dagSpec { - assert.Equal(t, expectedWeights[jobSpec.Name.String()], jobSpec.Priority) - } - } - }) - - t.Run("Resolve should assign correct weights to the DAGs with mentioned dependencies", func(t *testing.T) { - spec1 := "dag1-no-deps" - spec2 := "dag2-deps-on-dag1" - spec3 := "dag3-deps-on-dag2" - spec4 := "dag4-no-deps" - spec5 := "dag5-deps-on-dag1" - - s1 := getJobWithUpstream(spec1) - s2 := getJobWithUpstream(spec2, spec1) - s3 := getJobWithUpstream(spec3, spec2) - s4 := getJobWithUpstream(spec4) - s5 := getJobWithUpstream(spec5, spec1) - dagSpec := []*scheduler.JobWithDetails{s1, s2, s3, s4, s5} - assigner := resolver.NewPriorityResolver() - err := assigner.Resolve(ctx, dagSpec) - assert.Nil(t, err) - - max := resolver.MaxPriorityWeight - max1 := max - resolver.PriorityWeightGap*1 - max2 := max - resolver.PriorityWeightGap*2 - expectedWeights := map[string]int{spec1: max, spec2: max1, spec3: max2, spec4: max, spec5: max1} - - for _, jobSpec := range dagSpec { - assert.Equal(t, expectedWeights[jobSpec.Name.String()], jobSpec.Priority) - } - }) - - t.Run("Resolve should fail when circular dependency is detected (atleast one DAG with no dependency)", func(t *testing.T) { - spec1 := "dag1-no-deps" - spec2 := "dag2-deps-on-dag1" - spec3 := "dag3-deps-on-dag2" - - s1 := getJobWithUpstream(spec1) - s3 := getJobWithUpstream(spec3, spec2, spec1) - s2 := getJobWithUpstream(spec2, spec3, spec1) - - dagSpec := []*scheduler.JobWithDetails{s1, s2, s3} - - assigner := resolver.NewPriorityResolver() - err := assigner.Resolve(ctx, dagSpec) - assert.Contains(t, err.Error(), "error occurred while resolving priority:") - assert.Contains(t, err.Error(), tree.ErrCyclicDependencyEncountered.Error()) - }) - - t.Run("resolve should give error on Cyclic dependency", func(t *testing.T) { - spec2 := "dag2-deps-on-dag1" - spec3 := "dag3-deps-on-dag2" - - s3 := getJobWithUpstream(spec3, spec2) - s2 := getJobWithUpstream(spec2, spec3) - - dagSpec := []*scheduler.JobWithDetails{s2, s3} - - assigner := resolver.NewPriorityResolver() - err := assigner.Resolve(ctx, dagSpec) - assert.NotNil(t, err) - assert.Contains(t, err.Error(), tree.ErrCyclicDependencyEncountered.Error()) - }) - - t.Run("Resolve should assign correct weights (maxWeight) with no dependencies", func(t *testing.T) { - spec1 := "dag1-no-deps" - spec2 := "dag4-no-deps" - - s1 := getJobWithUpstream(spec1) - s2 := getJobWithUpstream(spec2) - dagSpec := []*scheduler.JobWithDetails{s1, s2} - - assigner := resolver.NewPriorityResolver() - err := assigner.Resolve(ctx, dagSpec) - assert.Nil(t, err) - - max := resolver.MaxPriorityWeight - - for _, jobSpec := range dagSpec { - assert.Equal(t, max, jobSpec.Priority) - } - }) - - t.Run("Resolve should assign correct weight to single DAG", func(t *testing.T) { - spec1 := "dag1-no-deps" - s1 := getJobWithUpstream(spec1) - dagSpec := []*scheduler.JobWithDetails{s1} - - assigner := resolver.NewPriorityResolver() - err := assigner.Resolve(ctx, dagSpec) - assert.Nil(t, err) - - for _, jobSpec := range dagSpec { - assert.Equal(t, resolver.MaxPriorityWeight, jobSpec.Priority) - } - }) -} - -func TestDAGNode(t *testing.T) { - t.Run("TreeNode should handle all TreeNode operations", func(t *testing.T) { - dagSpec := &scheduler.JobWithDetails{Name: "testdag"} - dagSpec2 := &scheduler.JobWithDetails{Name: "testdag"} - dagSpec3 := &scheduler.JobWithDetails{Name: "testdag"} - - node := tree.NewTreeNode(dagSpec) - node2 := tree.NewTreeNode(dagSpec2) - node3 := tree.NewTreeNode(dagSpec3) - - assert.Equal(t, "testdag", node.GetName()) - assert.Equal(t, []*tree.TreeNode{}, node.Dependents) - - node.AddDependent(node2) - assert.Equal(t, 1, len(node.Dependents)) - - node.AddDependent(node3) - assert.Equal(t, 2, len(node.Dependents)) - - node2.AddDependent(node3) - assert.Equal(t, 1, len(node2.Dependents)) - assert.Equal(t, 0, len(node3.Dependents)) - }) -} - -func TestMultiRootDAGTree(t *testing.T) { - t.Run("should handle all NewMultiRootTree operations", func(t *testing.T) { - dagSpec1 := &scheduler.JobWithDetails{Name: "testdag1"} - dagSpec2 := &scheduler.JobWithDetails{Name: "testdag2"} - dagSpec3 := &scheduler.JobWithDetails{Name: "testdag3"} - - node1 := tree.NewTreeNode(dagSpec1) - node2 := tree.NewTreeNode(dagSpec2) - node3 := tree.NewTreeNode(dagSpec3) - node4 := tree.NewTreeNode(dagSpec2) - - node2.AddDependent(node3) - node1.AddDependent(node1) - - dagTree := tree.NewMultiRootTree() - - // non-existing node should return nil, and ok=false - n, ok := dagTree.GetNodeByName("non-existing") - assert.False(t, ok) - assert.Nil(t, n) - - // should return the node, when an existing node is requested by name - dagTree.AddNode(node1) - n, ok = dagTree.GetNodeByName(node1.GetName()) - assert.True(t, ok) - assert.Equal(t, dagSpec1.Name.String(), n.GetName()) - assert.Equal(t, []*tree.TreeNode{}, dagTree.GetRootNodes()) - - // should return root nodes, when added as root - dagTree.MarkRoot(node1) - assert.Equal(t, []*tree.TreeNode{node1}, dagTree.GetRootNodes()) - - // adding nodes should maintain the dependency relationship - dagTree.AddNode(node2) - dagTree.AddNodeIfNotExist(node3) - - n, _ = dagTree.GetNodeByName(node1.GetName()) - assert.Equal(t, 1, len(n.Dependents)) - - n, _ = dagTree.GetNodeByName(node2.GetName()) - assert.Equal(t, 1, len(n.Dependents)) - - n, _ = dagTree.GetNodeByName(node3.GetName()) - assert.Equal(t, 0, len(n.Dependents)) - - // AddNodeIfNotExist should not break the tree - dagTree.AddNodeIfNotExist(node3) - n, _ = dagTree.GetNodeByName(node3.GetName()) - assert.Equal(t, 0, len(n.Dependents)) - - // AddNodeIfNotExist should not break the tree even when a new node - // with same name is added - dagTree.AddNodeIfNotExist(node4) - n, _ = dagTree.GetNodeByName(node1.GetName()) - assert.Equal(t, 1, len(n.Dependents)) - - // AddNode should break the tree if a node with same name is added - // since node4 and node2 has same name. and node 4 has no deps. - // it should replace node2 and break the tree - dagTree.AddNode(node4) - n, ok = dagTree.GetNodeByName(node2.GetName()) - assert.Equal(t, 0, len(n.Dependents)) - assert.Equal(t, true, ok) - }) - - t.Run("should detect any cycle in the tree", func(t *testing.T) { - dagSpec1 := &scheduler.JobWithDetails{Name: "testdag1"} - dagSpec2 := &scheduler.JobWithDetails{Name: "testdag2"} - dagSpec3 := &scheduler.JobWithDetails{Name: "testdag3"} - - node1 := tree.NewTreeNode(dagSpec1) - node2 := tree.NewTreeNode(dagSpec2) - node3 := tree.NewTreeNode(dagSpec3) - - node1.AddDependent(node2) - node2.AddDependent(node3) - node3.AddDependent(node2) - - dagTree := tree.NewMultiRootTree() - dagTree.AddNode(node1) - dagTree.MarkRoot(node1) - dagTree.AddNode(node2) - dagTree.AddNode(node3) - - _, err := dagTree.ValidateCyclic() - assert.NotNil(t, err) - assert.Contains(t, err.Error(), tree.ErrCyclicDependencyEncountered.Error()) - }) - - t.Run("should create tree with multi level dependencies", func(t *testing.T) { - d1 := &scheduler.JobWithDetails{Name: "d1"} - d11 := &scheduler.JobWithDetails{Name: "d11"} - d12 := &scheduler.JobWithDetails{Name: "d12"} - - d111 := &scheduler.JobWithDetails{Name: "d111"} - d112 := &scheduler.JobWithDetails{Name: "d112"} - d121 := &scheduler.JobWithDetails{Name: "d121"} - d122 := &scheduler.JobWithDetails{Name: "d122"} - - d1211 := &scheduler.JobWithDetails{Name: "d1211"} - d1212 := &scheduler.JobWithDetails{Name: "d1212"} - - dagTree := tree.NewMultiRootTree() - - dagTree.AddNodeIfNotExist(tree.NewTreeNode(d1211)) - dagTree.AddNodeIfNotExist(tree.NewTreeNode(d1212)) - - dagTree.AddNodeIfNotExist(tree.NewTreeNode(d11)) - dagTree.AddNodeIfNotExist(tree.NewTreeNode(d12)) - - dagTree.AddNodeIfNotExist(tree.NewTreeNode(d111)) - dagTree.AddNodeIfNotExist(tree.NewTreeNode(d121)) - dagTree.AddNodeIfNotExist(tree.NewTreeNode(d122)) - - node111, _ := dagTree.GetNodeByName(d111.Name.String()) - node112, _ := dagTree.GetNodeByName(d112.Name.String()) - if node112 == nil { - node112 = tree.NewTreeNode(d112) - dagTree.AddNode(tree.NewTreeNode(d112)) - } - node121, _ := dagTree.GetNodeByName(d121.Name.String()) - node122, _ := dagTree.GetNodeByName(d122.Name.String()) - - node11, _ := dagTree.GetNodeByName(d11.Name.String()) - node12, _ := dagTree.GetNodeByName(d12.Name.String()) - - node1 := tree.NewTreeNode(d1) - node1.AddDependent(node11).AddDependent(node12) - dagTree.AddNode(node1) - dagTree.MarkRoot(node1) - - node11.AddDependent(node111).AddDependent(node112) - dagTree.AddNode(node11) - - node12.AddDependent(node121).AddDependent(node122) - dagTree.AddNode(node12) - - node1211, _ := dagTree.GetNodeByName(d1211.Name.String()) - node1212, _ := dagTree.GetNodeByName(d1212.Name.String()) - node121.AddDependent(node1211).AddDependent(node1212) - dagTree.AddNode(node121) - dagTree.AddNode(node1211) - dagTree.AddNode(node1212) - - _, err := dagTree.ValidateCyclic() - assert.Nil(t, err) - - depsMap := map[*tree.TreeNode]int{ - node1: 2, - node11: 2, node12: 2, - node111: 0, node112: 0, node121: 2, node122: 0, - node1211: 0, node1212: 0, - } - - for node, depCount := range depsMap { - n, ok := dagTree.GetNodeByName(node.GetName()) - assert.True(t, ok) - assert.Equal(t, depCount, len(n.Dependents)) - } - }) - - t.Run("should not have cycles if only one node with no dependency is in the tree", func(t *testing.T) { - dagSpec2 := &scheduler.JobWithDetails{Name: "testdag2"} - node2 := tree.NewTreeNode(dagSpec2) - - dagTree := tree.NewMultiRootTree() - dagTree.AddNode(node2) - dagTree.MarkRoot(node2) - - _, err := dagTree.ValidateCyclic() - assert.Nil(t, err) - }) - - t.Run("should not have cycles in a tree with no root", func(t *testing.T) { - dagSpec2 := &scheduler.JobWithDetails{Name: "testdag2"} - node2 := tree.NewTreeNode(dagSpec2) - - dagTree := tree.NewMultiRootTree() - dagTree.AddNode(node2) - - _, err := dagTree.ValidateCyclic() - assert.Nil(t, err) - }) - - t.Run("should detect any cycle in the tree with multiple sub trees", func(t *testing.T) { - node1 := tree.NewTreeNode(&scheduler.JobWithDetails{Name: "testdag1"}) - node2 := tree.NewTreeNode(&scheduler.JobWithDetails{Name: "testdag2"}) - node3 := tree.NewTreeNode(&scheduler.JobWithDetails{Name: "testdag3"}) - node1.AddDependent(node2) - node2.AddDependent(node3) - - node11 := tree.NewTreeNode(&scheduler.JobWithDetails{Name: "testdag11"}) - node21 := tree.NewTreeNode(&scheduler.JobWithDetails{Name: "testdag21"}) - node31 := tree.NewTreeNode(&scheduler.JobWithDetails{Name: "testdag31"}) - node41 := tree.NewTreeNode(&scheduler.JobWithDetails{Name: "testdag41"}) - node11.AddDependent(node21) - node21.AddDependent(node31) - node31.AddDependent(node11) // causing cyclic dep - node31.AddDependent(node41) - node41.AddDependent(node21) - - dagTree := tree.NewMultiRootTree() - dagTree.AddNode(node1) - dagTree.MarkRoot(node1) - dagTree.AddNode(node2) - dagTree.AddNode(node3) - - dagTree.AddNode(node11) - dagTree.AddNode(node21) - dagTree.MarkRoot(node21) - dagTree.AddNode(node31) - dagTree.AddNode(node41) - - _, err := dagTree.ValidateCyclic() - assert.NotNil(t, err) - assert.Contains(t, err.Error(), tree.ErrCyclicDependencyEncountered.Error()) - }) -} diff --git a/core/scheduler/resolver/simple_resolver.go b/core/scheduler/resolver/simple_resolver.go new file mode 100644 index 0000000000..06c0dae6f5 --- /dev/null +++ b/core/scheduler/resolver/simple_resolver.go @@ -0,0 +1,41 @@ +package resolver + +import ( + "context" + + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" +) + +const ( + // maxPriorityWeight - is the maximus weight a DAG will be given. + maxPriorityWeight = 10000 + + // priorityWeightGap - while giving weights to the DAG, what's the GAP + // do we want to consider. PriorityWeightGap = 1 means, weights will be 1, 2, 3 etc. + priorityWeightGap = 10 +) + +type SimpleResolver struct{} + +func NewSimpleResolver() *SimpleResolver { + return &SimpleResolver{} +} + +func (SimpleResolver) Resolve(_ context.Context, details []*scheduler.JobWithDetails) error { // nolint:unparam + for _, job := range details { + priority := maxPriorityWeight - numberOfUpstreams(job.Upstreams, job.Job.Tenant)*priorityWeightGap + job.Priority = priority + } + return nil +} + +func numberOfUpstreams(upstream scheduler.Upstreams, tnnt tenant.Tenant) int { + count := 0 + for _, u := range upstream.UpstreamJobs { + if u.Tenant == tnnt { + count++ + } + } + return count +} diff --git a/core/scheduler/resolver/simple_resolver_test.go b/core/scheduler/resolver/simple_resolver_test.go new file mode 100644 index 0000000000..13e99739ed --- /dev/null +++ b/core/scheduler/resolver/simple_resolver_test.go @@ -0,0 +1,76 @@ +package resolver_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/resolver" + "github.com/raystack/optimus/core/tenant" +) + +func TestSimpleResolver(t *testing.T) { + ctx := context.Background() + tnnt1, _ := tenant.NewTenant("test-proj", "test-ns") + + t.Run("returns max priority for root node", func(t *testing.T) { + j1 := &scheduler.JobWithDetails{ + Name: scheduler.JobName("RootNode"), + Job: &scheduler.Job{Tenant: tnnt1}, + Upstreams: scheduler.Upstreams{ + UpstreamJobs: nil, + }, + } + + s1 := resolver.SimpleResolver{} + err := s1.Resolve(ctx, []*scheduler.JobWithDetails{j1}) + assert.NoError(t, err) + assert.Equal(t, 10000, j1.Priority) + }) + t.Run("returns max priority for upstream not in same tenant", func(t *testing.T) { + tnnt2, _ := tenant.NewTenant("proj2", "namespace2") + upstream := &scheduler.JobUpstream{ + JobName: "upstreamInOtherTenant", + Tenant: tnnt2, + } + + j1 := &scheduler.JobWithDetails{ + Name: scheduler.JobName("RootNode"), + Job: &scheduler.Job{Tenant: tnnt1}, + Upstreams: scheduler.Upstreams{ + UpstreamJobs: []*scheduler.JobUpstream{upstream}, + }, + } + + s1 := resolver.SimpleResolver{} + err := s1.Resolve(ctx, []*scheduler.JobWithDetails{j1}) + assert.NoError(t, err) + assert.Equal(t, 10000, j1.Priority) + }) + t.Run("returns priority for leaf based on upstream", func(t *testing.T) { + upstream1 := &scheduler.JobUpstream{ + JobName: "upstream1", + Tenant: tnnt1, + } + + upstream2 := &scheduler.JobUpstream{ + JobName: "upstream2", + Tenant: tnnt1, + } + + j1 := &scheduler.JobWithDetails{ + Name: scheduler.JobName("RootNode"), + Job: &scheduler.Job{Tenant: tnnt1}, + Upstreams: scheduler.Upstreams{ + UpstreamJobs: []*scheduler.JobUpstream{upstream1, upstream2}, + }, + } + + s1 := resolver.SimpleResolver{} + err := s1.Resolve(ctx, []*scheduler.JobWithDetails{j1}) + assert.NoError(t, err) + assert.Equal(t, 9980, j1.Priority) + }) +} diff --git a/core/scheduler/service/deployment_service.go b/core/scheduler/service/deployment_service.go index eb5b1b35ea..62ccc3676e 100644 --- a/core/scheduler/service/deployment_service.go +++ b/core/scheduler/service/deployment_service.go @@ -2,88 +2,51 @@ package service import ( "context" - "fmt" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/telemetry" -) - -func setJobMetric(t tenant.Tenant, jobs []*scheduler.JobWithDetails) { - telemetry.NewGauge("total_number_of_job", map[string]string{ - "project": t.ProjectName().String(), - "namespace": t.NamespaceName().String(), - }).Set(float64(len(jobs))) - - // this can be greatly simplified using a db query - type counter struct { - Inferred int - Static int - } - externalUpstreamCountMap := map[string]*counter{} - for _, job := range jobs { - for _, upstream := range job.Upstreams.UpstreamJobs { - if upstream.External { - if _, ok := externalUpstreamCountMap[upstream.Host]; !ok { - externalUpstreamCountMap[upstream.Host] = &counter{} - } - if upstream.Type == scheduler.UpstreamTypeStatic { - externalUpstreamCountMap[upstream.Host].Static++ - } else { - externalUpstreamCountMap[upstream.Host].Inferred++ - } - } - } - } - - for externalUpstream, counter := range externalUpstreamCountMap { - if counter.Static > 0 { - telemetry.NewGauge("total_external_upstream_references", map[string]string{ - "project": t.ProjectName().String(), - "namespace": t.NamespaceName().String(), - "host": externalUpstream, - "type": scheduler.UpstreamTypeStatic, - }).Set(float64(counter.Static)) - } + "go.opentelemetry.io/otel" - if counter.Inferred > 0 { - telemetry.NewGauge("total_external_upstream_references", map[string]string{ - "project": t.ProjectName().String(), - "namespace": t.NamespaceName().String(), - "host": externalUpstream, - "type": scheduler.UpstreamTypeInferred, - }).Set(float64(counter.Inferred)) - } - } -} + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" +) func (s *JobRunService) UploadToScheduler(ctx context.Context, projectName tenant.ProjectName) error { - multiError := errors.NewMultiError("errorInUploadToScheduler") - allJobsWithDetails, err := s.jobRepo.GetAll(ctx, projectName) - multiError.Append(err) + spanCtx, span := otel.Tracer("optimus").Start(ctx, "UploadToScheduler") + defer span.End() + + me := errors.NewMultiError("errorInUploadToScheduler") + allJobsWithDetails, err := s.jobRepo.GetAll(spanCtx, projectName) + me.Append(err) if allJobsWithDetails == nil { - return errors.MultiToError(multiError) + return me.ToErr() } - err = s.priorityResolver.Resolve(ctx, allJobsWithDetails) + span.AddEvent("got all the jobs to upload") + + err = s.priorityResolver.Resolve(spanCtx, allJobsWithDetails) if err != nil { - multiError.Append(err) - return errors.MultiToError(multiError) + s.l.Error("error resolving priority: %s", err) + me.Append(err) + return me.ToErr() } + span.AddEvent("done with priority resolution") + jobGroupByTenant := scheduler.GroupJobsByTenant(allJobsWithDetails) for t, jobs := range jobGroupByTenant { - if err = s.deployJobsPerNamespace(ctx, t, jobs); err == nil { - s.l.Debug(fmt.Sprintf("[success] namespace: %s, project: %s, deployed", t.NamespaceName().String(), t.ProjectName().String())) + span.AddEvent("uploading job specs") + if err = s.deployJobsPerNamespace(spanCtx, t, jobs); err == nil { + s.l.Info("[success] namespace: %s, project: %s, deployed", t.NamespaceName().String(), t.ProjectName().String()) } - multiError.Append(err) - setJobMetric(t, jobs) + me.Append(err) + + span.AddEvent("uploading job metrics") } - return multiError.ToErr() + return me.ToErr() } func (s *JobRunService) deployJobsPerNamespace(ctx context.Context, t tenant.Tenant, jobs []*scheduler.JobWithDetails) error { err := s.scheduler.DeployJobs(ctx, t, jobs) if err != nil { + s.l.Error("error deploying jobs under project [%s] namespace [%s]: %s", t.ProjectName().String(), t.NamespaceName().String(), err) return err } return s.cleanPerNamespace(ctx, t, jobs) @@ -93,6 +56,7 @@ func (s *JobRunService) cleanPerNamespace(ctx context.Context, t tenant.Tenant, // get all stored job names schedulerJobNames, err := s.scheduler.ListJobs(ctx, t) if err != nil { + s.l.Error("error listing jobs under project [%s] namespace [%s]: %s", t.ProjectName().String(), t.NamespaceName().String(), err) return err } jobNamesMap := make(map[string]struct{}) @@ -108,3 +72,38 @@ func (s *JobRunService) cleanPerNamespace(ctx context.Context, t tenant.Tenant, } return s.scheduler.DeleteJobs(ctx, t, jobsToDelete) } + +func (s *JobRunService) UploadJobs(ctx context.Context, tnnt tenant.Tenant, toUpdate, toDelete []string) (err error) { + me := errors.NewMultiError("errorInUploadJobs") + + if len(toUpdate) > 0 { + if err = s.resolveAndDeployJobs(ctx, tnnt, toUpdate); err == nil { + s.l.Info("[success] namespace: %s, project: %s, deployed %d jobs", tnnt.NamespaceName().String(), + tnnt.ProjectName().String(), len(toUpdate)) + } + me.Append(err) + } + + if len(toDelete) > 0 { + if err = s.scheduler.DeleteJobs(ctx, tnnt, toDelete); err == nil { + s.l.Info("deleted %s jobs on project: %s", len(toDelete), tnnt.ProjectName()) + } + me.Append(err) + } + + return me.ToErr() +} + +func (s *JobRunService) resolveAndDeployJobs(ctx context.Context, tnnt tenant.Tenant, toUpdate []string) error { + allJobsWithDetails, err := s.jobRepo.GetJobs(ctx, tnnt.ProjectName(), toUpdate) + if err != nil || allJobsWithDetails == nil { + return err + } + + if err := s.priorityResolver.Resolve(ctx, allJobsWithDetails); err != nil { + s.l.Error("error priority resolving jobs: %s", err) + return err + } + + return s.scheduler.DeployJobs(ctx, tnnt, allJobsWithDetails) +} diff --git a/core/scheduler/service/deployment_service_test.go b/core/scheduler/service/deployment_service_test.go index 300a40aef0..0bbd0d8fc7 100644 --- a/core/scheduler/service/deployment_service_test.go +++ b/core/scheduler/service/deployment_service_test.go @@ -2,16 +2,17 @@ package service_test import ( "context" + "errors" "fmt" "testing" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/service" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/service" + "github.com/raystack/optimus/core/tenant" ) func TestDeploymentService(t *testing.T) { @@ -73,11 +74,11 @@ func TestDeploymentService(t *testing.T) { t.Run("UploadToScheduler", func(t *testing.T) { t.Run("should return error if unable to get all jobs from job repo", func(t *testing.T) { jobRepo := new(JobRepository) - jobRepo.On("GetAll", ctx, proj1Name).Return(nil, fmt.Errorf("GetAll error")) + jobRepo.On("GetAll", mock.Anything, proj1Name).Return(nil, fmt.Errorf("GetAll error")) defer jobRepo.AssertExpectations(t) - runService := service.NewJobRunService(nil, - jobRepo, nil, nil, nil, nil, nil, nil) + runService := service.NewJobRunService(logger, + jobRepo, nil, nil, nil, nil, nil, nil, nil) err := runService.UploadToScheduler(ctx, proj1Name) assert.NotNil(t, err) @@ -85,15 +86,15 @@ func TestDeploymentService(t *testing.T) { }) t.Run("should return error if error in priority resolution", func(t *testing.T) { jobRepo := new(JobRepository) - jobRepo.On("GetAll", ctx, proj1Name).Return(jobsWithDetails, nil) + jobRepo.On("GetAll", mock.Anything, proj1Name).Return(jobsWithDetails, nil) defer jobRepo.AssertExpectations(t) priorityResolver := new(mockPriorityResolver) - priorityResolver.On("Resolve", ctx, jobsWithDetails).Return(fmt.Errorf("priority resolution error")) + priorityResolver.On("Resolve", mock.Anything, jobsWithDetails).Return(fmt.Errorf("priority resolution error")) defer priorityResolver.AssertExpectations(t) - runService := service.NewJobRunService(nil, - jobRepo, nil, nil, nil, nil, priorityResolver, nil) + runService := service.NewJobRunService(logger, + jobRepo, nil, nil, nil, nil, priorityResolver, nil, nil) err := runService.UploadToScheduler(ctx, proj1Name) assert.NotNil(t, err) @@ -101,20 +102,20 @@ func TestDeploymentService(t *testing.T) { }) t.Run("should deploy Jobs Per Namespace returning error", func(t *testing.T) { jobRepo := new(JobRepository) - jobRepo.On("GetAll", ctx, proj1Name).Return([]*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]}, nil) + jobRepo.On("GetAll", mock.Anything, proj1Name).Return([]*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]}, nil) defer jobRepo.AssertExpectations(t) priorityResolver := new(mockPriorityResolver) - priorityResolver.On("Resolve", ctx, []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]}).Return(nil) + priorityResolver.On("Resolve", mock.Anything, []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]}).Return(nil) defer priorityResolver.AssertExpectations(t) mScheduler := new(mockScheduler) - mScheduler.On("DeployJobs", ctx, tnnt1, []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]}). + mScheduler.On("DeployJobs", mock.Anything, tnnt1, []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]}). Return(fmt.Errorf("DeployJobs tnnt1 error")) defer mScheduler.AssertExpectations(t) runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, - mScheduler, priorityResolver, nil) + mScheduler, priorityResolver, nil, nil) err := runService.UploadToScheduler(ctx, proj1Name) assert.NotNil(t, err) @@ -122,58 +123,201 @@ func TestDeploymentService(t *testing.T) { }) t.Run("should deploy Jobs Per Namespace and cleanPerNamespace, appropriately", func(t *testing.T) { jobRepo := new(JobRepository) - jobRepo.On("GetAll", ctx, proj1Name).Return(jobsWithDetails, nil) + jobRepo.On("GetAll", mock.Anything, proj1Name).Return(jobsWithDetails, nil) defer jobRepo.AssertExpectations(t) priorityResolver := new(mockPriorityResolver) - priorityResolver.On("Resolve", ctx, jobsWithDetails).Return(nil) + priorityResolver.On("Resolve", mock.Anything, jobsWithDetails).Return(nil) defer priorityResolver.AssertExpectations(t) mScheduler := new(mockScheduler) - mScheduler.On("DeployJobs", ctx, tnnt1, []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]}). + mScheduler.On("DeployJobs", mock.Anything, tnnt1, []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]}). Return(nil) - mScheduler.On("DeployJobs", ctx, tnnt2, []*scheduler.JobWithDetails{jobsWithDetails[1]}). + mScheduler.On("DeployJobs", mock.Anything, tnnt2, []*scheduler.JobWithDetails{jobsWithDetails[1]}). Return(nil) - mScheduler.On("ListJobs", ctx, tnnt1).Return([]string{"job1", "job3"}, nil) - mScheduler.On("ListJobs", ctx, tnnt2).Return([]string{"job2", "job4-to-delete"}, nil) + mScheduler.On("ListJobs", mock.Anything, tnnt1).Return([]string{"job1", "job3"}, nil) + mScheduler.On("ListJobs", mock.Anything, tnnt2).Return([]string{"job2", "job4-to-delete"}, nil) var jobsToDelete []string - mScheduler.On("DeleteJobs", ctx, tnnt1, jobsToDelete).Return(nil) - mScheduler.On("DeleteJobs", ctx, tnnt2, []string{"job4-to-delete"}).Return(nil) + mScheduler.On("DeleteJobs", mock.Anything, tnnt1, jobsToDelete).Return(nil) + mScheduler.On("DeleteJobs", mock.Anything, tnnt2, []string{"job4-to-delete"}).Return(nil) defer mScheduler.AssertExpectations(t) runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, - mScheduler, priorityResolver, nil) + mScheduler, priorityResolver, nil, nil) err := runService.UploadToScheduler(ctx, proj1Name) assert.Nil(t, err) }) t.Run("should deploy Jobs Per Namespace and cleanPerNamespace, appropriately", func(t *testing.T) { jobRepo := new(JobRepository) - jobRepo.On("GetAll", ctx, proj1Name).Return(jobsWithDetails, nil) + jobRepo.On("GetAll", mock.Anything, proj1Name).Return(jobsWithDetails, nil) defer jobRepo.AssertExpectations(t) priorityResolver := new(mockPriorityResolver) - priorityResolver.On("Resolve", ctx, jobsWithDetails).Return(nil) + priorityResolver.On("Resolve", mock.Anything, jobsWithDetails).Return(nil) defer priorityResolver.AssertExpectations(t) mScheduler := new(mockScheduler) - mScheduler.On("DeployJobs", ctx, tnnt1, []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]}). + mScheduler.On("DeployJobs", mock.Anything, tnnt1, []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]}). Return(nil) - mScheduler.On("DeployJobs", ctx, tnnt2, []*scheduler.JobWithDetails{jobsWithDetails[1]}). + mScheduler.On("DeployJobs", mock.Anything, tnnt2, []*scheduler.JobWithDetails{jobsWithDetails[1]}). Return(nil) - mScheduler.On("ListJobs", ctx, tnnt1).Return([]string{}, fmt.Errorf("listJobs error")) - mScheduler.On("ListJobs", ctx, tnnt2).Return([]string{"job2", "job4-to-delete"}, nil) - mScheduler.On("DeleteJobs", ctx, tnnt2, []string{"job4-to-delete"}).Return(nil) + mScheduler.On("ListJobs", mock.Anything, tnnt1).Return([]string{}, fmt.Errorf("listJobs error")) + mScheduler.On("ListJobs", mock.Anything, tnnt2).Return([]string{"job2", "job4-to-delete"}, nil) + mScheduler.On("DeleteJobs", mock.Anything, tnnt2, []string{"job4-to-delete"}).Return(nil) defer mScheduler.AssertExpectations(t) runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, - mScheduler, priorityResolver, nil) + mScheduler, priorityResolver, nil, nil) err := runService.UploadToScheduler(ctx, proj1Name) assert.NotNil(t, err) assert.EqualError(t, err, "errorInUploadToScheduler:\n listJobs error") }) }) + + t.Run("UploadJobs", func(t *testing.T) { + t.Run("should return error if unable to get jobs", func(t *testing.T) { + jobNamesToUpload := []string{"job1", "job3"} + var jobNamesToDelete []string + + jobRepo := new(JobRepository) + jobRepo.On("GetJobs", mock.Anything, proj1Name, jobNamesToUpload).Return(nil, errors.New("internal error")) + defer jobRepo.AssertExpectations(t) + + priorityResolver := new(mockPriorityResolver) + defer priorityResolver.AssertExpectations(t) + + mScheduler := new(mockScheduler) + defer mScheduler.AssertExpectations(t) + + runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, + mScheduler, priorityResolver, nil, nil) + + err := runService.UploadJobs(ctx, tnnt1, jobNamesToUpload, jobNamesToDelete) + assert.Error(t, err) + }) + t.Run("should return error if unable to resolve priority", func(t *testing.T) { + jobNamesToUpload := []string{"job1", "job3"} + var jobNamesToDelete []string + jobsToUpload := []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]} + + jobRepo := new(JobRepository) + jobRepo.On("GetJobs", mock.Anything, proj1Name, jobNamesToUpload).Return(jobsToUpload, nil) + defer jobRepo.AssertExpectations(t) + + priorityResolver := new(mockPriorityResolver) + priorityResolver.On("Resolve", mock.Anything, jobsToUpload).Return(errors.New("internal error")) + defer priorityResolver.AssertExpectations(t) + + mScheduler := new(mockScheduler) + defer mScheduler.AssertExpectations(t) + + runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, + mScheduler, priorityResolver, nil, nil) + + err := runService.UploadJobs(ctx, tnnt1, jobNamesToUpload, jobNamesToDelete) + assert.Error(t, err) + }) + t.Run("should return error if unable to deploy jobs", func(t *testing.T) { + jobNamesToUpload := []string{"job1", "job3"} + var jobNamesToDelete []string + jobsToUpload := []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]} + + jobRepo := new(JobRepository) + jobRepo.On("GetJobs", mock.Anything, proj1Name, jobNamesToUpload).Return(jobsToUpload, nil) + defer jobRepo.AssertExpectations(t) + + priorityResolver := new(mockPriorityResolver) + priorityResolver.On("Resolve", mock.Anything, jobsToUpload).Return(nil) + defer priorityResolver.AssertExpectations(t) + + mScheduler := new(mockScheduler) + mScheduler.On("DeployJobs", mock.Anything, tnnt1, jobsToUpload).Return(errors.New("internal error")) + defer mScheduler.AssertExpectations(t) + + runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, + mScheduler, priorityResolver, nil, nil) + + err := runService.UploadJobs(ctx, tnnt1, jobNamesToUpload, jobNamesToDelete) + assert.Error(t, err) + }) + t.Run("should return error if unable to delete jobs from scheduler", func(t *testing.T) { + var jobNamesToUpload []string + jobNamesToDelete := []string{"job2"} + + mScheduler := new(mockScheduler) + mScheduler.On("DeleteJobs", mock.Anything, tnnt1, jobNamesToDelete).Return(errors.New("internal error")) + defer mScheduler.AssertExpectations(t) + + runService := service.NewJobRunService(logger, nil, nil, nil, nil, + mScheduler, nil, nil, nil) + + err := runService.UploadJobs(ctx, tnnt1, jobNamesToUpload, jobNamesToDelete) + assert.Error(t, err) + }) + t.Run("should upload and delete requested jobs, appropriately", func(t *testing.T) { + jobNamesToUpload := []string{"job1", "job3"} + jobNamesToDelete := []string{"job2"} + jobsToUpload := []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]} + + jobRepo := new(JobRepository) + jobRepo.On("GetJobs", mock.Anything, proj1Name, jobNamesToUpload).Return(jobsToUpload, nil) + defer jobRepo.AssertExpectations(t) + + priorityResolver := new(mockPriorityResolver) + priorityResolver.On("Resolve", mock.Anything, jobsToUpload).Return(nil) + defer priorityResolver.AssertExpectations(t) + + mScheduler := new(mockScheduler) + mScheduler.On("DeployJobs", mock.Anything, tnnt1, jobsToUpload).Return(nil) + mScheduler.On("DeleteJobs", mock.Anything, tnnt1, jobNamesToDelete).Return(nil) + defer mScheduler.AssertExpectations(t) + + runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, + mScheduler, priorityResolver, nil, nil) + + err := runService.UploadJobs(ctx, tnnt1, jobNamesToUpload, jobNamesToDelete) + assert.Nil(t, err) + }) + t.Run("should upload requested jobs, appropriately", func(t *testing.T) { + jobNamesToUpload := []string{"job1", "job3"} + var jobNamesToDelete []string + jobsToUpload := []*scheduler.JobWithDetails{jobsWithDetails[0], jobsWithDetails[2]} + + jobRepo := new(JobRepository) + jobRepo.On("GetJobs", mock.Anything, proj1Name, jobNamesToUpload).Return(jobsToUpload, nil) + defer jobRepo.AssertExpectations(t) + + priorityResolver := new(mockPriorityResolver) + priorityResolver.On("Resolve", mock.Anything, jobsToUpload).Return(nil) + defer priorityResolver.AssertExpectations(t) + + mScheduler := new(mockScheduler) + mScheduler.On("DeployJobs", mock.Anything, tnnt1, jobsToUpload).Return(nil) + defer mScheduler.AssertExpectations(t) + + runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, + mScheduler, priorityResolver, nil, nil) + + err := runService.UploadJobs(ctx, tnnt1, jobNamesToUpload, jobNamesToDelete) + assert.Nil(t, err) + }) + t.Run("should delete requested jobs, appropriately", func(t *testing.T) { + var jobNamesToUpload []string + jobNamesToDelete := []string{"job2"} + + mScheduler := new(mockScheduler) + mScheduler.On("DeleteJobs", mock.Anything, tnnt1, jobNamesToDelete).Return(nil) + defer mScheduler.AssertExpectations(t) + + runService := service.NewJobRunService(logger, nil, nil, nil, nil, + mScheduler, nil, nil, nil) + + err := runService.UploadJobs(ctx, tnnt1, jobNamesToUpload, jobNamesToDelete) + assert.Nil(t, err) + }) + }) } type mockPriorityResolver struct { diff --git a/core/scheduler/service/executor_input_compiler.go b/core/scheduler/service/executor_input_compiler.go index 2d7f455275..beea2a9075 100644 --- a/core/scheduler/service/executor_input_compiler.go +++ b/core/scheduler/service/executor_input_compiler.go @@ -5,10 +5,12 @@ import ( "strings" "time" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/compiler" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/salt/log" + + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/compiler" + "github.com/raystack/optimus/internal/utils" ) const ( @@ -53,16 +55,20 @@ type InputCompiler struct { tenantService TenantService compiler TemplateCompiler assetCompiler AssetCompiler + + logger log.Logger } func (i InputCompiler) Compile(ctx context.Context, job *scheduler.Job, config scheduler.RunConfig, executedAt time.Time) (*scheduler.ExecutorInput, error) { tenantDetails, err := i.tenantService.GetDetails(ctx, job.Tenant) if err != nil { + i.logger.Error("error getting tenant details: %s", err) return nil, err } systemDefinedVars, err := getSystemDefinedConfigs(job, config, executedAt) if err != nil { + i.logger.Error("error getting config for job [%s]: %s", job.Name.String(), err) return nil, err } @@ -76,11 +82,13 @@ func (i InputCompiler) Compile(ctx context.Context, job *scheduler.Job, config s // Compile asset files fileMap, err := i.assetCompiler.CompileJobRunAssets(ctx, job, systemDefinedVars, config.ScheduledAt, taskContext) if err != nil { + i.logger.Error("error compiling job run assets: %s", err) return nil, err } confs, secretConfs, err := i.compileConfigs(job.Task.Config, taskContext) if err != nil { + i.logger.Error("error compiling task config: %s", err) return nil, err } @@ -101,11 +109,13 @@ func (i InputCompiler) Compile(ctx context.Context, job *scheduler.Job, config s hook, err := job.GetHook(config.Executor.Name) if err != nil { + i.logger.Error("error getting hook [%s]: %s", config.Executor.Name, err) return nil, err } hookConfs, hookSecrets, err := i.compileConfigs(hook.Config, mergedContext) if err != nil { + i.logger.Error("error compiling configs for hook [%s]: %s", hook.Name, err) return nil, err } @@ -121,10 +131,12 @@ func (i InputCompiler) compileConfigs(configs map[string]string, templateCtx map var err error if conf, err = i.compiler.Compile(conf, templateCtx); err != nil { + i.logger.Error("error compiling template with config: %s", err) return nil, nil, err } if secretsConfig, err = i.compiler.Compile(secretsConfig, templateCtx); err != nil { + i.logger.Error("error compiling template with secret: %s", err) return nil, nil, err } @@ -162,10 +174,11 @@ func splitConfigWithSecrets(conf map[string]string) (map[string]string, map[stri return configs, configWithSecrets } -func NewJobInputCompiler(tenantService TenantService, compiler TemplateCompiler, assetCompiler AssetCompiler) *InputCompiler { +func NewJobInputCompiler(tenantService TenantService, compiler TemplateCompiler, assetCompiler AssetCompiler, logger log.Logger) *InputCompiler { return &InputCompiler{ tenantService: tenantService, compiler: compiler, assetCompiler: assetCompiler, + logger: logger, } } diff --git a/core/scheduler/service/executor_input_compiler_test.go b/core/scheduler/service/executor_input_compiler_test.go index 3c573d919d..ea4f775d6f 100644 --- a/core/scheduler/service/executor_input_compiler_test.go +++ b/core/scheduler/service/executor_input_compiler_test.go @@ -6,13 +6,14 @@ import ( "testing" "time" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/service" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/models" ) func TestExecutorCompiler(t *testing.T) { @@ -34,6 +35,8 @@ func TestExecutorCompiler(t *testing.T) { currentTime := time.Now() scheduleTime := currentTime.Add(-time.Hour) + logger := log.NewLogrus() + t.Run("Compile", func(t *testing.T) { t.Run("should give error if tenant service getDetails fails", func(t *testing.T) { job := scheduler.Job{ @@ -53,7 +56,7 @@ func TestExecutorCompiler(t *testing.T) { tenantService.On("GetDetails", ctx, tnnt).Return(nil, fmt.Errorf("get details error")) defer tenantService.AssertExpectations(t) - inputCompiler := service.NewJobInputCompiler(tenantService, nil, nil) + inputCompiler := service.NewJobInputCompiler(tenantService, nil, nil, logger) inputExecutor, err := inputCompiler.Compile(ctx, &job, config, currentTime.Add(time.Hour)) assert.NotNil(t, err) @@ -80,7 +83,7 @@ func TestExecutorCompiler(t *testing.T) { tenantService.On("GetDetails", ctx, tnnt).Return(tenantDetails, nil) defer tenantService.AssertExpectations(t) - inputCompiler := service.NewJobInputCompiler(tenantService, nil, nil) + inputCompiler := service.NewJobInputCompiler(tenantService, nil, nil, logger) inputExecutor, err := inputCompiler.Compile(ctx, &job, config, currentTime.Add(time.Hour)) assert.NotNil(t, err) @@ -123,7 +126,7 @@ func TestExecutorCompiler(t *testing.T) { assetCompiler.On("CompileJobRunAssets", ctx, &job, systemDefinedVars, scheduleTime, taskContext).Return(nil, fmt.Errorf("CompileJobRunAssets error")) defer assetCompiler.AssertExpectations(t) - inputCompiler := service.NewJobInputCompiler(tenantService, nil, assetCompiler) + inputCompiler := service.NewJobInputCompiler(tenantService, nil, assetCompiler, logger) inputExecutor, err := inputCompiler.Compile(ctx, &job, config, executedAt) assert.NotNil(t, err) @@ -184,7 +187,7 @@ func TestExecutorCompiler(t *testing.T) { Return(nil, fmt.Errorf("some.config compilation error")) defer templateCompiler.AssertExpectations(t) - inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler) + inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler, logger) inputExecutor, err := inputCompiler.Compile(ctx, &job, config, executedAt) assert.NotNil(t, err) @@ -199,7 +202,7 @@ func TestExecutorCompiler(t *testing.T) { Return(nil, fmt.Errorf("secret.config compilation error")) defer templateCompiler.AssertExpectations(t) - inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler) + inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler, logger) inputExecutor, err := inputCompiler.Compile(ctx, &job, config, executedAt) assert.NotNil(t, err) @@ -214,7 +217,7 @@ func TestExecutorCompiler(t *testing.T) { Return(map[string]string{"secret.config.compiled": "a.secret.val.compiled"}, nil) defer templateCompiler.AssertExpectations(t) - inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler) + inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler, logger) inputExecutorResp, err := inputCompiler.Compile(ctx, &job, config, executedAt) assert.Nil(t, err) @@ -299,7 +302,7 @@ func TestExecutorCompiler(t *testing.T) { Return(map[string]string{"secret.hook.compiled": "hook.s.val.compiled"}, nil) defer templateCompiler.AssertExpectations(t) - inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler) + inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler, logger) inputExecutorResp, err := inputCompiler.Compile(ctx, &job, config, executedAt) assert.Nil(t, err) @@ -382,7 +385,7 @@ func TestExecutorCompiler(t *testing.T) { defer templateCompiler.AssertExpectations(t) - inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler) + inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler, logger) inputExecutorResp, err := inputCompiler.Compile(ctx, &job, config, executedAt) assert.NotNil(t, err) @@ -444,7 +447,7 @@ func TestExecutorCompiler(t *testing.T) { Return(map[string]string{"secret.config.compiled": "a.secret.val.compiled"}, nil) defer templateCompiler.AssertExpectations(t) - inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler) + inputCompiler := service.NewJobInputCompiler(tenantService, templateCompiler, assetCompiler, logger) inputExecutorResp, err := inputCompiler.Compile(ctx, &job, config, executedAt) assert.NotNil(t, err) diff --git a/core/scheduler/service/job_run_asset_compiler.go b/core/scheduler/service/job_run_asset_compiler.go index da7c2aeb58..27e0613aba 100644 --- a/core/scheduler/service/job_run_asset_compiler.go +++ b/core/scheduler/service/job_run_asset_compiler.go @@ -5,8 +5,10 @@ import ( "fmt" "time" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/salt/log" + + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/sdk/plugin" ) const ( @@ -24,27 +26,33 @@ type PluginRepo interface { type JobRunAssetsCompiler struct { compiler FilesCompiler pluginRepo PluginRepo + + logger log.Logger } -func NewJobAssetsCompiler(engine FilesCompiler, pluginRepo PluginRepo) *JobRunAssetsCompiler { +func NewJobAssetsCompiler(engine FilesCompiler, pluginRepo PluginRepo, logger log.Logger) *JobRunAssetsCompiler { return &JobRunAssetsCompiler{ compiler: engine, pluginRepo: pluginRepo, + logger: logger, } } func (c *JobRunAssetsCompiler) CompileJobRunAssets(ctx context.Context, job *scheduler.Job, systemEnvVars map[string]string, scheduledAt time.Time, contextForTask map[string]interface{}) (map[string]string, error) { taskPlugin, err := c.pluginRepo.GetByName(job.Task.Name) if err != nil { + c.logger.Error("error getting plugin [%s]: %s", job.Task.Name, err) return nil, err } startTime, err := job.Window.GetStartTime(scheduledAt) if err != nil { + c.logger.Error("error getting window start time: %s", err) return nil, fmt.Errorf("error getting start time: %w", err) } endTime, err := job.Window.GetEndTime(scheduledAt) if err != nil { + c.logger.Error("error getting window end time: %s", err) return nil, fmt.Errorf("error getting end time: %w", err) } @@ -60,6 +68,7 @@ func (c *JobRunAssetsCompiler) CompileJobRunAssets(ctx context.Context, job *sch InstanceData: toJobRunSpecData(systemEnvVars), }) if err != nil { + c.logger.Error("error compiling assets through plugin dependency mod: %s", err) return nil, err } inputFiles = compiledAssetResponse.Assets.ToMap() @@ -67,6 +76,7 @@ func (c *JobRunAssetsCompiler) CompileJobRunAssets(ctx context.Context, job *sch fileMap, err := c.compiler.Compile(inputFiles, contextForTask) if err != nil { + c.logger.Error("error compiling assets: %s", err) return nil, err } return fileMap, nil diff --git a/core/scheduler/service/job_run_asset_compiler_test.go b/core/scheduler/service/job_run_asset_compiler_test.go index d2647a2c49..07f0264110 100644 --- a/core/scheduler/service/job_run_asset_compiler_test.go +++ b/core/scheduler/service/job_run_asset_compiler_test.go @@ -6,15 +6,16 @@ import ( "testing" "time" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/service" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/sdk/plugin" - smock "github.com/odpf/optimus/sdk/plugin/mock" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/sdk/plugin" + smock "github.com/raystack/optimus/sdk/plugin/mock" ) func TestJobAssetsCompiler(t *testing.T) { @@ -54,6 +55,8 @@ func TestJobAssetsCompiler(t *testing.T) { "JOB_DESTINATION": job.Destination, } + logger := log.NewLogrus() + t.Run("CompileJobRunAssets", func(t *testing.T) { t.Run("should error if plugin repo get plugin by name fails", func(t *testing.T) { pluginRepo := new(mockPluginRepo) @@ -62,7 +65,7 @@ func TestJobAssetsCompiler(t *testing.T) { contextForTask := map[string]any{} - jobRunAssetsCompiler := service.NewJobAssetsCompiler(nil, pluginRepo) + jobRunAssetsCompiler := service.NewJobAssetsCompiler(nil, pluginRepo, logger) assets, err := jobRunAssetsCompiler.CompileJobRunAssets(ctx, job, systemEnvVars, scheduleTime, contextForTask) assert.NotNil(t, err) assert.EqualError(t, err, "error in getting plugin by name") @@ -90,7 +93,7 @@ func TestJobAssetsCompiler(t *testing.T) { }, } - jobRunAssetsCompiler := service.NewJobAssetsCompiler(nil, pluginRepo) + jobRunAssetsCompiler := service.NewJobAssetsCompiler(nil, pluginRepo, logger) contextForTask := map[string]any{} assets, err := jobRunAssetsCompiler.CompileJobRunAssets(ctx, job1, systemEnvVars, scheduleTime, contextForTask) @@ -111,7 +114,7 @@ func TestJobAssetsCompiler(t *testing.T) { YamlMod: yamlMod, }, nil) defer pluginRepo.AssertExpectations(t) - jobRunAssetsCompiler := service.NewJobAssetsCompiler(nil, pluginRepo) + jobRunAssetsCompiler := service.NewJobAssetsCompiler(nil, pluginRepo, logger) contextForTask := map[string]any{} assets, err := jobRunAssetsCompiler.CompileJobRunAssets(ctx, job, systemEnvVars, scheduleTime, contextForTask) @@ -150,7 +153,7 @@ func TestJobAssetsCompiler(t *testing.T) { Return(nil, fmt.Errorf("error in compiling")) defer filesCompiler.AssertExpectations(t) - jobRunAssetsCompiler := service.NewJobAssetsCompiler(filesCompiler, pluginRepo) + jobRunAssetsCompiler := service.NewJobAssetsCompiler(filesCompiler, pluginRepo, logger) assets, err := jobRunAssetsCompiler.CompileJobRunAssets(ctx, job, systemEnvVars, scheduleTime, contextForTask) assert.NotNil(t, err) @@ -167,7 +170,7 @@ func TestJobAssetsCompiler(t *testing.T) { Return(expectedFileMap, nil) defer filesCompiler.AssertExpectations(t) - jobRunAssetsCompiler := service.NewJobAssetsCompiler(filesCompiler, pluginRepo) + jobRunAssetsCompiler := service.NewJobAssetsCompiler(filesCompiler, pluginRepo, logger) assets, err := jobRunAssetsCompiler.CompileJobRunAssets(ctx, job, systemEnvVars, scheduleTime, contextForTask) assert.Nil(t, err) diff --git a/core/scheduler/service/job_run_service.go b/core/scheduler/service/job_run_service.go index 56771e8322..03b3cd4353 100644 --- a/core/scheduler/service/job_run_service.go +++ b/core/scheduler/service/job_run_service.go @@ -2,17 +2,21 @@ package service import ( "context" + "encoding/json" "fmt" + "strings" "time" "github.com/google/uuid" - "github.com/odpf/salt/log" - - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/lib/cron" - "github.com/odpf/optimus/internal/telemetry" + "github.com/raystack/salt/log" + + "github.com/raystack/optimus/core/event" + "github.com/raystack/optimus/core/event/moderator" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/lib/cron" + "github.com/raystack/optimus/internal/telemetry" ) type metricType string @@ -23,12 +27,15 @@ func (m metricType) String() string { const ( scheduleDelay metricType = "schedule_delay" + + metricJobRunEvents = "jobrun_events_total" ) type JobRepository interface { GetJob(ctx context.Context, name tenant.ProjectName, jobName scheduler.JobName) (*scheduler.Job, error) GetJobDetails(ctx context.Context, projectName tenant.ProjectName, jobName scheduler.JobName) (*scheduler.JobWithDetails, error) GetAll(ctx context.Context, projectName tenant.ProjectName) ([]*scheduler.JobWithDetails, error) + GetJobs(ctx context.Context, projectName tenant.ProjectName, jobs []string) ([]*scheduler.JobWithDetails, error) } type JobRunRepository interface { @@ -36,6 +43,7 @@ type JobRunRepository interface { GetByScheduledAt(ctx context.Context, tenant tenant.Tenant, name scheduler.JobName, scheduledAt time.Time) (*scheduler.JobRun, error) Create(ctx context.Context, tenant tenant.Tenant, name scheduler.JobName, scheduledAt time.Time, slaDefinitionInSec int64) error Update(ctx context.Context, jobRunID uuid.UUID, endTime time.Time, jobRunStatus scheduler.State) error + UpdateState(ctx context.Context, jobRunID uuid.UUID, jobRunStatus scheduler.State) error UpdateSLA(ctx context.Context, slaObjects []*scheduler.SLAObject) error UpdateMonitoring(ctx context.Context, jobRunID uuid.UUID, monitoring map[string]any) error } @@ -65,11 +73,16 @@ type Scheduler interface { DeleteJobs(ctx context.Context, t tenant.Tenant, jobsToDelete []string) error } +type EventHandler interface { + HandleEvent(moderator.Event) +} + type JobRunService struct { l log.Logger repo JobRunRepository replayRepo JobReplayRepository operatorRunRepo OperatorRunRepository + eventHandler EventHandler scheduler Scheduler jobRepo JobRepository priorityResolver PriorityResolver @@ -79,25 +92,31 @@ type JobRunService struct { func (s *JobRunService) JobRunInput(ctx context.Context, projectName tenant.ProjectName, jobName scheduler.JobName, config scheduler.RunConfig) (*scheduler.ExecutorInput, error) { job, err := s.jobRepo.GetJob(ctx, projectName, jobName) if err != nil { + s.l.Error("error getting job [%s]: %s", jobName, err) return nil, err } // TODO: Use scheduled_at instead of executed_at for computations, for deterministic calculations // Todo: later, always return scheduleTime, for scheduleTimes greater than a given date var jobRun *scheduler.JobRun if config.JobRunID.IsEmpty() { + s.l.Warn("getting job run by scheduled at") jobRun, err = s.repo.GetByScheduledAt(ctx, job.Tenant, jobName, config.ScheduledAt) } else { + s.l.Warn("getting job run by id") jobRun, err = s.repo.GetByID(ctx, config.JobRunID) } + var executedAt time.Time if err != nil { // Fallback for executed_at to scheduled_at executedAt = config.ScheduledAt + s.l.Warn("suppressed error is encountered when getting job run: %s", err) } else { executedAt = jobRun.StartTime } // Additional task config from existing replay replayJobConfig, err := s.replayRepo.GetReplayJobConfig(ctx, job.Tenant, job.Name, config.ScheduledAt) if err != nil { + s.l.Error("error getting replay job config from db: %s", err) return nil, err } for k, v := range replayJobConfig { @@ -110,39 +129,40 @@ func (s *JobRunService) JobRunInput(ctx context.Context, projectName tenant.Proj func (s *JobRunService) GetJobRuns(ctx context.Context, projectName tenant.ProjectName, jobName scheduler.JobName, criteria *scheduler.JobRunsCriteria) ([]*scheduler.JobRunStatus, error) { jobWithDetails, err := s.jobRepo.GetJobDetails(ctx, projectName, jobName) if err != nil { - return nil, fmt.Errorf("unable to get job details from DB for jobName: %s, project:%s, error:%w ", jobName, projectName, err) + msg := fmt.Sprintf("unable to get job details for jobName: %s, project:%s", jobName, projectName) + s.l.Error(msg) + return nil, errors.AddErrContext(err, scheduler.EntityJobRun, msg) } interval := jobWithDetails.Schedule.Interval if interval == "" { - return nil, fmt.Errorf("job schedule interval not found") + s.l.Error("job schedule interval is empty") + return nil, errors.InvalidArgument(scheduler.EntityJobRun, "cannot get job runs, job interval is empty") } - // jobCron jobCron, err := cron.ParseCronSchedule(interval) if err != nil { - return nil, fmt.Errorf("unable to parse job cron interval %w", err) + msg := fmt.Sprintf("unable to parse job cron interval: %s", err) + s.l.Error(msg) + return nil, errors.InternalError(scheduler.EntityJobRun, msg, nil) } if criteria.OnlyLastRun { + s.l.Warn("getting last run only") return s.scheduler.GetJobRuns(ctx, jobWithDetails.Job.Tenant, criteria, jobCron) } - // validate job query err = validateJobQuery(criteria, jobWithDetails) if err != nil { + s.l.Error("invalid job query: %s", err) return nil, err } - // get expected runs StartDate and EndDate inclusive expectedRuns := getExpectedRuns(jobCron, criteria.StartDate, criteria.EndDate) - // call to airflow for get runs actualRuns, err := s.scheduler.GetJobRuns(ctx, jobWithDetails.Job.Tenant, criteria, jobCron) if err != nil { - s.l.Error(fmt.Sprintf("unable to get job runs from airflow err: %v", err.Error())) + s.l.Error("unable to get job runs from airflow err: %s", err) actualRuns = []*scheduler.JobRunStatus{} } - // mergeRuns totalRuns := mergeRuns(expectedRuns, actualRuns) - // filterRuns result := filterRuns(totalRuns, createFilterSet(criteria.Filter)) return result, nil @@ -164,16 +184,16 @@ func getExpectedRuns(spec *cron.ScheduleSpec, startTime, endTime time.Time) []*s } func mergeRuns(expected, actual []*scheduler.JobRunStatus) []*scheduler.JobRunStatus { - var mergeRuns []*scheduler.JobRunStatus + var merged []*scheduler.JobRunStatus m := actualRunMap(actual) for _, exp := range expected { if act, ok := m[exp.ScheduledAt.UTC().String()]; ok { - mergeRuns = append(mergeRuns, &act) + merged = append(merged, &act) } else { - mergeRuns = append(mergeRuns, exp) + merged = append(merged, exp) } } - return mergeRuns + return merged } func actualRunMap(runs []*scheduler.JobRunStatus) map[string]scheduler.JobRunStatus { @@ -208,13 +228,10 @@ func createFilterSet(filter []string) map[string]struct{} { func validateJobQuery(jobQuery *scheduler.JobRunsCriteria, jobWithDetails *scheduler.JobWithDetails) error { jobStartDate := jobWithDetails.Schedule.StartDate if jobStartDate.IsZero() { - return fmt.Errorf("job schedule startDate not found in job fetched from DB") + return errors.InternalError(scheduler.EntityJobRun, "job schedule startDate not found in job", nil) } - givenStartDate := jobQuery.StartDate - givenEndDate := jobQuery.EndDate - - if givenStartDate.Before(jobStartDate) || givenEndDate.Before(jobStartDate) { - return fmt.Errorf("invalid date range") + if jobQuery.StartDate.Before(jobStartDate) || jobQuery.EndDate.Before(jobStartDate) { + return errors.InvalidArgument(scheduler.EntityJobRun, "invalid date range, interval contains dates before job start") } return nil } @@ -222,26 +239,26 @@ func validateJobQuery(jobQuery *scheduler.JobRunsCriteria, jobWithDetails *sched func (s *JobRunService) registerNewJobRun(ctx context.Context, tenant tenant.Tenant, jobName scheduler.JobName, scheduledAt time.Time) error { job, err := s.jobRepo.GetJobDetails(ctx, tenant.ProjectName(), jobName) if err != nil { + s.l.Error("error getting job details for job [%s]: %s", jobName, err) return err } slaDefinitionInSec, err := job.SLADuration() if err != nil { + s.l.Error("error getting sla duration: %s", err) return err } - telemetry.NewGauge("total_jobs_running", map[string]string{ - "project": tenant.ProjectName().String(), - "namespace": tenant.NamespaceName().String(), - }).Inc() err = s.repo.Create(ctx, tenant, jobName, scheduledAt, slaDefinitionInSec) if err != nil { + s.l.Error("error creating job run: %s", err) return err } - telemetry.NewCounter("scheduler_operator_durations_seconds", map[string]string{ + telemetry.NewGauge("jobrun_durations_breakdown_seconds", map[string]string{ "project": tenant.ProjectName().String(), "namespace": tenant.NamespaceName().String(), + "job": jobName.String(), "type": scheduleDelay.String(), - }).Add(float64(time.Now().Unix() - scheduledAt.Unix())) + }).Set(float64(time.Now().Unix() - scheduledAt.Unix())) return nil } @@ -250,14 +267,18 @@ func (s *JobRunService) getJobRunByScheduledAt(ctx context.Context, tenant tenan jobRun, err := s.repo.GetByScheduledAt(ctx, tenant, jobName, scheduledAt) if err != nil { if !errors.IsErrorType(err, errors.ErrNotFound) { + s.l.Error("error getting job run by scheduled at: %s", err) return nil, err } + // TODO: consider moving below call outside as the caller is a 'getter' err = s.registerNewJobRun(ctx, tenant, jobName, scheduledAt) if err != nil { + s.l.Error("error registering new job run: %s", err) return nil, err } jobRun, err = s.repo.GetByScheduledAt(ctx, tenant, jobName, scheduledAt) if err != nil { + s.l.Error("error getting the registered job run: %s", err) return nil, err } } @@ -268,23 +289,15 @@ func (s *JobRunService) updateJobRun(ctx context.Context, event *scheduler.Event var jobRun *scheduler.JobRun jobRun, err := s.getJobRunByScheduledAt(ctx, event.Tenant, event.JobName, event.JobScheduledAt) if err != nil { + s.l.Error("error getting job run by schedule time [%s]: %s", event.JobScheduledAt, err) return err } - for _, state := range scheduler.TaskEndStates { - if event.Status == state { - // this can go negative, because it is possible that when we deploy certain job have already started, - // and the very first events we get are that of task end states, to handle this, we should treat the lowest - // value as the base value. - telemetry.NewGauge("total_jobs_running", map[string]string{ - "project": event.Tenant.ProjectName().String(), - "namespace": event.Tenant.NamespaceName().String(), - }).Dec() - break - } - } if err := s.repo.Update(ctx, jobRun.ID, event.EventTime, event.Status); err != nil { + s.l.Error("error updating job run with id [%s]: %s", jobRun.ID, err) return err } + jobRun.State = event.Status + s.raiseJobRunStateChangeEvent(jobRun) monitoringValues := s.getMonitoringValues(event) return s.repo.UpdateMonitoring(ctx, jobRun.ID, monitoringValues) } @@ -298,24 +311,77 @@ func (*JobRunService) getMonitoringValues(event *scheduler.Event) map[string]any } func (s *JobRunService) updateJobRunSLA(ctx context.Context, event *scheduler.Event) error { + telemetry.NewCounter(metricJobRunEvents, map[string]string{ + "project": event.Tenant.ProjectName().String(), + "namespace": event.Tenant.NamespaceName().String(), + "name": event.JobName.String(), + "status": scheduler.SLAMissEvent.String(), + }).Inc() if len(event.SLAObjectList) > 0 { return s.repo.UpdateSLA(ctx, event.SLAObjectList) } return nil } +func operatorStartToJobState(operatorType scheduler.OperatorType) (scheduler.State, error) { + switch operatorType { + case scheduler.OperatorTask: + return scheduler.StateInProgress, nil + case scheduler.OperatorSensor: + return scheduler.StateWaitUpstream, nil + case scheduler.OperatorHook: + return scheduler.StateInProgress, nil + default: + return "", errors.InvalidArgument(scheduler.EntityJobRun, "Invalid operator type") + } +} + +func (s *JobRunService) raiseJobRunStateChangeEvent(jobRun *scheduler.JobRun) { + var schedulerEvent moderator.Event + var err error + switch jobRun.State { + case scheduler.StateWaitUpstream: + schedulerEvent, err = event.NewJobRunWaitUpstreamEvent(jobRun) + case scheduler.StateInProgress: + schedulerEvent, err = event.NewJobRunInProgressEvent(jobRun) + case scheduler.StateSuccess: + schedulerEvent, err = event.NewJobRunSuccessEvent(jobRun) + case scheduler.StateFailed: + schedulerEvent, err = event.NewJobRunFailedEvent(jobRun) + } + if err != nil { + s.l.Error("error creating event for job run state change : %s", err) + return + } + s.eventHandler.HandleEvent(schedulerEvent) + telemetry.NewCounter(metricJobRunEvents, map[string]string{ + "project": jobRun.Tenant.ProjectName().String(), + "namespace": jobRun.Tenant.NamespaceName().String(), + "name": jobRun.JobName.String(), + "status": jobRun.State.String(), + }).Inc() +} + func (s *JobRunService) createOperatorRun(ctx context.Context, event *scheduler.Event, operatorType scheduler.OperatorType) error { jobRun, err := s.getJobRunByScheduledAt(ctx, event.Tenant, event.JobName, event.JobScheduledAt) if err != nil { + s.l.Error("error getting job run by scheduled time [%s]: %s", event.JobScheduledAt, err) return err } - if operatorType == scheduler.OperatorTask { - telemetry.NewGauge("count_running_tasks", map[string]string{ - "project": event.Tenant.ProjectName().String(), - "namespace": event.Tenant.NamespaceName().String(), - "type": event.OperatorName, - }).Inc() + jobState, err := operatorStartToJobState(operatorType) + if err != nil { + s.l.Error("error converting operator to job state: %s", err) + return err } + if jobRun.State != jobState { + err := s.repo.UpdateState(ctx, jobRun.ID, jobState) + if err != nil { + s.l.Error("error updating state for job run id [%d] to [%s]: %s", jobRun.ID, jobState, err) + return err + } + s.raiseJobRunStateChangeEvent(jobRun) + } + return s.operatorRunRepo.CreateOperatorRun(ctx, event.OperatorName, operatorType, jobRun.ID, event.EventTime) } @@ -324,14 +390,20 @@ func (s *JobRunService) getOperatorRun(ctx context.Context, event *scheduler.Eve operatorRun, err := s.operatorRunRepo.GetOperatorRun(ctx, event.OperatorName, operatorType, jobRunID) if err != nil { if !errors.IsErrorType(err, errors.ErrNotFound) { + s.l.Error("error getting operator for job run [%s]: %s", jobRunID, err) return nil, err } + s.l.Warn("operator is not found, creating it") + + // TODO: consider moving below call outside as the caller is a 'getter' err = s.createOperatorRun(ctx, event, operatorType) if err != nil { + s.l.Error("error creating operator run: %s", err) return nil, err } operatorRun, err = s.operatorRunRepo.GetOperatorRun(ctx, event.OperatorName, operatorType, jobRunID) if err != nil { + s.l.Error("error getting the registered operator run: %s", err) return nil, err } } @@ -341,52 +413,68 @@ func (s *JobRunService) getOperatorRun(ctx context.Context, event *scheduler.Eve func (s *JobRunService) updateOperatorRun(ctx context.Context, event *scheduler.Event, operatorType scheduler.OperatorType) error { jobRun, err := s.getJobRunByScheduledAt(ctx, event.Tenant, event.JobName, event.JobScheduledAt) if err != nil { + s.l.Error("error getting job run by scheduled time [%s]: %s", event.JobScheduledAt, err) return err } operatorRun, err := s.getOperatorRun(ctx, event, operatorType, jobRun.ID) if err != nil { + s.l.Error("error getting operator for job run id [%s]: %s", jobRun.ID, err) return err } - if operatorType == scheduler.OperatorTask { - for _, state := range scheduler.TaskEndStates { - if event.Status == state { - // this can go negative, because it is possible that when we deploy certain job have already started, - // and the very first events we get are that of task end states, to handle this, we should treat the lowest - // value as the base value. - telemetry.NewGauge("count_running_tasks", map[string]string{ - "project": event.Tenant.ProjectName().String(), - "namespace": event.Tenant.NamespaceName().String(), - "type": event.OperatorName, - }).Dec() - break - } - } - } err = s.operatorRunRepo.UpdateOperatorRun(ctx, operatorType, operatorRun.ID, event.EventTime, event.Status) if err != nil { + s.l.Error("error updating operator run id [%s]: %s", operatorRun.ID, err) return err } - telemetry.NewCounter("scheduler_operator_durations_seconds", map[string]string{ + telemetry.NewGauge("jobrun_durations_breakdown_seconds", map[string]string{ "project": event.Tenant.ProjectName().String(), "namespace": event.Tenant.NamespaceName().String(), + "job": event.JobName.String(), "type": operatorType.String(), - }).Add(float64(event.EventTime.Unix() - operatorRun.StartTime.Unix())) + }).Set(float64(event.EventTime.Unix() - operatorRun.StartTime.Unix())) return nil } func (s *JobRunService) trackEvent(event *scheduler.Event) { if event.Type.IsOfType(scheduler.EventCategorySLAMiss) { - s.l.Debug(fmt.Sprintf("received event: %v, jobName: %v , slaPayload: %#v", - event.Type, event.JobName, event.SLAObjectList)) + jsonSLAObjectList, err := json.Marshal(event.SLAObjectList) + if err != nil { + jsonSLAObjectList = []byte("unable to json Marshal SLAObjectList") + } + s.l.Info("received job sla_miss event, jobName: %v , slaPayload: %s", event.JobName, string(jsonSLAObjectList)) } else { - s.l.Debug(fmt.Sprintf("received event: %v, eventTime: %s, jobName: %v, Operator: %v, schedule: %s, status: %s", - event.Type, event.EventTime.Format("01/02/06 15:04:05 MST"), event.JobName, event.OperatorName, event.JobScheduledAt.Format("01/02/06 15:04:05 MST"), event.Status)) + s.l.Info("received event: %v, eventTime: %s, jobName: %v, Operator: %v, schedule: %s, status: %s", + event.Type, event.EventTime.Format("01/02/06 15:04:05 MST"), event.JobName, event.OperatorName, event.JobScheduledAt.Format("01/02/06 15:04:05 MST"), event.Status) + } + + if event.Type == scheduler.SensorStartEvent || event.Type == scheduler.SensorRetryEvent || event.Type == scheduler.SensorSuccessEvent || event.Type == scheduler.SensorFailEvent { + eventType := strings.TrimPrefix(event.Type.String(), fmt.Sprintf("%s_", scheduler.OperatorSensor)) + telemetry.NewCounter("jobrun_sensor_events_total", map[string]string{ + "project": event.Tenant.ProjectName().String(), + "namespace": event.Tenant.NamespaceName().String(), + "event_type": eventType, + }).Inc() + return + } + if event.Type == scheduler.TaskStartEvent || event.Type == scheduler.TaskRetryEvent || event.Type == scheduler.TaskSuccessEvent || event.Type == scheduler.TaskFailEvent { + eventType := strings.TrimPrefix(event.Type.String(), fmt.Sprintf("%s_", scheduler.OperatorTask)) + telemetry.NewCounter("jobrun_task_events_total", map[string]string{ + "project": event.Tenant.ProjectName().String(), + "namespace": event.Tenant.NamespaceName().String(), + "event_type": eventType, + "operator": event.OperatorName, + }).Inc() + return + } + if event.Type == scheduler.HookStartEvent || event.Type == scheduler.HookRetryEvent || event.Type == scheduler.HookSuccessEvent || event.Type == scheduler.HookFailEvent { + eventType := strings.TrimPrefix(event.Type.String(), fmt.Sprintf("%s_", scheduler.OperatorHook)) + telemetry.NewCounter("jobrun_hook_events_total", map[string]string{ + "project": event.Tenant.ProjectName().String(), + "namespace": event.Tenant.NamespaceName().String(), + "event_type": eventType, + "operator": event.OperatorName, + }).Inc() } - telemetry.NewGauge("scheduler_events", map[string]string{ - "project": event.Tenant.ProjectName().String(), - "namespace": event.Tenant.NamespaceName().String(), - "type": event.Type.String(), - }).Inc() } func (s *JobRunService) UpdateJobState(ctx context.Context, event *scheduler.Event) error { @@ -415,13 +503,14 @@ func (s *JobRunService) UpdateJobState(ctx context.Context, event *scheduler.Eve } func NewJobRunService(logger log.Logger, jobRepo JobRepository, jobRunRepo JobRunRepository, replayRepo JobReplayRepository, - operatorRunRepo OperatorRunRepository, scheduler Scheduler, resolver PriorityResolver, compiler JobInputCompiler, + operatorRunRepo OperatorRunRepository, scheduler Scheduler, resolver PriorityResolver, compiler JobInputCompiler, eventHandler EventHandler, ) *JobRunService { return &JobRunService{ l: logger, repo: jobRunRepo, operatorRunRepo: operatorRunRepo, scheduler: scheduler, + eventHandler: eventHandler, replayRepo: replayRepo, jobRepo: jobRepo, priorityResolver: resolver, diff --git a/core/scheduler/service/job_run_service_test.go b/core/scheduler/service/job_run_service_test.go index e78dbf1b80..167e159c79 100644 --- a/core/scheduler/service/job_run_service_test.go +++ b/core/scheduler/service/job_run_service_test.go @@ -7,15 +7,16 @@ import ( "time" "github.com/google/uuid" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/service" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/core/event/moderator" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/lib/cron" ) func TestJobRunService(t *testing.T) { @@ -37,7 +38,7 @@ func TestJobRunService(t *testing.T) { t.Run("should reject unregistered events", func(t *testing.T) { runService := service.NewJobRunService(logger, - nil, nil, nil, nil, nil, nil, nil) + nil, nil, nil, nil, nil, nil, nil, nil) event := &scheduler.Event{ JobName: jobName, @@ -60,7 +61,7 @@ func TestJobRunService(t *testing.T) { defer jobRepo.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, jobRunRepository, nil, nil, nil, nil, nil) + jobRepo, jobRunRepository, nil, nil, nil, nil, nil, nil) event := &scheduler.Event{ JobName: jobName, @@ -105,7 +106,7 @@ func TestJobRunService(t *testing.T) { defer jobRunRepository.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, jobRunRepository, nil, nil, nil, nil, nil) + jobRepo, jobRunRepository, nil, nil, nil, nil, nil, nil) event := &scheduler.Event{ JobName: jobName, @@ -179,8 +180,12 @@ func TestJobRunService(t *testing.T) { operatorRunRepo := new(mockOperatorRunRepository) defer operatorRunRepo.AssertExpectations(t) + eventHandler := newEventHandler(t) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + defer eventHandler.AssertExpectations(t) + runService := service.NewJobRunService(logger, - jobRepo, jobRunRepo, nil, operatorRunRepo, nil, nil, nil) + jobRepo, jobRunRepo, nil, operatorRunRepo, nil, nil, nil, eventHandler) err = runService.UpdateJobState(ctx, event) assert.Nil(t, err) @@ -218,8 +223,12 @@ func TestJobRunService(t *testing.T) { jobRunRepo.On("UpdateMonitoring", ctx, jobRun.ID, monitoring).Return(nil) defer jobRunRepo.AssertExpectations(t) + eventHandler := newEventHandler(t) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + defer eventHandler.AssertExpectations(t) + runService := service.NewJobRunService(logger, - nil, jobRunRepo, nil, nil, nil, nil, nil) + nil, jobRunRepo, nil, nil, nil, nil, nil, eventHandler) err := runService.UpdateJobState(ctx, event) assert.Nil(t, err) @@ -245,9 +254,6 @@ func TestJobRunService(t *testing.T) { }, }, } - jobRepo := new(JobRepository) - jobRepo.On("GetJobDetails", ctx, projName, jobName).Return(&jobWithDetails, nil) - defer jobRepo.AssertExpectations(t) scheduledAtTimeStamp, _ := time.Parse(scheduler.ISODateFormat, "2022-01-02T15:04:05Z") eventTime := time.Unix(todayDate.Add(time.Hour).Unix(), 0) @@ -279,7 +285,7 @@ func TestJobRunService(t *testing.T) { defer jobRunRepo.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, jobRunRepo, nil, nil, nil, nil, nil) + nil, jobRunRepo, nil, nil, nil, nil, nil, nil) err := runService.UpdateJobState(ctx, event) assert.NotNil(t, err) @@ -291,8 +297,12 @@ func TestJobRunService(t *testing.T) { jobRunRepo.On("Create", ctx, tnnt, jobName, scheduledAtTimeStamp, slaDefinitionInSec).Return(fmt.Errorf("unable to create job run")).Once() defer jobRunRepo.AssertExpectations(t) + jobRepo := new(JobRepository) + jobRepo.On("GetJobDetails", ctx, projName, jobName).Return(&jobWithDetails, nil) + defer jobRepo.AssertExpectations(t) + runService := service.NewJobRunService(logger, - jobRepo, jobRunRepo, nil, nil, nil, nil, nil) + jobRepo, jobRunRepo, nil, nil, nil, nil, nil, nil) err := runService.UpdateJobState(ctx, event) assert.NotNil(t, err) @@ -304,8 +314,12 @@ func TestJobRunService(t *testing.T) { jobRunRepo.On("Create", ctx, tnnt, jobName, scheduledAtTimeStamp, slaDefinitionInSec).Return(nil) defer jobRunRepo.AssertExpectations(t) + jobRepo := new(JobRepository) + jobRepo.On("GetJobDetails", ctx, projName, jobName).Return(&jobWithDetails, nil) + defer jobRepo.AssertExpectations(t) + runService := service.NewJobRunService(logger, - jobRepo, jobRunRepo, nil, nil, nil, nil, nil) + jobRepo, jobRunRepo, nil, nil, nil, nil, nil, nil) err := runService.UpdateJobState(ctx, event) assert.NotNil(t, err) @@ -320,8 +334,16 @@ func TestJobRunService(t *testing.T) { jobRunRepo.On("UpdateMonitoring", ctx, jobRun.ID, monitoring).Return(nil) defer jobRunRepo.AssertExpectations(t) + eventHandler := newEventHandler(t) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + defer eventHandler.AssertExpectations(t) + + jobRepo := new(JobRepository) + jobRepo.On("GetJobDetails", ctx, projName, jobName).Return(&jobWithDetails, nil) + defer jobRepo.AssertExpectations(t) + runService := service.NewJobRunService(logger, - jobRepo, jobRunRepo, nil, nil, nil, nil, nil) + jobRepo, jobRunRepo, nil, nil, nil, nil, nil, eventHandler) err := runService.UpdateJobState(ctx, event) assert.Nil(t, err) @@ -347,7 +369,7 @@ func TestJobRunService(t *testing.T) { defer jobRunRepo.AssertExpectations(t) runService := service.NewJobRunService(logger, - nil, jobRunRepo, nil, nil, nil, nil, nil) + nil, jobRunRepo, nil, nil, nil, nil, nil, nil) err := runService.UpdateJobState(ctx, event) assert.NotNil(t, err) @@ -370,7 +392,7 @@ func TestJobRunService(t *testing.T) { defer jobRunRepo.AssertExpectations(t) runService := service.NewJobRunService(logger, - nil, jobRunRepo, nil, nil, nil, nil, nil) + nil, jobRunRepo, nil, nil, nil, nil, nil, nil) err := runService.UpdateJobState(ctx, event) assert.NotNil(t, err) @@ -393,7 +415,7 @@ func TestJobRunService(t *testing.T) { defer jobRunRepo.AssertExpectations(t) runService := service.NewJobRunService(logger, - nil, jobRunRepo, nil, nil, nil, nil, nil) + nil, jobRunRepo, nil, nil, nil, nil, nil, nil) err := runService.UpdateJobState(ctx, event) assert.NotNil(t, err) @@ -422,6 +444,7 @@ func TestJobRunService(t *testing.T) { jobRunRepo := new(mockJobRunRepository) jobRunRepo.On("GetByScheduledAt", ctx, tnnt, jobName, scheduledAtTimeStamp).Return(&jobRun, nil) + jobRunRepo.On("UpdateState", ctx, jobRun.ID, scheduler.StateInProgress).Return(nil) defer jobRunRepo.AssertExpectations(t) t.Run("should pass creating new operator run ", func(t *testing.T) { @@ -429,8 +452,12 @@ func TestJobRunService(t *testing.T) { operatorRunRepository.On("CreateOperatorRun", ctx, event.OperatorName, scheduler.OperatorTask, jobRun.ID, eventTime).Return(nil) defer operatorRunRepository.AssertExpectations(t) + eventHandler := newEventHandler(t) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + defer eventHandler.AssertExpectations(t) + runService := service.NewJobRunService(logger, - nil, jobRunRepo, nil, operatorRunRepository, nil, nil, nil) + nil, jobRunRepo, nil, operatorRunRepository, nil, nil, nil, eventHandler) err := runService.UpdateJobState(ctx, event) assert.Nil(t, err) @@ -461,10 +488,6 @@ func TestJobRunService(t *testing.T) { StartTime: time.Now(), } - jobRunRepo := new(mockJobRunRepository) - jobRunRepo.On("GetByScheduledAt", ctx, tnnt, jobName, scheduledAtTimeStamp).Return(&jobRun, nil) - defer jobRunRepo.AssertExpectations(t) - operatorRun := scheduler.OperatorRun{ ID: uuid.New(), Name: "task_bq2bq", @@ -477,8 +500,18 @@ func TestJobRunService(t *testing.T) { operatorRunRepository.On("GetOperatorRun", ctx, event.OperatorName, scheduler.OperatorTask, jobRun.ID).Return(nil, errors.NotFound(scheduler.EntityEvent, "operator not found in db")).Once() operatorRunRepository.On("CreateOperatorRun", ctx, event.OperatorName, scheduler.OperatorTask, jobRun.ID, eventTime).Return(fmt.Errorf("some error in creating operator run")) defer operatorRunRepository.AssertExpectations(t) + + jobRunRepo := new(mockJobRunRepository) + jobRunRepo.On("GetByScheduledAt", ctx, tnnt, jobName, scheduledAtTimeStamp).Return(&jobRun, nil) + jobRunRepo.On("UpdateState", ctx, jobRun.ID, scheduler.StateInProgress).Return(nil) + defer jobRunRepo.AssertExpectations(t) + + eventHandler := newEventHandler(t) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + defer eventHandler.AssertExpectations(t) + runService := service.NewJobRunService(logger, - nil, jobRunRepo, nil, operatorRunRepository, nil, nil, nil) + nil, jobRunRepo, nil, operatorRunRepository, nil, nil, nil, eventHandler) err := runService.UpdateJobState(ctx, event) assert.NotNil(t, err) @@ -490,8 +523,18 @@ func TestJobRunService(t *testing.T) { operatorRunRepository.On("CreateOperatorRun", ctx, event.OperatorName, scheduler.OperatorTask, jobRun.ID, eventTime).Return(nil) operatorRunRepository.On("GetOperatorRun", ctx, event.OperatorName, scheduler.OperatorTask, jobRun.ID).Return(nil, fmt.Errorf("some error in getting operator run")).Once() defer operatorRunRepository.AssertExpectations(t) + + jobRunRepo := new(mockJobRunRepository) + jobRunRepo.On("GetByScheduledAt", ctx, tnnt, jobName, scheduledAtTimeStamp).Return(&jobRun, nil) + jobRunRepo.On("UpdateState", ctx, jobRun.ID, scheduler.StateInProgress).Return(nil) + defer jobRunRepo.AssertExpectations(t) + + eventHandler := newEventHandler(t) + eventHandler.On("HandleEvent", mock.Anything).Times(1) + defer eventHandler.AssertExpectations(t) + runService := service.NewJobRunService(logger, - nil, jobRunRepo, nil, operatorRunRepository, nil, nil, nil) + nil, jobRunRepo, nil, operatorRunRepository, nil, nil, nil, eventHandler) err := runService.UpdateJobState(ctx, event) assert.NotNil(t, err) @@ -502,8 +545,13 @@ func TestJobRunService(t *testing.T) { operatorRunRepository.On("GetOperatorRun", ctx, event.OperatorName, scheduler.OperatorTask, jobRun.ID).Return(&operatorRun, nil) operatorRunRepository.On("UpdateOperatorRun", ctx, scheduler.OperatorTask, operatorRun.ID, eventTime, scheduler.StateSuccess).Return(nil) defer operatorRunRepository.AssertExpectations(t) + + jobRunRepo := new(mockJobRunRepository) + jobRunRepo.On("GetByScheduledAt", ctx, tnnt, jobName, scheduledAtTimeStamp).Return(&jobRun, nil) + defer jobRunRepo.AssertExpectations(t) + runService := service.NewJobRunService(logger, - nil, jobRunRepo, nil, operatorRunRepository, nil, nil, nil) + nil, jobRunRepo, nil, operatorRunRepository, nil, nil, nil, nil) err := runService.UpdateJobState(ctx, event) assert.Nil(t, err) @@ -529,7 +577,7 @@ func TestJobRunService(t *testing.T) { defer jobRunRepo.AssertExpectations(t) runService := service.NewJobRunService(logger, - nil, jobRunRepo, nil, nil, nil, nil, nil) + nil, jobRunRepo, nil, nil, nil, nil, nil, nil) err := runService.UpdateJobState(ctx, event) assert.NotNil(t, err) @@ -566,7 +614,7 @@ func TestJobRunService(t *testing.T) { // operatorRunRepository.On("UpdateOperatorRun", ctx, scheduler.OperatorSensor, operatorRun.ID, eventTime, "success").Return(nil) defer operatorRunRepository.AssertExpectations(t) runService := service.NewJobRunService(logger, - nil, jobRunRepo, nil, operatorRunRepository, nil, nil, nil) + nil, jobRunRepo, nil, operatorRunRepository, nil, nil, nil, nil) err := runService.UpdateJobState(ctx, event) assert.NotNil(t, err) @@ -582,7 +630,7 @@ func TestJobRunService(t *testing.T) { defer jobRepo.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, nil, nil, nil, nil, nil, nil) + jobRepo, nil, nil, nil, nil, nil, nil, nil) executorInput, err := runService.JobRunInput(ctx, projName, jobName, scheduler.RunConfig{}) assert.Nil(t, executorInput) assert.NotNil(t, err) @@ -640,7 +688,7 @@ func TestJobRunService(t *testing.T) { defer jobInputCompiler.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, jobRunRepo, jobReplayRepo, nil, nil, nil, jobInputCompiler) + jobRepo, jobRunRepo, jobReplayRepo, nil, nil, nil, jobInputCompiler, nil) executorInput, err := runService.JobRunInput(ctx, projName, jobName, runConfig) assert.Equal(t, &dummyExecutorInput, executorInput) @@ -700,7 +748,7 @@ func TestJobRunService(t *testing.T) { defer jobInputCompiler.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, jobRunRepo, jobReplayRepo, nil, nil, nil, jobInputCompiler) + jobRepo, jobRunRepo, jobReplayRepo, nil, nil, nil, jobInputCompiler, nil) executorInput, err := runService.JobRunInput(ctx, projName, jobName, runConfig) assert.Equal(t, &dummyExecutorInput, executorInput) @@ -753,7 +801,7 @@ func TestJobRunService(t *testing.T) { defer jobInputCompiler.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, jobRunRepo, jobReplayRepo, nil, nil, nil, jobInputCompiler) + jobRepo, jobRunRepo, jobReplayRepo, nil, nil, nil, jobInputCompiler, nil) executorInput, err := runService.JobRunInput(ctx, projName, jobName, runConfig) assert.Equal(t, &dummyExecutorInput, executorInput) @@ -805,7 +853,7 @@ func TestJobRunService(t *testing.T) { defer jobInputCompiler.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, jobRunRepo, jobReplayRepo, nil, nil, nil, jobInputCompiler) + jobRepo, jobRunRepo, jobReplayRepo, nil, nil, nil, jobInputCompiler, nil) executorInput, err := runService.JobRunInput(ctx, projName, jobName, runConfig) assert.Nil(t, err) @@ -838,10 +886,10 @@ func TestJobRunService(t *testing.T) { defer jobRepo.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, nil, nil, nil, nil, nil, nil) + jobRepo, nil, nil, nil, nil, nil, nil, nil) returnedRuns, err := runService.GetJobRuns(ctx, projName, jobName, criteria) - assert.NotNil(t, err) - assert.EqualError(t, err, "unable to get job details from DB for jobName: sample_select, project:proj, error:some error in get job details ") + assert.Error(t, err) + assert.ErrorContains(t, err, "unable to get job details for jobName: sample_select, project:proj") assert.Nil(t, returnedRuns) }) t.Run("should not able to get job runs when scheduler returns empty response", func(t *testing.T) { @@ -876,10 +924,10 @@ func TestJobRunService(t *testing.T) { defer jobRepo.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, nil, nil, nil, sch, nil, nil) + jobRepo, nil, nil, nil, sch, nil, nil, nil) returnedRuns, err := runService.GetJobRuns(ctx, projName, jobName, criteria) assert.Nil(t, err) - assert.Nil(t, nil, returnedRuns) + assert.Nil(t, returnedRuns) }) t.Run("should able to get job runs when scheduler returns valid response", func(t *testing.T) { tnnt, _ := tenant.NewTenant(projName.String(), namespaceName.String()) @@ -1011,8 +1059,7 @@ func TestJobRunService(t *testing.T) { jobRepo.On("GetJobDetails", ctx, projName, jobName).Return(&jobWithDetails, nil) defer jobRepo.AssertExpectations(t) runService := service.NewJobRunService(logger, - jobRepo, nil, nil, nil, - sch, nil, nil) + jobRepo, nil, nil, nil, sch, nil, nil, nil) returnedRuns, err := runService.GetJobRuns(ctx, projName, jobName, scenario.input) assert.Nil(t, err) assert.Equal(t, scenario.expectedResult, returnedRuns) @@ -1048,11 +1095,11 @@ func TestJobRunService(t *testing.T) { jobRepo.On("GetJobDetails", ctx, projName, jobName).Return(&jobWithDetails, nil) defer jobRepo.AssertExpectations(t) - runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, nil, nil, nil) + runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, nil, nil, nil, nil) returnedRuns, err := runService.GetJobRuns(ctx, projName, jobName, jobQuery) - assert.NotNil(t, err) - assert.EqualError(t, err, "invalid date range") - assert.Nil(t, nil, returnedRuns) + assert.Error(t, err) + assert.ErrorContains(t, err, "invalid date range, interval contains dates before job start") + assert.Nil(t, returnedRuns) }) t.Run("should not able to get job runs when invalid cron interval present at DB", func(t *testing.T) { tnnt, _ := tenant.NewTenant(projName.String(), namespaceName.String()) @@ -1083,11 +1130,11 @@ func TestJobRunService(t *testing.T) { jobRepo.On("GetJobDetails", ctx, projName, jobName).Return(&jobWithDetails, nil) defer jobRepo.AssertExpectations(t) - runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, nil, nil, nil) + runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, nil, nil, nil, nil) returnedRuns, err := runService.GetJobRuns(ctx, projName, jobName, jobQuery) - assert.NotNil(t, err) - assert.EqualError(t, err, "unable to parse job cron interval expected exactly 5 fields, found 2: [invalid interval]") - assert.Nil(t, nil, returnedRuns) + assert.Error(t, err) + assert.ErrorContains(t, err, "unable to parse job cron interval: expected exactly 5 fields, found 2: [invalid interval]") + assert.Nil(t, returnedRuns) }) t.Run("should not able to get job runs when no cron interval present at DB", func(t *testing.T) { tnnt, _ := tenant.NewTenant(projName.String(), namespaceName.String()) @@ -1117,11 +1164,11 @@ func TestJobRunService(t *testing.T) { jobRepo.On("GetJobDetails", ctx, projName, jobName).Return(&jobWithDetails, nil) defer jobRepo.AssertExpectations(t) - runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, nil, nil, nil) + runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, nil, nil, nil, nil) returnedRuns, err := runService.GetJobRuns(ctx, projName, jobName, jobQuery) - assert.NotNil(t, err) - assert.EqualError(t, err, "job schedule interval not found") - assert.Nil(t, nil, returnedRuns) + assert.Error(t, err) + assert.ErrorContains(t, err, "cannot get job runs, job interval is empty") + assert.Nil(t, returnedRuns) }) t.Run("should not able to get job runs when no start date present at DB", func(t *testing.T) { tnnt, _ := tenant.NewTenant(projName.String(), namespaceName.String()) @@ -1149,11 +1196,11 @@ func TestJobRunService(t *testing.T) { jobRepo := new(JobRepository) jobRepo.On("GetJobDetails", ctx, projName, jobName).Return(&jobWithDetails, nil) defer jobRepo.AssertExpectations(t) - runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, nil, nil, nil) + runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, nil, nil, nil, nil) returnedRuns, err := runService.GetJobRuns(ctx, projName, jobName, jobQuery) - assert.NotNil(t, err) - assert.EqualError(t, err, "job schedule startDate not found in job fetched from DB") - assert.Nil(t, nil, returnedRuns) + assert.Error(t, err) + assert.ErrorContains(t, err, "job schedule startDate not found in job") + assert.Nil(t, returnedRuns) }) t.Run("should able to get job runs when only last run is required", func(t *testing.T) { tnnt, _ := tenant.NewTenant(projName.String(), namespaceName.String()) @@ -1192,7 +1239,7 @@ func TestJobRunService(t *testing.T) { jobRepo.On("GetJobDetails", ctx, projName, jobName).Return(&jobWithDetails, nil) defer jobRepo.AssertExpectations(t) - runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, sch, nil, nil) + runService := service.NewJobRunService(logger, jobRepo, nil, nil, nil, sch, nil, nil, nil) returnedRuns, err := runService.GetJobRuns(ctx, projName, jobName, criteria) assert.Nil(t, err) assert.Equal(t, runs, returnedRuns) @@ -1259,6 +1306,11 @@ func (m *mockJobRunRepository) Update(ctx context.Context, jobRunID uuid.UUID, e return args.Error(0) } +func (m *mockJobRunRepository) UpdateState(ctx context.Context, jobRunID uuid.UUID, jobRunStatus scheduler.State) error { + args := m.Called(ctx, jobRunID, jobRunStatus) + return args.Error(0) +} + func (m *mockJobRunRepository) UpdateSLA(ctx context.Context, slaObjects []*scheduler.SLAObject) error { args := m.Called(ctx, slaObjects) return args.Error(0) @@ -1297,6 +1349,14 @@ func (j *JobRepository) GetAll(ctx context.Context, projectName tenant.ProjectNa return args.Get(0).([]*scheduler.JobWithDetails), args.Error(1) } +func (j *JobRepository) GetJobs(ctx context.Context, projectName tenant.ProjectName, jobs []string) ([]*scheduler.JobWithDetails, error) { + args := j.Called(ctx, projectName, jobs) + if args.Get(0) == nil { + return nil, args.Error(1) + } + return args.Get(0).([]*scheduler.JobWithDetails), args.Error(1) +} + type mockScheduler struct { mock.Mock } @@ -1345,3 +1405,25 @@ func (m *mockOperatorRunRepository) UpdateOperatorRun(ctx context.Context, opera args := m.Called(ctx, operator, jobRunID, eventTime, state) return args.Error(0) } + +type mockEventHandler struct { + mock.Mock +} + +func (m *mockEventHandler) HandleEvent(e moderator.Event) { + m.Called(e) +} + +type mockConstructorEventHandler interface { + mock.TestingT + Cleanup(func()) +} + +func newEventHandler(t mockConstructorEventHandler) *mockEventHandler { + mock := &mockEventHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/scheduler/service/notification_service.go b/core/scheduler/service/notification_service.go index 2936735779..21a93aa3f3 100644 --- a/core/scheduler/service/notification_service.go +++ b/core/scheduler/service/notification_service.go @@ -6,24 +6,12 @@ import ( "io" "strings" - "github.com/odpf/salt/log" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/raystack/salt/log" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" -) - -var ( - jobFailureCounter = promauto.NewCounter(prometheus.CounterOpts{ - Name: "job_event_failure", - Help: "Event received for job failures by scheduler", - }) - jobSLAMissCounter = promauto.NewCounter(prometheus.CounterOpts{ - Name: "job_event_slamiss", - Help: "Event received for SLA miss by scheduler", - }) + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/telemetry" ) const ( @@ -46,6 +34,7 @@ type NotifyService struct { func (n *NotifyService) Push(ctx context.Context, event *scheduler.Event) error { jobDetails, err := n.jobRepo.GetJobDetails(ctx, event.Tenant.ProjectName(), event.JobName) if err != nil { + n.l.Error("error getting detail for job [%s]: %s", event.JobName, err) return err } notificationConfig := jobDetails.Alerts @@ -59,10 +48,12 @@ func (n *NotifyService) Push(ctx context.Context, event *scheduler.Event) error scheme := chanParts[0] route := chanParts[1] - n.l.Debug("notification event for job", "job spec name", event.JobName, "event", fmt.Sprintf("%v", event)) + n.l.Debug("notification event for job: %s , event: %+v", event.JobName, event) if plainTextSecretsList == nil { plainTextSecretsList, err = n.tenantService.GetSecrets(ctx, event.Tenant) if err != nil { + n.l.Error("error getting secrets for project [%s] namespace [%s]: %s", + event.Tenant.ProjectName().String(), event.Tenant.NamespaceName().String(), err) multierror.Append(err) continue } @@ -85,29 +76,30 @@ func (n *NotifyService) Push(ctx context.Context, event *scheduler.Event) error Secret: secret, Route: route, }); currErr != nil { - n.l.Error("Error: No notification event for job ", "current error", currErr) + n.l.Error("Error: No notification event for job current error: %s", currErr) multierror.Append(fmt.Errorf("notifyChannel.Notify: %s: %w", channel, currErr)) } } } + telemetry.NewCounter("jobrun_alerts_total", map[string]string{ + "project": event.Tenant.ProjectName().String(), + "namespace": event.Tenant.NamespaceName().String(), + "type": event.Type.String(), + }).Inc() } } - if event.Type.IsOfType(scheduler.EventCategoryJobFailure) { - jobFailureCounter.Inc() - } else if event.Type.IsOfType(scheduler.EventCategorySLAMiss) { - jobSLAMissCounter.Inc() - } - return errors.MultiToError(multierror) + return multierror.ToErr() } func (n *NotifyService) Close() error { - multierror := errors.NewMultiError("ErrorsInNotifyClose") + me := errors.NewMultiError("ErrorsInNotifyClose") for _, notify := range n.notifyChannels { if cerr := notify.Close(); cerr != nil { - multierror.Append(cerr) + n.l.Error("error closing notificication channel: %s", cerr) + me.Append(cerr) } } - return errors.MultiToError(multierror) + return me.ToErr() } func NewNotifyService(l log.Logger, jobRepo JobRepository, tenantService TenantService, notifyChan map[string]Notifier) *NotifyService { diff --git a/core/scheduler/service/notification_service_test.go b/core/scheduler/service/notification_service_test.go index 70f4c3719a..bc5a68e624 100644 --- a/core/scheduler/service/notification_service_test.go +++ b/core/scheduler/service/notification_service_test.go @@ -7,13 +7,13 @@ import ( "testing" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/service" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/service" + "github.com/raystack/optimus/core/tenant" ) func TestNotificationService(t *testing.T) { @@ -33,7 +33,7 @@ func TestNotificationService(t *testing.T) { jobRepo.On("GetJobDetails", ctx, project.Name(), jobName).Return(nil, fmt.Errorf("some error")) defer jobRepo.AssertExpectations(t) - notifyService := service.NewNotifyService(nil, jobRepo, nil, nil) + notifyService := service.NewNotifyService(logger, jobRepo, nil, nil) event := &scheduler.Event{ JobName: jobName, diff --git a/core/scheduler/service/replay_manager.go b/core/scheduler/service/replay_manager.go index 69ebad5e2f..7bf7f5db5c 100644 --- a/core/scheduler/service/replay_manager.go +++ b/core/scheduler/service/replay_manager.go @@ -3,13 +3,13 @@ package service import ( "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/robfig/cron/v3" "golang.org/x/net/context" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/internal/errors" ) const ( @@ -49,7 +49,7 @@ func (m ReplayManager) Initialize() { if m.schedule != nil { _, err := m.schedule.AddFunc(syncInterval, m.StartReplayLoop) if err != nil { - m.l.Error("Failed to sync replay", "error", err) + m.l.Error("Failed to add function to cron schedule: %s", err) } m.schedule.Start() } @@ -80,7 +80,7 @@ func (m ReplayManager) checkTimedOutReplay(ctx context.Context) { scheduler.ReplayStateInProgress, scheduler.ReplayStatePartialReplayed, scheduler.ReplayStateReplayed, }) if err != nil { - m.l.Error("unable to get on going replay") + m.l.Error("error getting ongoing replay: %s", err) } for _, replay := range onGoingReplays { @@ -90,8 +90,7 @@ func (m ReplayManager) checkTimedOutReplay(ctx context.Context) { } message := "replay timed out" if err := m.replayRepository.UpdateReplayStatus(ctx, replay.ID(), scheduler.ReplayStateFailed, message); err != nil { - m.l.Error("unable to mark replay %s as failed due to time out", replay.ID()) + m.l.Error("unable to mark replay [%s] as failed due to time out", replay.ID()) } - m.l.Info("replay %s timed out. marked as failed.", replay.ID()) } } diff --git a/core/scheduler/service/replay_manager_test.go b/core/scheduler/service/replay_manager_test.go index 1af1588ae4..24d05ea760 100644 --- a/core/scheduler/service/replay_manager_test.go +++ b/core/scheduler/service/replay_manager_test.go @@ -6,13 +6,13 @@ import ( "time" "github.com/google/uuid" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "golang.org/x/net/context" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/service" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/service" + "github.com/raystack/optimus/core/tenant" ) func TestReplayManager(t *testing.T) { diff --git a/core/scheduler/service/replay_service.go b/core/scheduler/service/replay_service.go index 20fb897f1d..d9d30d23ba 100644 --- a/core/scheduler/service/replay_service.go +++ b/core/scheduler/service/replay_service.go @@ -4,11 +4,20 @@ import ( "fmt" "github.com/google/uuid" + "github.com/raystack/salt/log" "golang.org/x/net/context" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/lib/cron" + "github.com/raystack/optimus/internal/telemetry" +) + +const ( + getReplaysDayLimit = 30 // TODO: make it configurable via cli + + metricJobReplay = "jobrun_replay_requests_total" ) type ReplayRepository interface { @@ -18,6 +27,8 @@ type ReplayRepository interface { GetReplayToExecute(context.Context) (*scheduler.ReplayWithRun, error) GetReplayRequestsByStatus(ctx context.Context, statusList []scheduler.ReplayState) ([]*scheduler.Replay, error) + GetReplaysByProject(ctx context.Context, projectName tenant.ProjectName, dayLimits int) ([]*scheduler.Replay, error) + GetReplayByID(ctx context.Context, replayID uuid.UUID) (*scheduler.ReplayWithRun, error) } type ReplayValidator interface { @@ -29,28 +40,63 @@ type ReplayService struct { jobRepo JobRepository validator ReplayValidator + + logger log.Logger } func (r ReplayService) CreateReplay(ctx context.Context, tenant tenant.Tenant, jobName scheduler.JobName, config *scheduler.ReplayConfig) (replayID uuid.UUID, err error) { subjectJob, err := r.jobRepo.GetJobDetails(ctx, tenant.ProjectName(), jobName) if err != nil { - return uuid.Nil, fmt.Errorf("unable to get job details from DB for jobName: %s, project:%s, error:%w ", jobName, tenant.ProjectName().String(), err) + r.logger.Error("error getting job details of [%s]: %s", jobName.String(), err) + return uuid.Nil, errors.AddErrContext(err, scheduler.EntityReplay, + fmt.Sprintf("unable to get job details for jobName: %s, project:%s", jobName, tenant.ProjectName().String())) + } + + if subjectJob.Job.Tenant.NamespaceName() != tenant.NamespaceName() { + r.logger.Error("job [%s] resides in namespace [%s], expecting it under [%s]", jobName, subjectJob.Job.Tenant.NamespaceName(), tenant.NamespaceName()) + return uuid.Nil, errors.InvalidArgument(scheduler.EntityReplay, fmt.Sprintf("job %s does not exist in %s namespace", jobName, tenant.NamespaceName().String())) } jobCron, err := cron.ParseCronSchedule(subjectJob.Schedule.Interval) if err != nil { - return uuid.Nil, fmt.Errorf("encountered unexpected error when parsing job cron interval for job %s: %w", jobName, err) + r.logger.Error("error parsing cron schedule for interval [%s]: %s", subjectJob.Schedule.Interval, err) + return uuid.Nil, errors.InternalError(scheduler.EntityReplay, "invalid cron interval for "+jobName.String(), err) } replayReq := scheduler.NewReplayRequest(jobName, tenant, config, scheduler.ReplayStateCreated) if err := r.validator.Validate(ctx, replayReq, jobCron); err != nil { + r.logger.Error("error validating replay request: %s", err) return uuid.Nil, err } runs := getExpectedRuns(jobCron, config.StartTime, config.EndTime) - return r.replayRepo.RegisterReplay(ctx, replayReq, runs) + replayID, err = r.replayRepo.RegisterReplay(ctx, replayReq, runs) + if err != nil { + return uuid.Nil, err + } + + telemetry.NewCounter(metricJobReplay, map[string]string{ + "project": tenant.ProjectName().String(), + "namespace": tenant.NamespaceName().String(), + "job": jobName.String(), + "status": replayReq.State().String(), + }).Inc() + return replayID, nil +} + +func (r ReplayService) GetReplayList(ctx context.Context, projectName tenant.ProjectName) (replays []*scheduler.Replay, err error) { + return r.replayRepo.GetReplaysByProject(ctx, projectName, getReplaysDayLimit) +} + +func (r ReplayService) GetReplayByID(ctx context.Context, replayID uuid.UUID) (*scheduler.ReplayWithRun, error) { + replayWithRun, err := r.replayRepo.GetReplayByID(ctx, replayID) + if err != nil { + return nil, err + } + replayWithRun.Runs = scheduler.JobRunStatusList(replayWithRun.Runs).GetSortedRunsByScheduledAt() + return replayWithRun, nil } -func NewReplayService(replayRepo ReplayRepository, jobRepo JobRepository, validator ReplayValidator) *ReplayService { - return &ReplayService{replayRepo: replayRepo, jobRepo: jobRepo, validator: validator} +func NewReplayService(replayRepo ReplayRepository, jobRepo JobRepository, validator ReplayValidator, logger log.Logger) *ReplayService { + return &ReplayService{replayRepo: replayRepo, jobRepo: jobRepo, validator: validator, logger: logger} } diff --git a/core/scheduler/service/replay_service_test.go b/core/scheduler/service/replay_service_test.go index 9fee3db3bf..3f75da6e7b 100644 --- a/core/scheduler/service/replay_service_test.go +++ b/core/scheduler/service/replay_service_test.go @@ -7,13 +7,15 @@ import ( "time" "github.com/google/uuid" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/service" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/service" + "github.com/raystack/optimus/core/tenant" + errs "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/lib/cron" ) func TestReplayService(t *testing.T) { @@ -47,6 +49,8 @@ func TestReplayService(t *testing.T) { jobCronStr := "0 12 * * *" jobCron, _ := cron.ParseCronSchedule(jobCronStr) + logger := log.NewLogrus() + t.Run("CreateReplay", func(t *testing.T) { t.Run("should return replay ID if replay created successfully", func(t *testing.T) { replayRepository := new(ReplayRepository) @@ -71,7 +75,7 @@ func TestReplayService(t *testing.T) { replayValidator.On("Validate", ctx, replayReq, jobCron).Return(nil) replayRepository.On("RegisterReplay", ctx, replayReq, replayRuns).Return(replayID, nil) - replayService := service.NewReplayService(replayRepository, jobRepository, replayValidator) + replayService := service.NewReplayService(replayRepository, jobRepository, replayValidator, logger) result, err := replayService.CreateReplay(ctx, tnnt, jobName, replayConfig) assert.NoError(t, err) assert.Equal(t, replayID, result) @@ -92,7 +96,7 @@ func TestReplayService(t *testing.T) { jobRepository.On("GetJobDetails", ctx, projName, jobName).Return(jobWithDetails, nil) replayValidator.On("Validate", ctx, replayReq, jobCron).Return(errors.New("not passed validation")) - replayService := service.NewReplayService(replayRepository, jobRepository, replayValidator) + replayService := service.NewReplayService(replayRepository, jobRepository, replayValidator, logger) result, err := replayService.CreateReplay(ctx, tnnt, jobName, replayConfig) assert.ErrorContains(t, err, "not passed validation") assert.Equal(t, uuid.Nil, result) @@ -111,11 +115,107 @@ func TestReplayService(t *testing.T) { internalErr := errors.New("internal error") jobRepository.On("GetJobDetails", ctx, projName, jobName).Return(nil, internalErr) - replayService := service.NewReplayService(replayRepository, jobRepository, replayValidator) + replayService := service.NewReplayService(replayRepository, jobRepository, replayValidator, logger) result, err := replayService.CreateReplay(ctx, tnnt, jobName, replayConfig) assert.ErrorIs(t, err, internalErr) assert.Equal(t, uuid.Nil, result) }) + + t.Run("should return error if namespace name is not match", func(t *testing.T) { + replayRepository := new(ReplayRepository) + defer replayRepository.AssertExpectations(t) + + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + + replayValidator := new(ReplayValidator) + defer replayValidator.AssertExpectations(t) + + invalidTenant, _ := tenant.NewTenant(projName.String(), "invalid-namespace") + + jobRepository.On("GetJobDetails", ctx, projName, jobName).Return(jobWithDetails, nil) + + replayService := service.NewReplayService(replayRepository, jobRepository, replayValidator, logger) + result, err := replayService.CreateReplay(ctx, invalidTenant, jobName, replayConfig) + assert.ErrorContains(t, err, "job sample_select does not exist in invalid-namespace namespace") + assert.Equal(t, uuid.Nil, result) + }) + }) + t.Run("GetReplayList", func(t *testing.T) { + t.Run("should return replay list with no error", func(t *testing.T) { + replayConfig := scheduler.NewReplayConfig(startTime, endTime, true, replayJobConfig, description) + replay1 := scheduler.NewReplayRequest("sample-job-A", tnnt, replayConfig, scheduler.ReplayStateInProgress) + replay2 := scheduler.NewReplayRequest("sample-job-B", tnnt, replayConfig, scheduler.ReplayStateCreated) + replay3 := scheduler.NewReplayRequest("sample-job-C", tnnt, replayConfig, scheduler.ReplayStateFailed) + replays := []*scheduler.Replay{replay1, replay2, replay3} + replayRepository := new(ReplayRepository) + replayRepository.On("GetReplaysByProject", ctx, mock.Anything, mock.Anything).Return(replays, nil) + defer replayRepository.AssertExpectations(t) + + replayService := service.NewReplayService(replayRepository, nil, nil, logger) + result, err := replayService.GetReplayList(ctx, tnnt.ProjectName()) + assert.NoError(t, err) + assert.Len(t, result, 3) + }) + + t.Run("should return error when get replay by project is fail", func(t *testing.T) { + replayRepository := new(ReplayRepository) + replayRepository.On("GetReplaysByProject", ctx, mock.Anything, mock.Anything).Return(nil, errors.New("some error")) + defer replayRepository.AssertExpectations(t) + + replayService := service.NewReplayService(replayRepository, nil, nil, logger) + result, err := replayService.GetReplayList(ctx, tnnt.ProjectName()) + assert.Error(t, err) + assert.Nil(t, result) + }) + }) + t.Run("GetReplayByID", func(t *testing.T) { + t.Run("returns empty if replay is not found", func(t *testing.T) { + replayRepository := new(ReplayRepository) + defer replayRepository.AssertExpectations(t) + + replayID := uuid.New() + replayRepository.On("GetReplayByID", ctx, replayID).Return(nil, errs.NotFound("entity", "not found")) + + replayService := service.NewReplayService(replayRepository, nil, nil, logger) + result, err := replayService.GetReplayByID(ctx, replayID) + assert.True(t, errs.IsErrorType(err, errs.ErrNotFound)) + assert.Empty(t, result) + }) + t.Run("returns err if get replay by id on replay repo is failed", func(t *testing.T) { + replayRepository := new(ReplayRepository) + defer replayRepository.AssertExpectations(t) + + replayID := uuid.New() + replayRepository.On("GetReplayByID", ctx, replayID).Return(nil, errors.New("internal error")) + + replayService := service.NewReplayService(replayRepository, nil, nil, logger) + result, err := replayService.GetReplayByID(ctx, replayID) + assert.Error(t, err) + assert.Nil(t, result) + }) + t.Run("returns success if replay with runs exist", func(t *testing.T) { + replayRepository := new(ReplayRepository) + defer replayRepository.AssertExpectations(t) + + replayID := uuid.New() + replay := scheduler.NewReplay(replayID, jobName, tnnt, replayConfig, scheduler.ReplayStateInProgress, startTime) + replayRepository.On("GetReplayByID", ctx, replayID).Return(&scheduler.ReplayWithRun{ + Replay: replay, + Runs: []*scheduler.JobRunStatus{ + { + ScheduledAt: startTime, + State: scheduler.StatePending, + }, + }, + }, nil) + + replayService := service.NewReplayService(replayRepository, nil, nil, logger) + result, err := replayService.GetReplayByID(ctx, replayID) + assert.NoError(t, err) + assert.NotNil(t, result) + assert.NotEmpty(t, result) + }) }) } @@ -124,6 +224,58 @@ type ReplayRepository struct { mock.Mock } +// GetReplaysByProject provides a mock function with given fields: ctx, projectName, dayLimits +func (_m *ReplayRepository) GetReplaysByProject(ctx context.Context, projectName tenant.ProjectName, dayLimits int) ([]*scheduler.Replay, error) { + ret := _m.Called(ctx, projectName, dayLimits) + + var r0 []*scheduler.Replay + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, tenant.ProjectName, int) ([]*scheduler.Replay, error)); ok { + return rf(ctx, projectName, dayLimits) + } + if rf, ok := ret.Get(0).(func(context.Context, tenant.ProjectName, int) []*scheduler.Replay); ok { + r0 = rf(ctx, projectName, dayLimits) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*scheduler.Replay) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, tenant.ProjectName, int) error); ok { + r1 = rf(ctx, projectName, dayLimits) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetReplayByID provides a mock function with given fields: ctx, replayID +func (_m *ReplayRepository) GetReplayByID(ctx context.Context, replayID uuid.UUID) (*scheduler.ReplayWithRun, error) { + ret := _m.Called(ctx, replayID) + + var r0 *scheduler.ReplayWithRun + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID) (*scheduler.ReplayWithRun, error)); ok { + return rf(ctx, replayID) + } + if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID) *scheduler.ReplayWithRun); ok { + r0 = rf(ctx, replayID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*scheduler.ReplayWithRun) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uuid.UUID) error); ok { + r1 = rf(ctx, replayID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // GetReplayRequestsByStatus provides a mock function with given fields: ctx, statusList func (_m *ReplayRepository) GetReplayRequestsByStatus(ctx context.Context, statusList []scheduler.ReplayState) ([]*scheduler.Replay, error) { ret := _m.Called(ctx, statusList) diff --git a/core/scheduler/service/replay_validator.go b/core/scheduler/service/replay_validator.go index 721c3d8e19..c995f651f2 100644 --- a/core/scheduler/service/replay_validator.go +++ b/core/scheduler/service/replay_validator.go @@ -1,11 +1,14 @@ package service import ( + "fmt" + "time" + "golang.org/x/net/context" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/lib/cron" ) var replayStatusToValidate = []scheduler.ReplayState{ @@ -16,13 +19,18 @@ var replayStatusToValidate = []scheduler.ReplayState{ type Validator struct { replayRepository ReplayRepository scheduler ReplayScheduler + jobRepo JobRepository } -func NewValidator(replayRepository ReplayRepository, scheduler ReplayScheduler) *Validator { - return &Validator{replayRepository: replayRepository, scheduler: scheduler} +func NewValidator(replayRepository ReplayRepository, scheduler ReplayScheduler, jobRepo JobRepository) *Validator { + return &Validator{replayRepository: replayRepository, scheduler: scheduler, jobRepo: jobRepo} } func (v Validator) Validate(ctx context.Context, replayRequest *scheduler.Replay, jobCron *cron.ScheduleSpec) error { + if err := v.validateDateRange(ctx, replayRequest); err != nil { + return err + } + if err := v.validateConflictedReplay(ctx, replayRequest); err != nil { return err } @@ -30,6 +38,31 @@ func (v Validator) Validate(ctx context.Context, replayRequest *scheduler.Replay return v.validateConflictedRun(ctx, replayRequest, jobCron) } +func (v Validator) validateDateRange(ctx context.Context, replayRequest *scheduler.Replay) error { + jobSpec, err := v.jobRepo.GetJobDetails(ctx, replayRequest.Tenant().ProjectName(), replayRequest.JobName()) + if err != nil { + return err + } + replayStartDate := replayRequest.Config().StartTime.UTC() + replayEndDate := replayRequest.Config().EndTime.UTC() + jobStartDate := jobSpec.Schedule.StartDate.UTC() + jobEndDate := time.Now().UTC() + // time bound for end date + if jobSpec.Schedule.EndDate != nil && jobSpec.Schedule.EndDate.UTC().Before(jobEndDate) { + jobEndDate = jobSpec.Schedule.EndDate.UTC() + } + + if replayStartDate.Before(jobStartDate) { + return errors.NewError(errors.ErrFailedPrecond, scheduler.EntityReplay, fmt.Sprintf("replay start date (%s) is not allowed to be set before job start date (%s)", replayStartDate.String(), jobStartDate.String())) + } + + if replayEndDate.After(jobEndDate) { + return errors.NewError(errors.ErrFailedPrecond, scheduler.EntityReplay, fmt.Sprintf("replay end date (%s) is not allowed to be set after the date (%s)", replayEndDate.String(), jobEndDate.String())) + } + + return nil +} + func (v Validator) validateConflictedReplay(ctx context.Context, replayRequest *scheduler.Replay) error { onGoingReplays, err := v.replayRepository.GetReplayRequestsByStatus(ctx, replayStatusToValidate) if err != nil { diff --git a/core/scheduler/service/replay_validator_test.go b/core/scheduler/service/replay_validator_test.go index 778cac1fe2..0699c7cada 100644 --- a/core/scheduler/service/replay_validator_test.go +++ b/core/scheduler/service/replay_validator_test.go @@ -8,10 +8,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/service" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/lib/cron" ) func TestReplayValidator(t *testing.T) { @@ -41,13 +41,16 @@ func TestReplayValidator(t *testing.T) { replayReq := scheduler.NewReplayRequest(jobName, tnnt, replayConfig, scheduler.ReplayStateCreated) t.Run("Validate", func(t *testing.T) { - t.Run("should return nil if no conflict replay or conflict run found", func(t *testing.T) { + t.Run("should return nil if validation valid", func(t *testing.T) { replayRepository := new(ReplayRepository) defer replayRepository.AssertExpectations(t) sch := new(mockReplayScheduler) defer sch.AssertExpectations(t) + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + onGoingReplayConfig := scheduler.NewReplayConfig(time.Now(), time.Now(), parallel, replayJobConfig, description) onGoingReplay := []*scheduler.Replay{ scheduler.NewReplayRequest(jobName, tnnt, onGoingReplayConfig, scheduler.ReplayStateCreated), @@ -60,13 +63,62 @@ func TestReplayValidator(t *testing.T) { }, } + jobRepository.On("GetJobDetails", ctx, replayReq.Tenant().ProjectName(), replayReq.JobName()).Return(&scheduler.JobWithDetails{ + Schedule: &scheduler.Schedule{ + StartDate: startTime, + EndDate: &endTime, + }, + }, nil) replayRepository.On("GetReplayRequestsByStatus", ctx, replayStatusToValidate).Return(onGoingReplay, nil) sch.On("GetJobRuns", ctx, tnnt, runsCriteriaJobA, jobCron).Return(currentRuns, nil) - validator := service.NewValidator(replayRepository, sch) + validator := service.NewValidator(replayRepository, sch, jobRepository) err := validator.Validate(ctx, replayReq, jobCron) assert.NoError(t, err) }) + t.Run("should return error if start date of replay is before the start date of the job", func(t *testing.T) { + replayRepository := new(ReplayRepository) + defer replayRepository.AssertExpectations(t) + + sch := new(mockReplayScheduler) + defer sch.AssertExpectations(t) + + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + + jobRepository.On("GetJobDetails", ctx, replayReq.Tenant().ProjectName(), replayReq.JobName()).Return(&scheduler.JobWithDetails{ + Schedule: &scheduler.Schedule{ + StartDate: startTime.Add(1 * time.Second), // start date 1 second ahead of replay + EndDate: &endTime, + }, + }, nil) + + validator := service.NewValidator(replayRepository, sch, jobRepository) + err := validator.Validate(ctx, replayReq, jobCron) + assert.ErrorContains(t, err, "replay start date") + }) + t.Run("should return error if end date of replay is on the future", func(t *testing.T) { + replayRepository := new(ReplayRepository) + defer replayRepository.AssertExpectations(t) + + sch := new(mockReplayScheduler) + defer sch.AssertExpectations(t) + + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + + schEndTime := endTime.Add(-1 * time.Second) + jobRepository.On("GetJobDetails", ctx, replayReq.Tenant().ProjectName(), replayReq.JobName()).Return(&scheduler.JobWithDetails{ + Schedule: &scheduler.Schedule{ + StartDate: startTime, + EndDate: &schEndTime, // end date 1 second prior of replay + }, + }, nil) + + validator := service.NewValidator(replayRepository, sch, jobRepository) + err := validator.Validate(ctx, replayReq, jobCron) + assert.ErrorContains(t, err, "replay end date") + }) t.Run("should return error if conflict replay found", func(t *testing.T) { replayRepository := new(ReplayRepository) defer replayRepository.AssertExpectations(t) @@ -74,13 +126,23 @@ func TestReplayValidator(t *testing.T) { sch := new(mockReplayScheduler) defer sch.AssertExpectations(t) + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + onGoingReplay := []*scheduler.Replay{ scheduler.NewReplayRequest(jobName, tnnt, replayConfig, scheduler.ReplayStateInProgress), } + jobRepository.On("GetJobDetails", ctx, replayReq.Tenant().ProjectName(), replayReq.JobName()).Return(&scheduler.JobWithDetails{ + Schedule: &scheduler.Schedule{ + StartDate: startTime, + EndDate: &endTime, + }, + }, nil) + replayRepository.On("GetReplayRequestsByStatus", ctx, replayStatusToValidate).Return(onGoingReplay, nil) - validator := service.NewValidator(replayRepository, sch) + validator := service.NewValidator(replayRepository, sch, jobRepository) err := validator.Validate(ctx, replayReq, jobCron) assert.ErrorContains(t, err, "conflicted replay") }) @@ -91,6 +153,9 @@ func TestReplayValidator(t *testing.T) { sch := new(mockReplayScheduler) defer sch.AssertExpectations(t) + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + onGoingReplayConfig := scheduler.NewReplayConfig(time.Now(), time.Now(), parallel, replayJobConfig, description) onGoingReplay := []*scheduler.Replay{ scheduler.NewReplayRequest(jobName, tnnt, onGoingReplayConfig, scheduler.ReplayStateCreated), @@ -102,10 +167,16 @@ func TestReplayValidator(t *testing.T) { }, } + jobRepository.On("GetJobDetails", ctx, replayReq.Tenant().ProjectName(), replayReq.JobName()).Return(&scheduler.JobWithDetails{ + Schedule: &scheduler.Schedule{ + StartDate: startTime, + EndDate: &endTime, + }, + }, nil) replayRepository.On("GetReplayRequestsByStatus", ctx, replayStatusToValidate).Return(onGoingReplay, nil) sch.On("GetJobRuns", ctx, tnnt, runsCriteriaJobA, jobCron).Return(currentRuns, nil) - validator := service.NewValidator(replayRepository, sch) + validator := service.NewValidator(replayRepository, sch, jobRepository) err := validator.Validate(ctx, replayReq, jobCron) assert.ErrorContains(t, err, "conflicted job run found") }) @@ -116,10 +187,19 @@ func TestReplayValidator(t *testing.T) { sch := new(mockReplayScheduler) defer sch.AssertExpectations(t) + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + internalErr := errors.New("internal error") + jobRepository.On("GetJobDetails", ctx, replayReq.Tenant().ProjectName(), replayReq.JobName()).Return(&scheduler.JobWithDetails{ + Schedule: &scheduler.Schedule{ + StartDate: startTime, + EndDate: &endTime, + }, + }, nil) replayRepository.On("GetReplayRequestsByStatus", ctx, replayStatusToValidate).Return(nil, internalErr) - validator := service.NewValidator(replayRepository, sch) + validator := service.NewValidator(replayRepository, sch, jobRepository) err := validator.Validate(ctx, replayReq, jobCron) assert.ErrorIs(t, err, internalErr) }) @@ -130,6 +210,9 @@ func TestReplayValidator(t *testing.T) { sch := new(mockReplayScheduler) defer sch.AssertExpectations(t) + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + onGoingReplayConfig := scheduler.NewReplayConfig(time.Now(), time.Now(), parallel, map[string]string{}, description) onGoingReplay := []*scheduler.Replay{ scheduler.NewReplayRequest(jobName, tnnt, onGoingReplayConfig, scheduler.ReplayStateCreated), @@ -138,9 +221,15 @@ func TestReplayValidator(t *testing.T) { replayRepository.On("GetReplayRequestsByStatus", ctx, replayStatusToValidate).Return(onGoingReplay, nil) internalErr := errors.New("internal error") + jobRepository.On("GetJobDetails", ctx, replayReq.Tenant().ProjectName(), replayReq.JobName()).Return(&scheduler.JobWithDetails{ + Schedule: &scheduler.Schedule{ + StartDate: startTime, + EndDate: &endTime, + }, + }, nil) sch.On("GetJobRuns", ctx, tnnt, runsCriteriaJobA, jobCron).Return(nil, internalErr) - validator := service.NewValidator(replayRepository, sch) + validator := service.NewValidator(replayRepository, sch, jobRepository) err := validator.Validate(ctx, replayReq, jobCron) assert.ErrorIs(t, err, internalErr) }) diff --git a/core/scheduler/service/replay_worker.go b/core/scheduler/service/replay_worker.go index aabf4e550b..e8ea708692 100644 --- a/core/scheduler/service/replay_worker.go +++ b/core/scheduler/service/replay_worker.go @@ -5,19 +5,26 @@ import ( "time" "github.com/google/uuid" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "golang.org/x/net/context" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/lib/cron" + "github.com/raystack/optimus/internal/telemetry" +) + +const ( + prefixReplayed = "replayed" ) type ReplayScheduler interface { Clear(ctx context.Context, t tenant.Tenant, jobName scheduler.JobName, scheduledAt time.Time) error ClearBatch(ctx context.Context, t tenant.Tenant, jobName scheduler.JobName, startTime, endTime time.Time) error + CreateRun(ctx context.Context, tnnt tenant.Tenant, jobName scheduler.JobName, executionTime time.Time, dagRunIDPrefix string) error GetJobRuns(ctx context.Context, t tenant.Tenant, criteria *scheduler.JobRunsCriteria, jobCron *cron.ScheduleSpec) ([]*scheduler.JobRunStatus, error) } @@ -46,8 +53,9 @@ func (w ReplayWorker) Process(replayReq *scheduler.ReplayWithRun) { w.l.Debug("processing replay request %s with status %s", replayReq.Replay.ID().String(), replayReq.Replay.State().String()) jobCron, err := w.getJobCron(ctx, replayReq) if err != nil { - w.l.Error(fmt.Sprintf("unable to get cron value for job %s: %s", replayReq.Replay.JobName(), err.Error()), "replay_id", replayReq.Replay.ID()) + w.l.Error("unable to get cron value for job [%s] replay id [%s]: %s", replayReq.Replay.JobName().String(), replayReq.Replay.ID().String(), err) w.updateReplayAsFailed(ctx, replayReq.Replay.ID(), err.Error()) + raiseReplayMetric(replayReq.Replay.Tenant(), replayReq.Replay.JobName(), scheduler.ReplayStateFailed) return } @@ -61,28 +69,68 @@ func (w ReplayWorker) Process(replayReq *scheduler.ReplayWithRun) { } if err != nil { + w.l.Error("error encountered when processing replay request: %s", err) w.updateReplayAsFailed(ctx, replayReq.Replay.ID(), err.Error()) + raiseReplayMetric(replayReq.Replay.Tenant(), replayReq.Replay.JobName(), scheduler.ReplayStateFailed) } } +func (w ReplayWorker) createMissingRuns(ctx context.Context, replayReq *scheduler.ReplayWithRun, jobCron *cron.ScheduleSpec) ([]*scheduler.JobRunStatus, error) { + createdRuns := []*scheduler.JobRunStatus{} + + // fetch runs within range of replay range + existedRuns, err := w.fetchRuns(ctx, replayReq, jobCron) + if err != nil { + return nil, err + } + + // check each runs if there's no existing run from the above + existedRunsMap := scheduler.JobRunStatusList(existedRuns).ToRunStatusMap() + for _, run := range replayReq.Runs { + if _, ok := existedRunsMap[run.ScheduledAt]; !ok { + // create any missing runs + if err := w.scheduler.CreateRun(ctx, replayReq.Replay.Tenant(), replayReq.Replay.JobName(), run.ScheduledAt, prefixReplayed); err != nil { + return nil, err + } + run.State = scheduler.StateInProgress + createdRuns = append(createdRuns, run) + } + } + return createdRuns, nil +} + func (w ReplayWorker) processNewReplayRequest(ctx context.Context, replayReq *scheduler.ReplayWithRun, jobCron *cron.ScheduleSpec) (err error) { state := scheduler.ReplayStateReplayed + if !replayReq.Replay.Config().Parallel && len(replayReq.Runs) > 1 { + state = scheduler.ReplayStatePartialReplayed + } var updatedRuns []*scheduler.JobRunStatus + createdRuns, err := w.createMissingRuns(ctx, replayReq, jobCron) + if err != nil { + return err + } + if len(createdRuns) > 0 { + createdRunMap := scheduler.JobRunStatusList(createdRuns).ToRunStatusMap() + replayReq.Runs = scheduler.JobRunStatusList(replayReq.Runs).MergeWithUpdatedRuns(createdRunMap) + if err := w.replayRepo.UpdateReplay(ctx, replayReq.Replay.ID(), state, replayReq.Runs, ""); err != nil { + return err + } + } if replayReq.Replay.Config().Parallel { updatedRuns, err = w.processNewReplayRequestParallel(ctx, replayReq, jobCron) } else { updatedRuns, err = w.processNewReplayRequestSequential(ctx, replayReq, jobCron) - if len(replayReq.Runs) > 1 { - state = scheduler.ReplayStatePartialReplayed - } } if err != nil { + w.l.Error("error processing new replay: %s", err) return err } + if err := w.replayRepo.UpdateReplay(ctx, replayReq.Replay.ID(), state, updatedRuns, ""); err != nil { - w.l.Error("unable to update replay state", "replay_id", replayReq.Replay.ID()) + w.l.Error("unable to update replay state for replay_id [%s]: %s", replayReq.Replay.ID().String(), err) return err } + raiseReplayMetric(replayReq.Replay.Tenant(), replayReq.Replay.JobName(), state) return nil } @@ -90,7 +138,7 @@ func (w ReplayWorker) processNewReplayRequestParallel(ctx context.Context, repla startLogicalTime := replayReq.GetFirstExecutableRun().GetLogicalTime(jobCron) endLogicalTime := replayReq.GetLastExecutableRun().GetLogicalTime(jobCron) if err := w.scheduler.ClearBatch(ctx, replayReq.Replay.Tenant(), replayReq.Replay.JobName(), startLogicalTime, endLogicalTime); err != nil { - w.l.Error("unable to clear job run for replay", "replay_id", replayReq.Replay.ID()) + w.l.Error("unable to clear job run for replay with replay_id [%s]: %s", replayReq.Replay.ID().String(), err) return nil, err } @@ -98,21 +146,24 @@ func (w ReplayWorker) processNewReplayRequestParallel(ctx context.Context, repla var updatedRuns []*scheduler.JobRunStatus for _, run := range replayReq.Runs { - updatedRuns = append(updatedRuns, &scheduler.JobRunStatus{ScheduledAt: run.ScheduledAt, State: scheduler.StateReplayed}) + updatedRuns = append(updatedRuns, &scheduler.JobRunStatus{ScheduledAt: run.ScheduledAt, State: scheduler.StateInProgress}) } return updatedRuns, nil } func (w ReplayWorker) processNewReplayRequestSequential(ctx context.Context, replayReq *scheduler.ReplayWithRun, jobCron *cron.ScheduleSpec) ([]*scheduler.JobRunStatus, error) { runToClear := replayReq.GetFirstExecutableRun() + if runToClear == nil { + return replayReq.Runs, nil + } if err := w.scheduler.Clear(ctx, replayReq.Replay.Tenant(), replayReq.Replay.JobName(), runToClear.GetLogicalTime(jobCron)); err != nil { - w.l.Error("unable to clear job run for replay", "replay_id", replayReq.Replay.ID()) + w.l.Error("unable to clear job run for replay with replay_id [%s]: %s", replayReq.Replay.ID().String(), err) return nil, err } w.l.Info("cleared [%s] [%s] run for replay %s", replayReq.Replay.JobName().String(), runToClear.ScheduledAt, replayReq.Replay.ID().String()) updatedReplayMap := map[time.Time]scheduler.State{ - runToClear.ScheduledAt: scheduler.StateReplayed, + runToClear.ScheduledAt: scheduler.StateInProgress, } updatedRuns := scheduler.JobRunStatusList(replayReq.Runs).MergeWithUpdatedRuns(updatedReplayMap) return updatedRuns, nil @@ -121,27 +172,27 @@ func (w ReplayWorker) processNewReplayRequestSequential(ctx context.Context, rep func (w ReplayWorker) processPartialReplayedRequest(ctx context.Context, replayReq *scheduler.ReplayWithRun, jobCron *cron.ScheduleSpec) error { incomingRuns, err := w.fetchRuns(ctx, replayReq, jobCron) if err != nil { - w.l.Error(fmt.Sprintf("unable to get runs: %s", err.Error()), "replay_id", replayReq.Replay.ID()) + w.l.Error("unable to get runs for replay [%s]: %s", replayReq.Replay.ID().String(), err) return err } updatedReplayMap := identifyUpdatedRunStatus(replayReq.Runs, incomingRuns) updatedRuns := scheduler.JobRunStatusList(replayReq.Runs).MergeWithUpdatedRuns(updatedReplayMap) - replayedRuns := scheduler.JobRunStatusList(updatedRuns).GetSortedRunsByStates([]scheduler.State{scheduler.StateReplayed}) + replayedRuns := scheduler.JobRunStatusList(updatedRuns).GetSortedRunsByStates([]scheduler.State{scheduler.StateInProgress}) toBeReplayedRuns := scheduler.JobRunStatusList(updatedRuns).GetSortedRunsByStates([]scheduler.State{scheduler.StatePending}) replayState := scheduler.ReplayStatePartialReplayed if len(replayedRuns) == 0 && len(toBeReplayedRuns) > 0 { logicalTimeToClear := toBeReplayedRuns[0].GetLogicalTime(jobCron) if err := w.scheduler.Clear(ctx, replayReq.Replay.Tenant(), replayReq.Replay.JobName(), logicalTimeToClear); err != nil { - w.l.Error("unable to clear job run for replay", "replay_id", replayReq.Replay.ID()) + w.l.Error("unable to clear job run for replay_id [%s]: %s", replayReq.Replay.ID().String(), err) return err } w.l.Info("cleared [%s] [%s] run for replay %s", replayReq.Replay.JobName().String(), toBeReplayedRuns[0].ScheduledAt, replayReq.Replay.ID().String()) - updatedReplayMap[toBeReplayedRuns[0].ScheduledAt] = scheduler.StateReplayed - updatedRuns = scheduler.JobRunStatusList(incomingRuns).MergeWithUpdatedRuns(updatedReplayMap) + updatedReplayMap[toBeReplayedRuns[0].ScheduledAt] = scheduler.StateInProgress + updatedRuns = scheduler.JobRunStatusList(updatedRuns).MergeWithUpdatedRuns(updatedReplayMap) } pendingRuns := scheduler.JobRunStatusList(updatedRuns).GetSortedRunsByStates([]scheduler.State{scheduler.StatePending}) @@ -150,22 +201,23 @@ func (w ReplayWorker) processPartialReplayedRequest(ctx context.Context, replayR } if err := w.replayRepo.UpdateReplay(ctx, replayReq.Replay.ID(), replayState, updatedRuns, ""); err != nil { - w.l.Error("unable to update replay state", "replay_id", replayReq.Replay.ID()) + w.l.Error("unable to update replay state for replay_id [%s]: %s", replayReq.Replay.ID().String(), err) return err } + raiseReplayMetric(replayReq.Replay.Tenant(), replayReq.Replay.JobName(), replayState) return nil } func (w ReplayWorker) processReplayedRequest(ctx context.Context, replayReq *scheduler.ReplayWithRun, jobCron *cron.ScheduleSpec) error { incomingRuns, err := w.fetchRuns(ctx, replayReq, jobCron) if err != nil { - w.l.Error(fmt.Sprintf("unable to get runs: %s", err.Error()), "replay_id", replayReq.Replay.ID()) + w.l.Error("unable to get runs for replay with replay_id [%s]: %s", replayReq.Replay.ID().String(), err) return err } updatedReplayMap := identifyUpdatedRunStatus(replayReq.Runs, incomingRuns) - updatedRuns := scheduler.JobRunStatusList(incomingRuns).MergeWithUpdatedRuns(updatedReplayMap) - inProgressRuns := scheduler.JobRunStatusList(updatedRuns).GetSortedRunsByStates([]scheduler.State{scheduler.StateReplayed}) + updatedRuns := scheduler.JobRunStatusList(replayReq.Runs).MergeWithUpdatedRuns(updatedReplayMap) + inProgressRuns := scheduler.JobRunStatusList(updatedRuns).GetSortedRunsByStates([]scheduler.State{scheduler.StateInProgress}) failedRuns := scheduler.JobRunStatusList(updatedRuns).GetSortedRunsByStates([]scheduler.State{scheduler.StateFailed}) var message string @@ -180,9 +232,10 @@ func (w ReplayWorker) processReplayedRequest(ctx context.Context, replayReq *sch } if err := w.replayRepo.UpdateReplay(ctx, replayReq.Replay.ID(), state, updatedRuns, message); err != nil { - w.l.Error("unable to update replay state", "replay_id", replayReq.Replay.ID()) + w.l.Error("unable to update replay with replay_id [%s]: %s", replayReq.Replay.ID().String(), err) return err } + raiseReplayMetric(replayReq.Replay.Tenant(), replayReq.Replay.JobName(), state) return nil } @@ -191,7 +244,7 @@ func identifyUpdatedRunStatus(existingJobRuns, incomingJobRuns []*scheduler.JobR updatedReplayMap := make(map[time.Time]scheduler.State) for _, run := range existingJobRuns { - if run.State != scheduler.StateReplayed { + if run.State != scheduler.StateInProgress { continue } if incomingRunStatusMap[run.ScheduledAt.UTC()] == scheduler.StateSuccess || incomingRunStatusMap[run.ScheduledAt.UTC()] == scheduler.StateFailed { @@ -204,16 +257,18 @@ func identifyUpdatedRunStatus(existingJobRuns, incomingJobRuns []*scheduler.JobR func (w ReplayWorker) getJobCron(ctx context.Context, replayReq *scheduler.ReplayWithRun) (*cron.ScheduleSpec, error) { jobWithDetails, err := w.jobRepo.GetJobDetails(ctx, replayReq.Replay.Tenant().ProjectName(), replayReq.Replay.JobName()) if err != nil || jobWithDetails == nil { - return nil, fmt.Errorf("unable to get job details from DB for jobName: %s, project: %s, error: %w ", - replayReq.Replay.JobName(), replayReq.Replay.Tenant().ProjectName(), err) + return nil, errors.AddErrContext(err, scheduler.EntityReplay, + fmt.Sprintf("unable to get job details for jobName: %s, project: %s", replayReq.Replay.JobName(), replayReq.Replay.Tenant().ProjectName())) } interval := jobWithDetails.Schedule.Interval if interval == "" { - return nil, fmt.Errorf("job schedule interval not found") + w.l.Error("job interval is empty") + return nil, errors.InvalidArgument(scheduler.EntityReplay, "job schedule interval is empty") } jobCron, err := cron.ParseCronSchedule(interval) if err != nil { - return nil, fmt.Errorf("unable to parse job cron interval %w", err) + w.l.Error("error parsing cron interval: %s", err) + return nil, errors.InternalError(scheduler.EntityReplay, "unable to parse job cron interval", err) } return jobCron, nil } @@ -229,6 +284,15 @@ func (w ReplayWorker) fetchRuns(ctx context.Context, replayReq *scheduler.Replay func (w ReplayWorker) updateReplayAsFailed(ctx context.Context, replayID uuid.UUID, message string) { if err := w.replayRepo.UpdateReplayStatus(ctx, replayID, scheduler.ReplayStateFailed, message); err != nil { - w.l.Error("unable to update replay state to failed", "replay_id", replayID) + w.l.Error("unable to update replay state to failed for replay_id [%s]: %s", replayID, err) } } + +func raiseReplayMetric(t tenant.Tenant, jobName scheduler.JobName, state scheduler.ReplayState) { + telemetry.NewCounter(metricJobReplay, map[string]string{ + "project": t.ProjectName().String(), + "namespace": t.NamespaceName().String(), + "job": jobName.String(), + "status": state.String(), + }).Inc() +} diff --git a/core/scheduler/service/replay_worker_test.go b/core/scheduler/service/replay_worker_test.go index bacd7f8b03..5101ba89d7 100644 --- a/core/scheduler/service/replay_worker_test.go +++ b/core/scheduler/service/replay_worker_test.go @@ -7,14 +7,14 @@ import ( "time" "github.com/google/uuid" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/scheduler/service" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/lib/cron" ) func TestReplayWorker(t *testing.T) { @@ -35,6 +35,7 @@ func TestReplayWorker(t *testing.T) { EndDate: endTime, } scheduledTime2 := scheduledTime1.Add(24 * time.Hour) + scheduledTime3 := scheduledTime2.Add(24 * time.Hour) executionTime1 := scheduledTime1.Add(-24 * time.Hour) executionTime2 := executionTime1.Add(24 * time.Hour) jobCronStr := "0 12 * * *" @@ -82,11 +83,12 @@ func TestReplayWorker(t *testing.T) { updatedRuns := []*scheduler.JobRunStatus{ { ScheduledAt: scheduledTime1, - State: scheduler.StateReplayed, + State: scheduler.StateInProgress, }, } jobRepository.On("GetJobDetails", mock.Anything, projName, jobAName).Return(jobAWithDetails, nil) + sch.On("GetJobRuns", mock.Anything, tnnt, mock.Anything, jobCron).Return(replayReq.Runs, nil) sch.On("Clear", mock.Anything, tnnt, jobAName, scheduledTime1.Add(-24*time.Hour)).Return(nil) replayRepository.On("UpdateReplay", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStateReplayed, updatedRuns, "").Return(nil) @@ -119,7 +121,7 @@ func TestReplayWorker(t *testing.T) { updatedRuns := []*scheduler.JobRunStatus{ { ScheduledAt: scheduledTime1, - State: scheduler.StateReplayed, + State: scheduler.StateInProgress, }, { ScheduledAt: scheduledTime2, @@ -128,6 +130,7 @@ func TestReplayWorker(t *testing.T) { } jobRepository.On("GetJobDetails", mock.Anything, projName, jobAName).Return(jobAWithDetails, nil) + sch.On("GetJobRuns", mock.Anything, tnnt, mock.Anything, jobCron).Return(replayReq.Runs, nil) sch.On("Clear", mock.Anything, tnnt, jobAName, scheduledTime1.Add(-24*time.Hour)).Return(nil) replayRepository.On("UpdateReplay", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStatePartialReplayed, updatedRuns, "").Return(nil) @@ -159,12 +162,71 @@ func TestReplayWorker(t *testing.T) { } jobRepository.On("GetJobDetails", mock.Anything, projName, jobAName).Return(jobAWithDetails, nil) + sch.On("GetJobRuns", mock.Anything, tnnt, mock.Anything, jobCron).Return(replayReq.Runs, nil) sch.On("ClearBatch", mock.Anything, tnnt, jobAName, executionTime1, executionTime2).Return(nil) replayRepository.On("UpdateReplay", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStateReplayed, mock.Anything, "").Return(nil) replayWorker := service.NewReplayWorker(logger, replayRepository, sch, jobRepository, replayServerConfig) replayWorker.Process(replayReq) }) + t.Run("should able to process new replay request with creating non existing runs", func(t *testing.T) { + replayRepository := new(ReplayRepository) + defer replayRepository.AssertExpectations(t) + + sch := new(mockReplayScheduler) + defer sch.AssertExpectations(t) + + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + + replayReq := &scheduler.ReplayWithRun{ + Replay: scheduler.NewReplay(uuid.New(), jobAName, tnnt, replayConfig, scheduler.ReplayStateCreated, time.Now()), + Runs: []*scheduler.JobRunStatus{ + { + ScheduledAt: scheduledTime1, + State: scheduler.StatePending, + }, + { + ScheduledAt: scheduledTime2, + State: scheduler.StatePending, + }, + }, + } + updatedRunsAfterRunCreate := []*scheduler.JobRunStatus{ + { + ScheduledAt: scheduledTime1, + State: scheduler.StateInProgress, + }, + { + ScheduledAt: scheduledTime2, + State: scheduler.StatePending, + }, + } + updatedRuns := []*scheduler.JobRunStatus{ + { + ScheduledAt: scheduledTime1, + State: scheduler.StateInProgress, + }, + { + ScheduledAt: scheduledTime2, + State: scheduler.StateInProgress, + }, + } + existingRuns := []*scheduler.JobRunStatus{{ + ScheduledAt: scheduledTime2, + State: scheduler.StateSuccess, + }} + + jobRepository.On("GetJobDetails", mock.Anything, projName, jobAName).Return(jobAWithDetails, nil) + sch.On("GetJobRuns", mock.Anything, tnnt, mock.Anything, jobCron).Return(existingRuns, nil) + sch.On("CreateRun", mock.Anything, tnnt, jobAName, scheduledTime1, "replayed").Return(nil).Once() + sch.On("Clear", mock.Anything, tnnt, jobAName, scheduledTime2.Add(-24*time.Hour)).Return(nil) + replayRepository.On("UpdateReplay", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStatePartialReplayed, updatedRunsAfterRunCreate, "").Return(nil) + replayRepository.On("UpdateReplay", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStatePartialReplayed, updatedRuns, "").Return(nil) + + replayWorker := service.NewReplayWorker(logger, replayRepository, sch, jobRepository, replayServerConfig) + replayWorker.Process(replayReq) + }) t.Run("should able to update replay state as failed if unable to get job details", func(t *testing.T) { replayRepository := new(ReplayRepository) @@ -221,6 +283,7 @@ func TestReplayWorker(t *testing.T) { } jobRepository.On("GetJobDetails", mock.Anything, projName, jobAName).Return(jobAWithDetails, nil) + sch.On("GetJobRuns", mock.Anything, tnnt, mock.Anything, jobCron).Return(replayReq.Runs, nil) sch.On("ClearBatch", mock.Anything, tnnt, jobAName, executionTime1, executionTime2).Return(internalErr) replayRepository.On("UpdateReplayStatus", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStateFailed, mock.Anything).Return(nil) @@ -248,6 +311,7 @@ func TestReplayWorker(t *testing.T) { } jobRepository.On("GetJobDetails", mock.Anything, projName, jobAName).Return(jobAWithDetails, nil) + sch.On("GetJobRuns", mock.Anything, tnnt, mock.Anything, jobCron).Return(replayReq.Runs, nil) sch.On("Clear", mock.Anything, tnnt, jobAName, scheduledTime1.Add(-24*time.Hour)).Return(internalErr) replayRepository.On("UpdateReplayStatus", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStateFailed, mock.Anything).Return(nil) @@ -255,7 +319,7 @@ func TestReplayWorker(t *testing.T) { replayWorker.Process(replayReq) }) - t.Run("should able to process partial replayed request", func(t *testing.T) { + t.Run("should able to process partial replayed request with the recent run status is success", func(t *testing.T) { replayRepository := new(ReplayRepository) defer replayRepository.AssertExpectations(t) @@ -270,12 +334,16 @@ func TestReplayWorker(t *testing.T) { Runs: []*scheduler.JobRunStatus{ { ScheduledAt: scheduledTime1, - State: scheduler.StateReplayed, + State: scheduler.StateInProgress, }, { ScheduledAt: scheduledTime2, State: scheduler.StatePending, }, + { + ScheduledAt: scheduledTime3, + State: scheduler.StatePending, + }, }, } updatedRuns1 := []*scheduler.JobRunStatus{ @@ -285,7 +353,11 @@ func TestReplayWorker(t *testing.T) { }, { ScheduledAt: scheduledTime2, - State: scheduler.StatePending, + State: scheduler.StateFailed, + }, + { + ScheduledAt: scheduledTime3, + State: scheduler.StateFailed, }, } updatedRuns2 := []*scheduler.JobRunStatus{ @@ -295,14 +367,82 @@ func TestReplayWorker(t *testing.T) { }, { ScheduledAt: scheduledTime2, - State: scheduler.StateReplayed, + State: scheduler.StateInProgress, + }, + { + ScheduledAt: scheduledTime3, + State: scheduler.StatePending, + }, + } + + jobRepository.On("GetJobDetails", mock.Anything, projName, jobAName).Return(jobAWithDetails, nil) + sch.On("GetJobRuns", mock.Anything, tnnt, runsCriteriaJobA, jobCron).Return(updatedRuns1, nil).Once() + sch.On("Clear", mock.Anything, tnnt, jobAName, scheduledTime2.Add(-24*time.Hour)).Return(nil) + replayRepository.On("UpdateReplay", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStatePartialReplayed, updatedRuns2, "").Return(nil).Once() + + replayWorker := service.NewReplayWorker(logger, replayRepository, sch, jobRepository, replayServerConfig) + replayWorker.Process(replayReq) + }) + t.Run("should able to process partial replayed request with the recent run status is failed", func(t *testing.T) { + replayRepository := new(ReplayRepository) + defer replayRepository.AssertExpectations(t) + + sch := new(mockReplayScheduler) + defer sch.AssertExpectations(t) + + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + + replayReq := &scheduler.ReplayWithRun{ + Replay: scheduler.NewReplay(uuid.New(), jobAName, tnnt, replayConfigParallel, scheduler.ReplayStatePartialReplayed, time.Now()), + Runs: []*scheduler.JobRunStatus{ + { + ScheduledAt: scheduledTime1, + State: scheduler.StateInProgress, + }, + { + ScheduledAt: scheduledTime2, + State: scheduler.StatePending, + }, + { + ScheduledAt: scheduledTime3, + State: scheduler.StatePending, + }, + }, + } + updatedRuns1 := []*scheduler.JobRunStatus{ + { + ScheduledAt: scheduledTime1, + State: scheduler.StateFailed, + }, + { + ScheduledAt: scheduledTime2, + State: scheduler.StateFailed, + }, + { + ScheduledAt: scheduledTime3, + State: scheduler.StateFailed, + }, + } + updatedRuns2 := []*scheduler.JobRunStatus{ + { + ScheduledAt: scheduledTime1, + State: scheduler.StateFailed, + }, + { + ScheduledAt: scheduledTime2, + State: scheduler.StateInProgress, + }, + { + ScheduledAt: scheduledTime3, + State: scheduler.StatePending, }, } jobRepository.On("GetJobDetails", mock.Anything, projName, jobAName).Return(jobAWithDetails, nil) sch.On("GetJobRuns", mock.Anything, tnnt, runsCriteriaJobA, jobCron).Return(updatedRuns1, nil).Once() sch.On("Clear", mock.Anything, tnnt, jobAName, scheduledTime2.Add(-24*time.Hour)).Return(nil) - replayRepository.On("UpdateReplay", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStateReplayed, updatedRuns2, "").Return(nil).Once() + replayRepository.On("UpdateReplay", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStatePartialReplayed, updatedRuns2, "").Return(nil).Once() replayWorker := service.NewReplayWorker(logger, replayRepository, sch, jobRepository, replayServerConfig) replayWorker.Process(replayReq) @@ -322,12 +462,16 @@ func TestReplayWorker(t *testing.T) { Runs: []*scheduler.JobRunStatus{ { ScheduledAt: scheduledTime1, - State: scheduler.StateReplayed, + State: scheduler.StateInProgress, }, { ScheduledAt: scheduledTime2, State: scheduler.StatePending, }, + { + ScheduledAt: scheduledTime3, + State: scheduler.StatePending, + }, }, } @@ -353,7 +497,7 @@ func TestReplayWorker(t *testing.T) { Runs: []*scheduler.JobRunStatus{ { ScheduledAt: scheduledTime1, - State: scheduler.StateReplayed, + State: scheduler.StateInProgress, }, { ScheduledAt: scheduledTime2, @@ -381,7 +525,7 @@ func TestReplayWorker(t *testing.T) { replayWorker.Process(replayReq) }) - t.Run("should able to process replayed request", func(t *testing.T) { + t.Run("should able to process replayed request if all state are success", func(t *testing.T) { replayRepository := new(ReplayRepository) defer replayRepository.AssertExpectations(t) @@ -400,7 +544,7 @@ func TestReplayWorker(t *testing.T) { }, { ScheduledAt: scheduledTime2, - State: scheduler.StateReplayed, + State: scheduler.StateInProgress, }, }, } @@ -422,6 +566,69 @@ func TestReplayWorker(t *testing.T) { replayWorker := service.NewReplayWorker(logger, replayRepository, sch, jobRepository, replayServerConfig) replayWorker.Process(replayReq) }) + t.Run("should able to process replayed request if some of the runs are in failed state", func(t *testing.T) { + replayRepository := new(ReplayRepository) + defer replayRepository.AssertExpectations(t) + + sch := new(mockReplayScheduler) + defer sch.AssertExpectations(t) + + jobRepository := new(JobRepository) + defer jobRepository.AssertExpectations(t) + + replayReq := &scheduler.ReplayWithRun{ + Replay: scheduler.NewReplay(uuid.New(), jobAName, tnnt, replayConfigParallel, scheduler.ReplayStateReplayed, time.Now()), + Runs: []*scheduler.JobRunStatus{ + { + ScheduledAt: scheduledTime1, + State: scheduler.StateInProgress, + }, + { + ScheduledAt: scheduledTime2, + State: scheduler.StateInProgress, + }, + { + ScheduledAt: scheduledTime3, + State: scheduler.StateInProgress, + }, + }, + } + runsFromScheduler := []*scheduler.JobRunStatus{ + { + ScheduledAt: scheduledTime1, + State: scheduler.StateFailed, + }, + { + ScheduledAt: scheduledTime2, + State: scheduler.StateRunning, + }, + { + ScheduledAt: scheduledTime3, + State: scheduler.StateRunning, + }, + } + updatedRuns := []*scheduler.JobRunStatus{ + { + ScheduledAt: scheduledTime1, + State: scheduler.StateFailed, + }, + { + ScheduledAt: scheduledTime2, + State: scheduler.StateInProgress, + }, + { + ScheduledAt: scheduledTime3, + State: scheduler.StateInProgress, + }, + } + + jobRepository.On("GetJobDetails", mock.Anything, projName, jobAName).Return(jobAWithDetails, nil) + sch.On("GetJobRuns", mock.Anything, tnnt, runsCriteriaJobA, jobCron).Return(runsFromScheduler, nil) + replayRepository.On("UpdateReplay", mock.Anything, replayReq.Replay.ID(), scheduler.ReplayStateReplayed, updatedRuns, "").Return(nil) + + replayWorker := service.NewReplayWorker(logger, replayRepository, sch, jobRepository, replayServerConfig) + replayWorker.Process(replayReq) + }) t.Run("should able to update replay state as failed if unable to fetch runs when processing replayed request", func(t *testing.T) { replayRepository := new(ReplayRepository) defer replayRepository.AssertExpectations(t) @@ -441,7 +648,7 @@ func TestReplayWorker(t *testing.T) { }, { ScheduledAt: scheduledTime2, - State: scheduler.StateReplayed, + State: scheduler.StateInProgress, }, }, } @@ -472,7 +679,7 @@ func TestReplayWorker(t *testing.T) { }, { ScheduledAt: scheduledTime2, - State: scheduler.StateReplayed, + State: scheduler.StateInProgress, }, }, } @@ -530,6 +737,20 @@ func (_m *mockReplayScheduler) ClearBatch(ctx context.Context, t tenant.Tenant, return r0 } +// CreateRun provides a mock function with given fields: ctx, tnnt, jobName, executionTime, dagRunID +func (_m *mockReplayScheduler) CreateRun(ctx context.Context, tnnt tenant.Tenant, jobName scheduler.JobName, executionTime time.Time, dagRunIDPrefix string) error { + ret := _m.Called(ctx, tnnt, jobName, executionTime, dagRunIDPrefix) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, tenant.Tenant, scheduler.JobName, time.Time, string) error); ok { + r0 = rf(ctx, tnnt, jobName, executionTime, dagRunIDPrefix) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // GetJobRuns provides a mock function with given fields: ctx, t, criteria, jobCron func (_m *mockReplayScheduler) GetJobRuns(ctx context.Context, t tenant.Tenant, criteria *scheduler.JobRunsCriteria, jobCron *cron.ScheduleSpec) ([]*scheduler.JobRunStatus, error) { ret := _m.Called(ctx, t, criteria, jobCron) diff --git a/core/scheduler/status.go b/core/scheduler/status.go index 8774d033bc..c453114341 100644 --- a/core/scheduler/status.go +++ b/core/scheduler/status.go @@ -5,8 +5,8 @@ import ( "strings" "time" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/lib/cron" ) const ( @@ -21,8 +21,8 @@ const ( StateSuccess State = "success" StateFailed State = "failed" - // StateReplayed is a replay-specific state to identify a run has been replayed but not yet finished - StateReplayed State = "replayed" + StateWaitUpstream State = "wait_upstream" + StateInProgress State = "in_progress" ) var TaskEndStates = []State{StateSuccess, StateFailed, StateRetry} @@ -45,8 +45,10 @@ func StateFromString(state string) (State, error) { return StateSuccess, nil case string(StateFailed): return StateFailed, nil - case string(StateReplayed): - return StateReplayed, nil + case string(StateWaitUpstream): + return StateWaitUpstream, nil + case string(StateInProgress): + return StateInProgress, nil default: return "", errors.InvalidArgument(EntityJobRun, "invalid state for run "+state) } @@ -97,6 +99,14 @@ func (j JobRunStatusList) GetSortedRunsByStates(states []State) []*JobRunStatus return result } +func (j JobRunStatusList) GetSortedRunsByScheduledAt() []*JobRunStatus { + result := []*JobRunStatus(j) + sort.Slice(result, func(i, j int) bool { + return result[i].ScheduledAt.Before(result[j].ScheduledAt) + }) + return result +} + func (j JobRunStatusList) MergeWithUpdatedRuns(updatedRunMap map[time.Time]State) []*JobRunStatus { var updatedRuns []*JobRunStatus for _, run := range j { diff --git a/core/scheduler/status_test.go b/core/scheduler/status_test.go index 5d167e562f..3f812e4b98 100644 --- a/core/scheduler/status_test.go +++ b/core/scheduler/status_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/internal/lib/cron" ) func TestStatus(t *testing.T) { @@ -86,20 +86,20 @@ func TestStatus(t *testing.T) { }) t.Run("StateFromString", func(t *testing.T) { expectationsMap := map[string]scheduler.State{ - "pending": scheduler.StatePending, - "PENDING": scheduler.StatePending, - "accepted": scheduler.StateAccepted, - "ACCEPTED": scheduler.StateAccepted, - "running": scheduler.StateRunning, - "RUNNING": scheduler.StateRunning, - "queued": scheduler.StateQueued, - "QUEUED": scheduler.StateQueued, - "success": scheduler.StateSuccess, - "SUCCESS": scheduler.StateSuccess, - "failed": scheduler.StateFailed, - "FAILED": scheduler.StateFailed, - "replayed": scheduler.StateReplayed, - "REPLAYED": scheduler.StateReplayed, + "pending": scheduler.StatePending, + "PENDING": scheduler.StatePending, + "accepted": scheduler.StateAccepted, + "ACCEPTED": scheduler.StateAccepted, + "running": scheduler.StateRunning, + "RUNNING": scheduler.StateRunning, + "queued": scheduler.StateQueued, + "QUEUED": scheduler.StateQueued, + "success": scheduler.StateSuccess, + "SUCCESS": scheduler.StateSuccess, + "failed": scheduler.StateFailed, + "FAILED": scheduler.StateFailed, + "in_progress": scheduler.StateInProgress, + "IN_PROGRESS": scheduler.StateInProgress, } for input, expectedState := range expectationsMap { respState, err := scheduler.StateFromString(input) @@ -157,6 +157,43 @@ func TestStatus(t *testing.T) { runs := jobRunStatusList.GetSortedRunsByStates([]scheduler.State{scheduler.StateRunning}) assert.Equal(t, expectedRuns, runs) }) + t.Run("GetSortedRunsByScheduledAt", func(t *testing.T) { + time1 := time.Date(2023, 0o1, 1, 0, 0, 0, 0, time.UTC) + time2 := time.Date(2023, 0o1, 2, 0, 0, 0, 0, time.UTC) + time3 := time.Date(2023, 0o1, 3, 0, 0, 0, 0, time.UTC) + + jobRunStatusList := scheduler.JobRunStatusList([]*scheduler.JobRunStatus{ + { + ScheduledAt: time3, + State: scheduler.StateRunning, + }, + { + ScheduledAt: time1, + State: scheduler.StatePending, + }, + { + ScheduledAt: time2, + State: scheduler.StateRunning, + }, + }) + expectedRuns := []*scheduler.JobRunStatus{ + { + ScheduledAt: time1, + State: scheduler.StatePending, + }, + { + ScheduledAt: time2, + State: scheduler.StateRunning, + }, + { + ScheduledAt: time3, + State: scheduler.StateRunning, + }, + } + + runs := jobRunStatusList.GetSortedRunsByScheduledAt() + assert.Equal(t, expectedRuns, runs) + }) t.Run("MergeWithUpdatedRuns", func(t *testing.T) { time1 := time.Date(2023, 0o1, 1, 0, 0, 0, 0, time.UTC) time2 := time.Date(2023, 0o1, 2, 0, 0, 0, 0, time.UTC) diff --git a/core/tenant/handler/v1beta1/namespace.go b/core/tenant/handler/v1beta1/namespace.go index 27202043be..9633142fe4 100644 --- a/core/tenant/handler/v1beta1/namespace.go +++ b/core/tenant/handler/v1beta1/namespace.go @@ -4,11 +4,11 @@ import ( "context" "strings" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type NamespaceService interface { @@ -29,16 +29,19 @@ func (nh *NamespaceHandler) RegisterProjectNamespace(ctx context.Context, req *p ) { projName, err := tenant.ProjectNameFrom(req.GetProjectName()) if err != nil { + nh.l.Error("error adapting project name [%s]: %s", req.GetProjectName(), err) return nil, errors.GRPCErr(err, "error in register namespace "+req.GetNamespace().Name) } namespace, err := fromNamespaceProto(req.GetNamespace(), projName) if err != nil { + nh.l.Error("error adapting project [%s]: %s", projName, err) return nil, errors.GRPCErr(err, "error in register namespace "+req.GetNamespace().Name) } err = nh.nsService.Save(ctx, namespace) if err != nil { + nh.l.Error("error saving namespace: %s", err) return nil, errors.GRPCErr(err, "error in register namespace "+req.GetNamespace().Name) } @@ -50,11 +53,13 @@ func (nh *NamespaceHandler) ListProjectNamespaces(ctx context.Context, req *pb.L ) { projName, err := tenant.ProjectNameFrom(req.GetProjectName()) if err != nil { + nh.l.Error("error adapting project name [%s]: %s", req.GetProjectName(), err) return nil, errors.GRPCErr(err, "error in list namespaces") } namespaces, err := nh.nsService.GetAll(ctx, projName) if err != nil { + nh.l.Error("error getting all namespaces for project [%s]: %s", projName, err) return nil, errors.GRPCErr(err, "error in list namespaces") } @@ -73,16 +78,19 @@ func (nh *NamespaceHandler) GetNamespace(ctx context.Context, request *pb.GetNam ) { projName, err := tenant.ProjectNameFrom(request.GetProjectName()) if err != nil { + nh.l.Error("error adapting project name [%s]: %s", request.GetProjectName(), err) return nil, errors.GRPCErr(err, "error in get namespace "+request.NamespaceName) } namespaceName, err := tenant.NamespaceNameFrom(request.GetNamespaceName()) if err != nil { + nh.l.Error("error adapting namespace name [%s]: %s", request.GetNamespaceName(), err) return nil, errors.GRPCErr(err, "error in get namespace "+request.NamespaceName) } namespace, err := nh.nsService.Get(ctx, projName, namespaceName) if err != nil { + nh.l.Error("error getting namespace: %s", err) return nil, errors.GRPCErr(err, "error in get namespace "+request.NamespaceName) } diff --git a/core/tenant/handler/v1beta1/namespace_test.go b/core/tenant/handler/v1beta1/namespace_test.go index d75426d515..f56221f3af 100644 --- a/core/tenant/handler/v1beta1/namespace_test.go +++ b/core/tenant/handler/v1beta1/namespace_test.go @@ -5,13 +5,13 @@ import ( "errors" "testing" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/core/tenant/handler/v1beta1" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant/handler/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) func TestNamespaceHandler(t *testing.T) { diff --git a/core/tenant/handler/v1beta1/project.go b/core/tenant/handler/v1beta1/project.go index 2995646fb1..a94b29b171 100644 --- a/core/tenant/handler/v1beta1/project.go +++ b/core/tenant/handler/v1beta1/project.go @@ -5,11 +5,11 @@ import ( "fmt" "strings" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type ProjectHandler struct { @@ -34,9 +34,11 @@ type TenantService interface { func (ph *ProjectHandler) RegisterProject(ctx context.Context, req *pb.RegisterProjectRequest) (*pb.RegisterProjectResponse, error) { project, err := fromProjectProto(req.GetProject()) if err != nil { + ph.l.Error("error adapting project: %s", err) return nil, errors.GRPCErr(err, fmt.Sprintf("not able to register project %s", req.GetProject().Name)) } if err := ph.projectService.Save(ctx, project); err != nil { + ph.l.Error("error saving project: %s", err) return nil, errors.GRPCErr(err, fmt.Sprintf("not able to register project %s", req.GetProject().Name)) } @@ -47,6 +49,7 @@ func (ph *ProjectHandler) RegisterProject(ctx context.Context, req *pb.RegisterP func (ph *ProjectHandler) ListProjects(ctx context.Context, _ *pb.ListProjectsRequest) (*pb.ListProjectsResponse, error) { projects, err := ph.projectService.GetAll(ctx) if err != nil { + ph.l.Error("error getting all projects: %s", err) return nil, errors.GRPCErr(err, "failed to retrieve saved projects") } @@ -63,10 +66,12 @@ func (ph *ProjectHandler) ListProjects(ctx context.Context, _ *pb.ListProjectsRe func (ph *ProjectHandler) GetProject(ctx context.Context, req *pb.GetProjectRequest) (*pb.GetProjectResponse, error) { projName, err := tenant.ProjectNameFrom(req.GetProjectName()) if err != nil { + ph.l.Error("error adapting project name [%s]: %s", req.GetProjectName(), err) return nil, errors.GRPCErr(err, fmt.Sprintf("failed to retrieve project [%s]", req.GetProjectName())) } project, err := ph.projectService.Get(ctx, projName) if err != nil { + ph.l.Error("error getting project [%s]: %s", projName, err) return nil, errors.GRPCErr(err, fmt.Sprintf("failed to retrieve project [%s]", req.GetProjectName())) } return &pb.GetProjectResponse{ diff --git a/core/tenant/handler/v1beta1/project_test.go b/core/tenant/handler/v1beta1/project_test.go index 3c7079b00d..7079d58e10 100644 --- a/core/tenant/handler/v1beta1/project_test.go +++ b/core/tenant/handler/v1beta1/project_test.go @@ -5,13 +5,13 @@ import ( "errors" "testing" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/core/tenant/handler/v1beta1" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant/handler/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) func TestProjectHandler(t *testing.T) { diff --git a/core/tenant/handler/v1beta1/secret.go b/core/tenant/handler/v1beta1/secret.go index 5518f86465..787b576ac7 100644 --- a/core/tenant/handler/v1beta1/secret.go +++ b/core/tenant/handler/v1beta1/secret.go @@ -4,13 +4,24 @@ import ( "context" "encoding/base64" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/core/tenant/dto" - "github.com/odpf/optimus/internal/errors" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant/dto" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/telemetry" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" +) + +const ( + metricSecretEvents = "secret_events_total" + secretEventsStatusRegistered = "registered" + secretEventsStatusUpdated = "updated" + secretEventsStatusDeleted = "deleted" + secretEventsStatusRegisterFailed = "register_failed" + secretEventsStatusUpdateFailed = "update_failed" + secretEventsStatusDeleteFailed = "delete_failed" ) type SecretService interface { @@ -35,18 +46,22 @@ func (sv *SecretHandler) RegisterSecret(ctx context.Context, req *pb.RegisterSec base64Decoded, err := getDecodedSecret(req.GetValue()) if err != nil { + raiseSecretEventsMetric(projName.String(), req.NamespaceName, secretEventsStatusRegisterFailed) return nil, errors.GRPCErr(err, "failed to register secret "+req.GetSecretName()) } secret, err := tenant.NewPlainTextSecret(req.GetSecretName(), base64Decoded) if err != nil { + raiseSecretEventsMetric(projName.String(), req.NamespaceName, secretEventsStatusRegisterFailed) return nil, errors.GRPCErr(err, "failed to register secret "+req.GetSecretName()) } if err = sv.secretService.Save(ctx, projName, req.GetNamespaceName(), secret); err != nil { + raiseSecretEventsMetric(projName.String(), req.NamespaceName, secretEventsStatusRegisterFailed) return nil, errors.GRPCErr(err, "failed to register secret "+req.GetSecretName()) } + raiseSecretEventsMetric(projName.String(), req.NamespaceName, secretEventsStatusRegistered) return &pb.RegisterSecretResponse{}, nil } @@ -58,18 +73,22 @@ func (sv *SecretHandler) UpdateSecret(ctx context.Context, req *pb.UpdateSecretR base64Decoded, err := getDecodedSecret(req.GetValue()) if err != nil { + raiseSecretEventsMetric(projName.String(), req.NamespaceName, secretEventsStatusUpdateFailed) return nil, errors.GRPCErr(err, "failed to update secret "+req.GetSecretName()) } secret, err := tenant.NewPlainTextSecret(req.GetSecretName(), base64Decoded) if err != nil { + raiseSecretEventsMetric(projName.String(), req.NamespaceName, secretEventsStatusUpdateFailed) return nil, errors.GRPCErr(err, "failed to update secret "+req.GetSecretName()) } if err = sv.secretService.Update(ctx, projName, req.GetNamespaceName(), secret); err != nil { + raiseSecretEventsMetric(projName.String(), req.NamespaceName, secretEventsStatusUpdateFailed) return nil, errors.GRPCErr(err, "failed to update secret "+req.GetSecretName()) } + raiseSecretEventsMetric(projName.String(), req.NamespaceName, secretEventsStatusUpdated) return &pb.UpdateSecretResponse{}, nil } @@ -110,9 +129,11 @@ func (sv *SecretHandler) DeleteSecret(ctx context.Context, req *pb.DeleteSecretR } if err = sv.secretService.Delete(ctx, projName, req.GetNamespaceName(), secretName); err != nil { + raiseSecretEventsMetric(projName.String(), req.NamespaceName, secretEventsStatusDeleteFailed) return nil, errors.GRPCErr(err, "failed to delete secret "+secretName.String()) } + raiseSecretEventsMetric(projName.String(), req.NamespaceName, secretEventsStatusDeleted) return &pb.DeleteSecretResponse{}, nil } @@ -134,3 +155,11 @@ func NewSecretsHandler(l log.Logger, secretService SecretService) *SecretHandler secretService: secretService, } } + +func raiseSecretEventsMetric(projectName, namespaceName, state string) { + telemetry.NewCounter(metricSecretEvents, map[string]string{ + "project": projectName, + "namespace": namespaceName, + "status": state, + }).Inc() +} diff --git a/core/tenant/handler/v1beta1/secret_test.go b/core/tenant/handler/v1beta1/secret_test.go index 0928652c99..57dcfcb44a 100644 --- a/core/tenant/handler/v1beta1/secret_test.go +++ b/core/tenant/handler/v1beta1/secret_test.go @@ -7,14 +7,14 @@ import ( "testing" "time" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/core/tenant/dto" - "github.com/odpf/optimus/core/tenant/handler/v1beta1" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant/dto" + "github.com/raystack/optimus/core/tenant/handler/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) func TestNewSecretsHandler(t *testing.T) { diff --git a/core/tenant/namespace.go b/core/tenant/namespace.go index 5fd2855063..0239eaf027 100644 --- a/core/tenant/namespace.go +++ b/core/tenant/namespace.go @@ -1,7 +1,7 @@ package tenant import ( - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/internal/errors" ) const EntityNamespace = "namespace" diff --git a/core/tenant/namespace_test.go b/core/tenant/namespace_test.go index 441e92785a..0313668061 100644 --- a/core/tenant/namespace_test.go +++ b/core/tenant/namespace_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant" ) func TestEntityNamespace(t *testing.T) { diff --git a/core/tenant/project.go b/core/tenant/project.go index c52fd6f639..2f04de3db7 100644 --- a/core/tenant/project.go +++ b/core/tenant/project.go @@ -1,8 +1,8 @@ package tenant import ( - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/utils" ) const ( diff --git a/core/tenant/project_test.go b/core/tenant/project_test.go index 194b474af4..22c49048ce 100644 --- a/core/tenant/project_test.go +++ b/core/tenant/project_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant" ) func TestEntityProject(t *testing.T) { diff --git a/core/tenant/secret.go b/core/tenant/secret.go index 784f5c72f2..22dcb4f92e 100644 --- a/core/tenant/secret.go +++ b/core/tenant/secret.go @@ -1,6 +1,6 @@ package tenant -import "github.com/odpf/optimus/internal/errors" +import "github.com/raystack/optimus/internal/errors" const ( EntitySecret = "secret" diff --git a/core/tenant/secret_test.go b/core/tenant/secret_test.go index e61637a8e1..cf11e45cd5 100644 --- a/core/tenant/secret_test.go +++ b/core/tenant/secret_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant" ) func TestEntitySecret(t *testing.T) { diff --git a/core/tenant/service/namespace_service.go b/core/tenant/service/namespace_service.go index 38e9092b7c..00e9c2f9f5 100644 --- a/core/tenant/service/namespace_service.go +++ b/core/tenant/service/namespace_service.go @@ -3,7 +3,7 @@ package service import ( "context" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant" ) type NamespaceRepository interface { diff --git a/core/tenant/service/namespace_service_test.go b/core/tenant/service/namespace_service_test.go index ac060ab093..0b83a09b62 100644 --- a/core/tenant/service/namespace_service_test.go +++ b/core/tenant/service/namespace_service_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/core/tenant/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant/service" ) func TestNamespaceService(t *testing.T) { diff --git a/core/tenant/service/project_service.go b/core/tenant/service/project_service.go index fa2be5149d..9c8570cb7b 100644 --- a/core/tenant/service/project_service.go +++ b/core/tenant/service/project_service.go @@ -3,7 +3,7 @@ package service import ( "context" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant" ) type ProjectService struct { diff --git a/core/tenant/service/project_service_test.go b/core/tenant/service/project_service_test.go index 16abe5ad24..da763cb293 100644 --- a/core/tenant/service/project_service_test.go +++ b/core/tenant/service/project_service_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/core/tenant/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant/service" ) func TestProjectService(t *testing.T) { diff --git a/core/tenant/service/secret_service.go b/core/tenant/service/secret_service.go index 993d908855..e62c89597c 100644 --- a/core/tenant/service/secret_service.go +++ b/core/tenant/service/secret_service.go @@ -4,10 +4,11 @@ import ( "context" "github.com/gtank/cryptopasta" + "github.com/raystack/salt/log" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/core/tenant/dto" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant/dto" + "github.com/raystack/optimus/internal/errors" ) const keyLength = 32 @@ -24,20 +25,25 @@ type SecretRepository interface { type SecretService struct { appKey *[keyLength]byte repo SecretRepository + + logger log.Logger } func (s SecretService) Save(ctx context.Context, projName tenant.ProjectName, nsName string, secret *tenant.PlainTextSecret) error { if secret == nil { + s.logger.Error("secret is nil") return errors.InvalidArgument(tenant.EntitySecret, "secret is not valid") } encoded, err := cryptopasta.Encrypt([]byte(secret.Value()), s.appKey) if err != nil { + s.logger.Error("error encrypting secret: %s", err) return errors.InternalError(tenant.EntitySecret, "unable to encrypt the secret", err) } item, err := tenant.NewSecret(secret.Name().String(), string(encoded), projName, nsName) if err != nil { + s.logger.Error("error encountered when constructing a new secret: %s", err) return err } @@ -46,16 +52,19 @@ func (s SecretService) Save(ctx context.Context, projName tenant.ProjectName, ns func (s SecretService) Update(ctx context.Context, projName tenant.ProjectName, nsName string, secret *tenant.PlainTextSecret) error { if secret == nil { + s.logger.Error("secret is nil") return errors.InvalidArgument(tenant.EntitySecret, "secret is not valid") } encoded, err := cryptopasta.Encrypt([]byte(secret.Value()), s.appKey) if err != nil { + s.logger.Error("error encrypting secret: %s", err) return errors.InternalError(tenant.EntitySecret, "unable to encrypt the secret", err) } item, err := tenant.NewSecret(secret.Name().String(), string(encoded), projName, nsName) if err != nil { + s.logger.Error("error constructing a new secret: %s", err) return err } @@ -65,20 +74,24 @@ func (s SecretService) Update(ctx context.Context, projName tenant.ProjectName, func (s SecretService) Get(ctx context.Context, projName tenant.ProjectName, namespaceName, name string) (*tenant.PlainTextSecret, error) { secretName, err := tenant.SecretNameFrom(name) if err != nil { + s.logger.Error("error adapting secret name [%s]: %s", name, err) return nil, errors.InvalidArgument(tenant.EntitySecret, "secret name is not valid") } if projName == "" { + s.logger.Error("project name for secret [%s] is empty") return nil, errors.InvalidArgument(tenant.EntitySecret, "tenant is not valid") } secret, err := s.repo.Get(ctx, projName, namespaceName, secretName) if err != nil { + s.logger.Error("error getting stored secret: %s", err) return nil, err } cleartext, err := cryptopasta.Decrypt([]byte(secret.EncodedValue()), s.appKey) if err != nil { + s.logger.Error("error decrypting secret: %s", err) return nil, err } @@ -87,11 +100,13 @@ func (s SecretService) Get(ctx context.Context, projName tenant.ProjectName, nam func (s SecretService) GetAll(ctx context.Context, projName tenant.ProjectName, namespaceName string) ([]*tenant.PlainTextSecret, error) { if projName == "" { + s.logger.Error("project name is empty") return nil, errors.InvalidArgument(tenant.EntitySecret, "project name is not valid") } secrets, err := s.repo.GetAll(ctx, projName, namespaceName) if err != nil { + s.logger.Error("error getting all secrets under project [%s] namespace [%s]: %s", projName, namespaceName, err) return nil, err } @@ -99,11 +114,13 @@ func (s SecretService) GetAll(ctx context.Context, projName tenant.ProjectName, for i, secret := range secrets { cleartext, err := cryptopasta.Decrypt([]byte(secret.EncodedValue()), s.appKey) if err != nil { + s.logger.Error("error decrypting secret [%s]: %s", secret.Name().String(), err) return nil, err } pts, err := tenant.NewPlainTextSecret(secret.Name().String(), string(cleartext)) if err != nil { + s.logger.Error("error constructing plain text secret: %s", err) return nil, err } ptsecrets[i] = pts @@ -114,6 +131,7 @@ func (s SecretService) GetAll(ctx context.Context, projName tenant.ProjectName, func (s SecretService) Delete(ctx context.Context, projName tenant.ProjectName, nsName string, name tenant.SecretName) error { if name == "" { + s.logger.Error("secret name is empty") return errors.InvalidArgument(tenant.EntitySecret, "secret name is not valid") } @@ -124,9 +142,10 @@ func (s SecretService) GetSecretsInfo(ctx context.Context, projName tenant.Proje return s.repo.GetSecretsInfo(ctx, projName) } -func NewSecretService(appKey *[32]byte, repo SecretRepository) *SecretService { +func NewSecretService(appKey *[32]byte, repo SecretRepository, logger log.Logger) *SecretService { return &SecretService{ appKey: appKey, repo: repo, + logger: logger, } } diff --git a/core/tenant/service/secret_service_test.go b/core/tenant/service/secret_service_test.go index 2ef4b1ff51..8745ae4720 100644 --- a/core/tenant/service/secret_service_test.go +++ b/core/tenant/service/secret_service_test.go @@ -5,12 +5,13 @@ import ( "errors" "testing" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/core/tenant/dto" - "github.com/odpf/optimus/core/tenant/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant/dto" + "github.com/raystack/optimus/core/tenant/service" ) func TestSecretService(t *testing.T) { @@ -21,11 +22,13 @@ func TestSecretService(t *testing.T) { nsName := "test-namespace" invalidSecret := tenant.Secret{} + logger := log.NewLogrus() + t.Run("Save", func(t *testing.T) { t.Run("returns error when secret is not provided", func(t *testing.T) { secretRepo := new(secretRepo) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err := secretService.Save(ctx, projectName, nsName, nil) assert.NotNil(t, err) assert.EqualError(t, err, "invalid argument for entity secret: secret is not valid") @@ -34,7 +37,7 @@ func TestSecretService(t *testing.T) { secretRepo := new(secretRepo) invalidSecret := tenant.PlainTextSecret{} - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err := secretService.Save(ctx, projectName, nsName, &invalidSecret) assert.NotNil(t, err) assert.EqualError(t, err, "invalid argument for entity secret: secret name is empty") @@ -47,7 +50,7 @@ func TestSecretService(t *testing.T) { sec, err := tenant.NewPlainTextSecret("name", "value") assert.Nil(t, err) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err = secretService.Save(ctx, projectName, nsName, sec) assert.NotNil(t, err) assert.EqualError(t, err, "error in save") @@ -60,7 +63,7 @@ func TestSecretService(t *testing.T) { sec, err := tenant.NewPlainTextSecret("name", "value") assert.Nil(t, err) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err = secretService.Save(ctx, projectName, nsName, sec) assert.Nil(t, err) }) @@ -69,7 +72,7 @@ func TestSecretService(t *testing.T) { t.Run("returns error when secret is not provided", func(t *testing.T) { secretRepo := new(secretRepo) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err := secretService.Update(ctx, projectName, nsName, nil) assert.NotNil(t, err) assert.EqualError(t, err, "invalid argument for entity secret: secret is not valid") @@ -78,7 +81,7 @@ func TestSecretService(t *testing.T) { secretRepo := new(secretRepo) invalidSecret := tenant.PlainTextSecret{} - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err := secretService.Update(ctx, projectName, nsName, &invalidSecret) assert.NotNil(t, err) assert.EqualError(t, err, "invalid argument for entity secret: secret name is empty") @@ -91,7 +94,7 @@ func TestSecretService(t *testing.T) { sec, err := tenant.NewPlainTextSecret("name", "value") assert.Nil(t, err) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err = secretService.Update(ctx, projectName, nsName, sec) assert.NotNil(t, err) assert.EqualError(t, err, "error in update") @@ -104,7 +107,7 @@ func TestSecretService(t *testing.T) { sec, err := tenant.NewPlainTextSecret("name", "value") assert.Nil(t, err) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err = secretService.Update(ctx, projectName, nsName, sec) assert.Nil(t, err) }) @@ -113,7 +116,7 @@ func TestSecretService(t *testing.T) { t.Run("returns error when secret name is empty", func(t *testing.T) { secretRepo := new(secretRepo) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) _, err := secretService.Get(ctx, projectName, nsName, "") assert.NotNil(t, err) assert.EqualError(t, err, "invalid argument for entity secret: secret name is not valid") @@ -121,7 +124,7 @@ func TestSecretService(t *testing.T) { t.Run("returns error when project name is invalid", func(t *testing.T) { secretRepo := new(secretRepo) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) _, err := secretService.Get(ctx, "", nsName, "name") assert.NotNil(t, err) assert.EqualError(t, err, "invalid argument for entity secret: tenant is not valid") @@ -134,7 +137,7 @@ func TestSecretService(t *testing.T) { secretRepo.On("Get", ctx, projectName, nsName, sn).Return(nil, errors.New("error in get")) defer secretRepo.AssertExpectations(t) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) _, err = secretService.Get(ctx, projectName, nsName, "name") assert.NotNil(t, err) assert.EqualError(t, err, "error in get") @@ -147,7 +150,7 @@ func TestSecretService(t *testing.T) { secretRepo.On("Get", ctx, projectName, nsName, sn).Return(&invalidSecret, nil) defer secretRepo.AssertExpectations(t) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) _, err = secretService.Get(ctx, projectName, nsName, "name") assert.NotNil(t, err) assert.EqualError(t, err, "malformed ciphertext") @@ -167,7 +170,7 @@ func TestSecretService(t *testing.T) { secretRepo.On("Get", ctx, projectName, nsName, sn).Return(sec, nil) defer secretRepo.AssertExpectations(t) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) s, err := secretService.Get(ctx, projectName, nsName, "name") assert.Nil(t, err) assert.Equal(t, "name", s.Name().String()) @@ -178,7 +181,7 @@ func TestSecretService(t *testing.T) { t.Run("returns error when project name is invalid", func(t *testing.T) { secretRepo := new(secretRepo) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) _, err := secretService.GetAll(ctx, "", "") assert.NotNil(t, err) assert.EqualError(t, err, "invalid argument for entity secret: project name is not valid") @@ -188,7 +191,7 @@ func TestSecretService(t *testing.T) { secretRepo.On("GetAll", ctx, projectName, nsName).Return(nil, errors.New("error in get all")) defer secretRepo.AssertExpectations(t) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) _, err := secretService.GetAll(ctx, projectName, nsName) assert.NotNil(t, err) assert.EqualError(t, err, "error in get all") @@ -199,7 +202,7 @@ func TestSecretService(t *testing.T) { Return([]*tenant.Secret{&invalidSecret}, nil) defer secretRepo.AssertExpectations(t) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) _, err := secretService.GetAll(ctx, projectName, nsName) assert.NotNil(t, err) assert.EqualError(t, err, "malformed ciphertext") @@ -214,7 +217,7 @@ func TestSecretService(t *testing.T) { secretRepo.On("GetAll", ctx, projectName, nsName).Return([]*tenant.Secret{sec}, nil) defer secretRepo.AssertExpectations(t) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) s, err := secretService.GetAll(ctx, projectName, nsName) assert.Nil(t, err) assert.Equal(t, "name", s[0].Name().String()) @@ -225,7 +228,7 @@ func TestSecretService(t *testing.T) { t.Run("returns error when secret name is empty", func(t *testing.T) { secretRepo := new(secretRepo) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err := secretService.Delete(ctx, projectName, nsName, "") assert.NotNil(t, err) assert.EqualError(t, err, "invalid argument for entity secret: secret name is not valid") @@ -238,7 +241,7 @@ func TestSecretService(t *testing.T) { secretRepo.On("Delete", ctx, projectName, nsName, sn).Return(errors.New("error in delete")) defer secretRepo.AssertExpectations(t) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err = secretService.Delete(ctx, projectName, nsName, sn) assert.NotNil(t, err) assert.EqualError(t, err, "error in delete") @@ -251,7 +254,7 @@ func TestSecretService(t *testing.T) { secretRepo.On("Delete", ctx, projectName, nsName, sn).Return(nil) defer secretRepo.AssertExpectations(t) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) err = secretService.Delete(ctx, projectName, nsName, "name") assert.Nil(t, err) }) @@ -267,7 +270,7 @@ func TestSecretService(t *testing.T) { secretRepo.On("GetSecretsInfo", ctx, projectName).Return([]*dto.SecretInfo{&secretInfo}, nil) defer secretRepo.AssertExpectations(t) - secretService := service.NewSecretService(key, secretRepo) + secretService := service.NewSecretService(key, secretRepo, logger) info, err := secretService.GetSecretsInfo(ctx, projectName) assert.Nil(t, err) assert.Equal(t, 1, len(info)) diff --git a/core/tenant/service/tenant_service.go b/core/tenant/service/tenant_service.go index 23a8931118..794087bb0d 100644 --- a/core/tenant/service/tenant_service.go +++ b/core/tenant/service/tenant_service.go @@ -3,8 +3,10 @@ package service import ( "context" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/salt/log" + + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) type ProjectGetter interface { @@ -24,25 +26,31 @@ type TenantService struct { projGetter ProjectGetter namespaceGetter NamespaceGetter secretsGetter SecretsGetter + + logger log.Logger } func (t TenantService) GetDetails(ctx context.Context, tnnt tenant.Tenant) (*tenant.WithDetails, error) { if tnnt.IsInvalid() { + t.logger.Error("tenant information is invalid") return nil, errors.InvalidArgument(tenant.EntityTenant, "invalid tenant details provided") } proj, err := t.projGetter.Get(ctx, tnnt.ProjectName()) if err != nil { + t.logger.Error("error getting project [%s]: %s", tnnt.ProjectName().String(), err) return nil, err } namespace, err := t.namespaceGetter.Get(ctx, tnnt.ProjectName(), tnnt.NamespaceName()) if err != nil { + t.logger.Error("error getting namespace [%s]: %s", tnnt.NamespaceName().String(), err) return nil, err } secrets, err := t.secretsGetter.GetAll(ctx, tnnt.ProjectName(), tnnt.NamespaceName().String()) if err != nil { + t.logger.Error("error getting all secrets for project [%s] namespace [%s]: %s", tnnt.ProjectName(), tnnt.NamespaceName(), err) return nil, err } @@ -51,6 +59,7 @@ func (t TenantService) GetDetails(ctx context.Context, tnnt tenant.Tenant) (*ten func (t TenantService) GetProject(ctx context.Context, name tenant.ProjectName) (*tenant.Project, error) { if name == "" { + t.logger.Error("project name is empty") return nil, errors.InvalidArgument(tenant.EntityTenant, "invalid project name") } return t.projGetter.Get(ctx, name) @@ -58,6 +67,7 @@ func (t TenantService) GetProject(ctx context.Context, name tenant.ProjectName) func (t TenantService) GetSecrets(ctx context.Context, tnnt tenant.Tenant) ([]*tenant.PlainTextSecret, error) { if tnnt.IsInvalid() { + t.logger.Error("tenant information is invalid") return nil, errors.InvalidArgument(tenant.EntityTenant, "tenant is invalid") } return t.secretsGetter.GetAll(ctx, tnnt.ProjectName(), tnnt.NamespaceName().String()) @@ -65,15 +75,17 @@ func (t TenantService) GetSecrets(ctx context.Context, tnnt tenant.Tenant) ([]*t func (t TenantService) GetSecret(ctx context.Context, tnnt tenant.Tenant, name string) (*tenant.PlainTextSecret, error) { if tnnt.IsInvalid() { + t.logger.Error("tenant information is invalid") return nil, errors.InvalidArgument(tenant.EntityTenant, "tenant is invalid") } return t.secretsGetter.Get(ctx, tnnt.ProjectName(), tnnt.NamespaceName().String(), name) } -func NewTenantService(projGetter ProjectGetter, nsGetter NamespaceGetter, secretsGetter SecretsGetter) *TenantService { +func NewTenantService(projGetter ProjectGetter, nsGetter NamespaceGetter, secretsGetter SecretsGetter, logger log.Logger) *TenantService { return &TenantService{ projGetter: projGetter, namespaceGetter: nsGetter, secretsGetter: secretsGetter, + logger: logger, } } diff --git a/core/tenant/service/tenant_service_test.go b/core/tenant/service/tenant_service_test.go index 21d980e6c2..e888422bdc 100644 --- a/core/tenant/service/tenant_service_test.go +++ b/core/tenant/service/tenant_service_test.go @@ -5,11 +5,12 @@ import ( "errors" "testing" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/core/tenant/service" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant/service" ) func TestTenantService(t *testing.T) { @@ -23,9 +24,11 @@ func TestTenantService(t *testing.T) { ns, _ := tenant.NewNamespace("testNS", proj.Name(), map[string]string{}) tnnt, _ := tenant.NewTenant(proj.Name().String(), ns.Name().String()) + logger := log.NewLogrus() + t.Run("GetDetails", func(t *testing.T) { t.Run("returns error when tenant invalid", func(t *testing.T) { - tenantService := service.NewTenantService(nil, nil, nil) + tenantService := service.NewTenantService(nil, nil, nil, logger) _, err := tenantService.GetDetails(ctx, tenant.Tenant{}) assert.NotNil(t, err) @@ -36,7 +39,7 @@ func TestTenantService(t *testing.T) { projGetter.On("Get", ctx, tnnt.ProjectName()).Return(nil, errors.New("unable to get")) defer projGetter.AssertExpectations(t) - tenantService := service.NewTenantService(projGetter, nil, nil) + tenantService := service.NewTenantService(projGetter, nil, nil, logger) _, err := tenantService.GetDetails(ctx, tnnt) assert.NotNil(t, err) @@ -51,7 +54,7 @@ func TestTenantService(t *testing.T) { nsGetter.On("Get", ctx, tnnt.ProjectName(), tnnt.NamespaceName()).Return(nil, errors.New("unable to get ns")) defer nsGetter.AssertExpectations(t) - tenantService := service.NewTenantService(projGetter, nsGetter, nil) + tenantService := service.NewTenantService(projGetter, nsGetter, nil, logger) _, err := tenantService.GetDetails(ctx, tnnt) assert.NotNil(t, err) @@ -70,7 +73,7 @@ func TestTenantService(t *testing.T) { secGetter.On("GetAll", ctx, tnnt.ProjectName(), tnnt.NamespaceName().String()).Return(nil, errors.New("unable to get secrets")) defer secGetter.AssertExpectations(t) - tenantService := service.NewTenantService(projGetter, nsGetter, secGetter) + tenantService := service.NewTenantService(projGetter, nsGetter, secGetter, logger) _, err := tenantService.GetDetails(ctx, tnnt) assert.NotNil(t, err) @@ -91,7 +94,7 @@ func TestTenantService(t *testing.T) { Return([]*tenant.PlainTextSecret{pts}, nil) defer secGetter.AssertExpectations(t) - tenantService := service.NewTenantService(projGetter, nsGetter, secGetter) + tenantService := service.NewTenantService(projGetter, nsGetter, secGetter, logger) d, err := tenantService.GetDetails(ctx, tnnt) assert.Nil(t, err) @@ -107,7 +110,7 @@ func TestTenantService(t *testing.T) { t.Run("returns error when project name is invalid", func(t *testing.T) { projGetter := new(projectGetter) - tenantService := service.NewTenantService(projGetter, nil, nil) + tenantService := service.NewTenantService(projGetter, nil, nil, logger) _, err := tenantService.GetProject(ctx, "") assert.NotNil(t, err) @@ -118,7 +121,7 @@ func TestTenantService(t *testing.T) { projGetter.On("Get", ctx, tnnt.ProjectName()).Return(proj, nil) defer projGetter.AssertExpectations(t) - tenantService := service.NewTenantService(projGetter, nil, nil) + tenantService := service.NewTenantService(projGetter, nil, nil, logger) p, err := tenantService.GetProject(ctx, tnnt.ProjectName()) assert.Nil(t, err) @@ -129,7 +132,7 @@ func TestTenantService(t *testing.T) { t.Run("GetSecrets", func(t *testing.T) { t.Run("returns error when project name is invalid", func(t *testing.T) { secretsGetter := new(secretGetter) - tenantService := service.NewTenantService(nil, nil, secretsGetter) + tenantService := service.NewTenantService(nil, nil, secretsGetter, logger) invalidTenant := tenant.Tenant{} _, err := tenantService.GetSecrets(ctx, invalidTenant) @@ -142,7 +145,7 @@ func TestTenantService(t *testing.T) { secretsGetter.On("GetAll", ctx, proj.Name(), ns.Name().String()).Return([]*tenant.PlainTextSecret{pts}, nil) defer secretsGetter.AssertExpectations(t) - tenantService := service.NewTenantService(nil, nil, secretsGetter) + tenantService := service.NewTenantService(nil, nil, secretsGetter, logger) secrets, err := tenantService.GetSecrets(ctx, tnnt) assert.Nil(t, err) @@ -152,7 +155,7 @@ func TestTenantService(t *testing.T) { t.Run("GetSecret", func(t *testing.T) { t.Run("return error when project name is invalid", func(t *testing.T) { secretsGetter := new(secretGetter) - tenantService := service.NewTenantService(nil, nil, secretsGetter) + tenantService := service.NewTenantService(nil, nil, secretsGetter, logger) invalidTenant := tenant.Tenant{} _, err := tenantService.GetSecret(ctx, invalidTenant, "secret") @@ -165,7 +168,7 @@ func TestTenantService(t *testing.T) { secretsGetter.On("Get", ctx, proj.Name(), ns.Name().String(), "secret_name").Return(pts, nil) defer secretsGetter.AssertExpectations(t) - tenantService := service.NewTenantService(nil, nil, secretsGetter) + tenantService := service.NewTenantService(nil, nil, secretsGetter, logger) secret, err := tenantService.GetSecret(ctx, tnnt, pts.Name().String()) assert.Nil(t, err) diff --git a/core/tenant/tenant.go b/core/tenant/tenant.go index 079ecacf48..84b563c59e 100644 --- a/core/tenant/tenant.go +++ b/core/tenant/tenant.go @@ -1,8 +1,8 @@ package tenant import ( - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/utils" ) const EntityTenant = "tenant" diff --git a/core/tenant/tenant_test.go b/core/tenant/tenant_test.go index 349d4cff79..72480f27a1 100644 --- a/core/tenant/tenant_test.go +++ b/core/tenant/tenant_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant" ) func TestAggregateRootTenant(t *testing.T) { diff --git a/dev/Makefile b/dev/Makefile index 3ec61bb5e1..5a775d2a38 100644 --- a/dev/Makefile +++ b/dev/Makefile @@ -1,6 +1,6 @@ EXPECTED_CONTEXT=colima NAMESPACE=optimus-dev -OPTIMUS_ODPF_CHART=odpf/optimus +OPTIMUS_raystack_CHART=raystack/optimus OPTIMUS_PLUGINS_PATH=/tmp/colima/plugins DAGS_PATH?=/tmp/colima/dags @@ -21,9 +21,9 @@ apply.airflow: _context apply.optimus: _context mkdir -p ${DAGS_PATH} mkdir -p ${OPTIMUS_PLUGINS_PATH} - helm repo add odpf https://odpf.github.io/charts/ + helm repo add raystack https://raystack.github.io/charts/ $(eval OPTIMUS_PLUGIN_ARTIFACTS = $(shell ./get_artifacts.sh ${SETUP_FILE_PATH})) - helm upgrade --install optimus-dev ${OPTIMUS_ODPF_CHART} \ + helm upgrade --install optimus-dev ${OPTIMUS_raystack_CHART} \ -n ${NAMESPACE} \ --set volumes[0].hostPath.path=$(abspath ${DAGS_PATH}) \ --set volumes[1].hostPath.path=$(abspath ${OPTIMUS_PLUGINS_PATH}) \ diff --git a/dev/setup.yaml b/dev/setup.yaml index 43870b6d07..68bd5240e3 100644 --- a/dev/setup.yaml +++ b/dev/setup.yaml @@ -1,5 +1,5 @@ plugins: - - https://raw.githubusercontent.com/odpf/transformers/main/task/bq2bq/optimus-plugin-bq2bq.yaml + - https://raw.githubusercontent.com/raystack/transformers/main/task/bq2bq/optimus-plugin-bq2bq.yaml - ./plugins/optimus-plugin-echo.yaml secrets: - name: BQ_SERVICE_ACCOUNT diff --git a/docs/blog/2021-10-02-optimus-launch.md b/docs/blog/2021-10-02-optimus-launch.md index 59d210df72..7ed1d531dd 100644 --- a/docs/blog/2021-10-02-optimus-launch.md +++ b/docs/blog/2021-10-02-optimus-launch.md @@ -5,7 +5,7 @@ authors: name: Ravi Suhag title: Maintainer url: https://github.com/ravisuhag -tags: [odpf, optimus] +tags: [raystack, optimus] --- We are live! diff --git a/docs/docs/building-plugin/introduction.md b/docs/docs/building-plugin/introduction.md new file mode 100644 index 0000000000..cc43830049 --- /dev/null +++ b/docs/docs/building-plugin/introduction.md @@ -0,0 +1,99 @@ +# Introduction of Plugin Development + +As mentioned in the [concepts](../concepts/plugin.md), plugins provide support for various data warehouses & any +third party system to handle all the data transformations or movement. Before we start, let’s take a look at different +implementations of plugin: YAML and binary. + +## Yaml Implementation of Plugin +Most plugins are expected to implement just the info and project side use-cases (mentioned above) and these are +data-driven i.e., plugin just provide data to Optimus. To simplify the development process of plugins, support for +yaml mode of defining plugins is added. + +```go +// representation of a yaml plugin schema in golang + +// below struct definition in golang can be marshalled +// to generate yaml plugins + +type YamlPlugin struct { +// info use-case +Name string `yaml:"name"` +Description string `yaml:"description"` +Plugintype string `yaml:"plugintype"` +Pluginversion string `yaml:"pluginversion"` +Image string `yaml:"image"` + + // survey use-case + Questions []struct { + Name string `yaml:"name"` + Prompt string `yaml:"prompt"` + Help string `yaml:"help"` + Regexp string `yaml:"regexp"` + Validationerror string `yaml:"validationerror"` + Minlength int `yaml:"minlength"` + Required bool `yaml:"required,omitempty"` + Maxlength int `yaml:"maxlength,omitempty"` + Subquestions []struct { + Ifvalue string `yaml:"ifvalue"` + Questions []struct { + Name string `yaml:"name"` + Prompt string `yaml:"prompt"` + Help string `yaml:"help"` + Multiselect []string `yaml:"multiselect"` + Regexp string `yaml:"regexp"` + Validationerror string `yaml:"validationerror"` + Minlength int `yaml:"minlength"` + Required bool `yaml:"required,omitempty"` + Maxlength int `yaml:"maxlength,omitempty"` + } `yaml:"questions"` + } `yaml:"subquestions,omitempty"` + } `yaml:"questions"` + + // default-static-values use-case + Defaultassets []struct { + Name string `yaml:"name"` + Value string `yaml:"value"` + } `yaml:"defaultassets"` + Defaultconfig []struct { + Name string `yaml:"name"` + Value string `yaml:"value"` + } `yaml:"defaultconfig"` +} +``` + +Refer to sample implementation here. + + +### Limitations of Yaml plugins: +Here the scope of YAML plugins is limited to driving surveys, providing default values for job config and assets, and +providing plugin info. As the majority of the plugins are expected to implement a subset of these use cases, the +support for YAML definitions for plugins is added which simplifies the development, packaging, and distribution of plugins. + +For plugins that require enriching Optimus server-side behavior, YAML definitions fall short as this would require some code. + +### Validating Yaml plugins: +Also support for validating yaml plugin is added into optimus. After creating yaml definitions of plugin, one can +validate them as below: + +```shell +optimus plugin validate --path {{directory of yaml plugins}} +``` + +** Note: The yaml plugin is expected to have file name as optimus-plugin-{{name}}.yaml +** Note: If Both yaml and binary plugin with same name are installed, Yaml implementation is prioritized over the +corresponding counterparts in binary implementation. + +## Binary Implementation of Plugin (to be deprecated) +Binary implementations of Plugins are binaries which implement predefined protobuf interfaces to extend Optimus +functionalities and augment the yaml implementations with executable code. Binary Plugins are implemented using +go-plugin developed by Hashicorp used in terraform and other similar products. Currently, Dependency Resolution Mod +is the only interface that is supported in the binary approach to plugins. + +Note : Binary plugins augment yaml plugins and they are not standalone. + +Plugins can be implemented in any language as long as they can be exported as a single self-contained executable binary +and implements a GRPC server. It is recommended to use Go currently for writing plugins because of its cross platform +build functionality and to reuse protobuf sdk provided within Optimus core. + +_Binary Plugins can potentially modify the behavior of Optimus in undesired ways. Exercise caution when adding new +plugins developed by unrecognized developers._ diff --git a/docs/docs/building-plugin/tutorial.md b/docs/docs/building-plugin/tutorial.md new file mode 100644 index 0000000000..93486c775b --- /dev/null +++ b/docs/docs/building-plugin/tutorial.md @@ -0,0 +1,258 @@ +# Tutorial of Plugin Development +To demonstrate the previous-mentioned wrapping functionality, let's create a plugin in Go as well as a yaml definition +and use python for actual transformation logic. You can choose to fork this [example](https://github.com/kushsharma/optimus-plugins) +template and modify it as per your needs or start fresh. To demonstrate how to start from scratch, we will be starting +from an empty git repository and build a plugin which will find potential hazardous **Near Earth Orbit** objects every +day, let's call it **neo** for short. + +Brief description of Neo is as follows +- Using NASA [API](https://api.nasa.gov/) we can get count of hazardous objects, their diameter and velocity. +- Task will need two config as input, RANGE_START, RANGE_END as date time string which will filter the count for + this specific period only. +- Execute every day, say at 2 AM. +- Need a secret token that will be passed to NASA api endpoint for each request. +- Output of this object count can be printed in logs for now but in a real use case can be pushed to Kafka topic or + written to a database. +- Plugin will be written in **YAML** format and Neo in **python**. + +## Preparing task executor +Start by initialising an empty git repository with the following folder structure +``` +.git +/task + /neo + /executor + /main.py + /requirements.txt + /Dockerfile +README.md +``` + +That is three folders one inside another. This might look confusing for now, a lot of things will, but just keep going. +Create an empty python file in executor main.py, this is where the main logic for interacting with nasa api and +generating output will be. For simplicity, lets use as minimal things as possible. + +Add the following code to main.py + +```python +import os +import requests +import json + +def start(): + """ + Sends a http call to nasa api, parses response and prints potential hazardous + objects in near earth orbit + :return: + """ + opt_config = fetch_config_from_optimus() + + # user configuration for date range + range_start = opt_config["envs"]["RANGE_START"] + range_end = opt_config["envs"]["RANGE_END"] + + secret_key = os.environ["SECRET_KEY"] + + # secret token required for NASA API being passed using job spec + api_key = json.loads(secret_key) + if api_key is None: + raise Exception("invalid api token") + + # send the request for given date range + r = requests.get(url="https://api.nasa.gov/neo/rest/v1/feed", + params={'start_date': range_start, 'end_date': range_end, 'api_key': api_key}) + + # extracting data in json format + print("for date range {} - {}".format(range_start, range_end)) + print_details(r.json()) + + return + + +def fetch_config_from_optimus(): + """ + Fetch configuration inputs required to run this task for a single schedule day + Configurations are fetched using optimus rest api + :return: + """ + # try printing os env to see what all we have for debugging + # print(os.environ) + + # prepare request + optimus_host = os.environ["OPTIMUS_HOSTNAME"] + scheduled_at = os.environ["SCHEDULED_AT"] + project_name = os.environ["PROJECT"] + job_name = os.environ["JOB_NAME"] + + r = requests.post(url="http://{}/api/v1/project/{}/job/{}/instance".format(optimus_host, project_name, job_name), + json={'scheduled_at': scheduled_at, + 'instance_name': "neo", + 'instance_type': "TASK"}) + instance = r.json() + + # print(instance) + return instance["context"] + + + +if __name__ == "__main__": + start() + +``` + +**api_key** is a token provided by nasa during registration. This token will be passed as a parameter in each http call. +**SECRET_PATH** is the path to a file which will contain this token in json and will be mounted inside the docker +container by Optimus. + +**start** function is using **fetch_config_from_optimus()** to get the date range for which this task executes for +an iteration. In this example, configuration is fetched using REST APIs provided by optimus although there are variety +of ways to get them. After extracting **API_KEY** from secret file, unmarshalling it to json with **json.load()** +send a http request to nasa api. Response can be parsed and printed using the following function: + +```python +def print_details(jd): + """ + Parse and calculate what we need from NASA endpoint response + + :param jd: json data fetched from NASA API + :return: + """ + element_count = jd['element_count'] + potentially_hazardous = [] + for search_date in jd['near_earth_objects'].keys(): + for neo in jd['near_earth_objects'][search_date]: + if neo["is_potentially_hazardous_asteroid"] is True: + potentially_hazardous.append({ + "name": neo["name"], + "estimated_diameter_km": neo["estimated_diameter"]["kilometers"]["estimated_diameter_max"], + "relative_velocity_kmh": neo["close_approach_data"][0]["relative_velocity"]["kilometers_per_hour"] + }) + + print("total tracking: {}\npotential hazardous: {}".format(element_count, len(potentially_hazardous))) + for haz in potentially_hazardous: + print("Name: {}\nEstimated Diameter: {} km\nRelative Velocity: {} km/h\n\n".format( + haz["name"], + haz["estimated_diameter_km"], + haz["relative_velocity_kmh"] + )) + return + +``` + +Finish it off by adding the main function + +```python +if __name__ == "__main__": +start() +``` + +Add requests library in requirements.txt +``` +requests==v2.25.1 +``` + +Once the python code is ready, wrap this in a Dockerfile + +```dockerfile +# set base image (host OS) +FROM python:3.8 + +# set the working directory in the container +RUN mkdir -p /opt +WORKDIR /opt + +# copy the content of the local src directory to the working directory +COPY task/neo/executor . + +# install dependencies +RUN pip install -r requirements.txt + +CMD ["python3", "main.py"] + +``` + + +## Creating a yaml plugin +The Yaml implementation is as simple as providing the plugin details as below. + +```yaml +name: Neo +description: Near earth object tracker +plugintype: task +pluginversion: latest +image: ghcr.io/kushsharma/optimus-task-neo-executor +secretpath: /tmp/.secrets + +questions: +- name: RANGE_START + prompt: Date range start + help: YYYY-MM-DD format + required: true +- name: RANGE_END + prompt: Date range end + help: YYYY-MM-DD format + required: true +``` + +Based on the usecase, additional validation can be added to the questions section. + +This yaml plugin can be placed anywhere, however for this tutorial let’s place it under `../task/neo` directory and +name it as `optimus-plugin-neo.yaml`. + +Note: As part of this tutorial, we are not providing binary plugin tutorial as it is going to be deprecated. + +## How to Use + +Before using, let’s install this new plugin in server and client. + +### Installing the plugin in server +To use the created plugin in your server, you can simpy add the plugin path in the server config: + +```yaml +plugin: + artifacts: + - ../task/neo/optimus-plugin-neo.yaml +``` + +To apply the change, you can follow either of these options: +- Start Optimus server using `--install-plugins` flag, or +- Install the plugin separately before starting the server using `optimus plugin install` command. + +_Note: Take a look at installing plugins in server [guide](../server-guide/installing-plugins.md) for more information._ + +### Installing the plugin in client +Install the plugin in client side by syncing it from server using below command. +```shell +$ optimus plugin sync +```` + +Once finished, the `Neo` plugin will be available in the `.plugins` directory. + +### Use the plugin in job creation + +Once everything is built and in place, we can generate job specifications that uses neo as the task type. + +```shell +optimus create job +? What is the job name? is_last_day_on_earth +? Who is the owner of this job? owner@example.io +? Which task to run? neo +? Specify the start date 2022-01-25 +? Specify the interval (in crontab notation) 0 2 * * * +? Transformation window daily +? Date range start {{.DSTART}} +? Date range end {{.DEND}} +job created successfully is_last_day_on_earth +``` + +Create a commit and deploy this specification if you are using optimus with a git managed repositories or send +a REST call or use GRPC, whatever floats your boat. + +Once the job has been deployed and run, open the task log and verify something like this +``` +total tracking: 14 +potential hazardous: 1 +Name: (2014 KP4) +Estimated Diameter: 0.8204270649 km +Relative Velocity: 147052.9914506647 km/h +``` diff --git a/docs/docs/client-guide/applying-job-specifications.md b/docs/docs/client-guide/applying-job-specifications.md new file mode 100644 index 0000000000..3541a1a93a --- /dev/null +++ b/docs/docs/client-guide/applying-job-specifications.md @@ -0,0 +1,43 @@ +# Applying Job Specifications +Once you have the job specifications ready, let’s try to deploy the jobs to the server by running this command: + +```shell +$ optimus job replace-all --verbose +``` +Note: add --config flag if you are not in the same directory with your client configuration (optimus.yaml). + +This replace-all command works per project or namespace level and will try to compare the incoming jobs and the jobs +in the server. You will find in the logs how many jobs are new, modified, and deleted based on the current condition. + +```shell +$ optimus job replace-all --verbose + +> Validating namespaces +validation finished! + +> Replacing all jobs for namespaces [sample_namespace] +> Receiving responses: +[sample_namespace] received 1 job specs +[sample_namespace] found 1 new, 0 modified, and 0 deleted job specs +[sample_namespace] processing job job1 +[sample_namespace] successfully added 1 jobs +replace all job specifications finished! +``` + + +You might notice based on the log that Optimus tries to find which jobs are new, modified, or deleted. This is because +Optimus will not try to process every job in every single `replace-all` command for performance reasons. If you have +needs to refresh all of the jobs in the project from the server, regardless it has changed or not, do run the below command: + +```shell +$ optimus job refresh --verbose +``` + +This refresh command is not taking any specifications as a request. It will only refresh the jobs in the server. + +Also, do notice that these **replace-all** and **refresh** commands are only for registering the job specifications in the server, +including resolving the dependencies. After this, you can compile and upload the jobs to the scheduler using the +`scheduler upload-all` [command](uploading-jobs-to-scheduler.md). + +Note: Currently Optimus does not provide a way to deploy only a single job through CLI. This capability is being +supported in the API. diff --git a/docs/docs/client-guide/backup-bigquery-resource.md b/docs/docs/client-guide/backup-bigquery-resource.md new file mode 100644 index 0000000000..4f02fe5781 --- /dev/null +++ b/docs/docs/client-guide/backup-bigquery-resource.md @@ -0,0 +1,43 @@ +# Backup BigQuery Resource + +Backup is a common prerequisite step to be done before re-running or modifying a resource. Currently, Optimus supports +backup for BigQuery tables and provides dependency resolution, so backup can be also done to all the downstream tables +as long as it is registered in Optimus and within the same project. + +## Configuring backup details +Several configurations can be set to have the backup result in your project as your preference. Here are the available +configurations for BigQuery datastore. + +| Configuration Key | Description | Default | +|-------------------|------------------------------------------|-----------------| +| ttl | Time to live in duration | 720h | +| prefix | Prefix of the result table name | backup | +| dataset | Where the table result should be located | optimus_backup | + +_Note: these values can be set in the project configuration._ + +## Run a backup +To start a backup, run the following command: +```shell +$ optimus backup create --resource "resource_name" --project sample-project --namespace sample-namespace +``` + + +After you run the command, prompts will be shown. You will need to answer the questions. +```shell +$ optimus backup create --resource "resource_name" --project sample-project --namespace sample-namespace +? Select supported datastore? bigquery +? Why is this backup needed? backfill due to business logic change +``` + +Once the backup is finished, the backup results along with where it is located will be shown. + +## Get the list of backups +List of recent backups of a project can be checked using this subcommand: +```shell +$ optimus backup list --project sample-project +``` + +Recent backup ID including the resource, when it was created, what is the description or purpose of the backup will +be shown. The backup ID is used as a postfix in the backup result name, thus you can find those results in the datastore +(for example BigQuery) using the backup ID. However, keep in mind that these backup results have an expiry time set. diff --git a/docs/docs/client-guide/configuration.md b/docs/docs/client-guide/configuration.md new file mode 100644 index 0000000000..951625548f --- /dev/null +++ b/docs/docs/client-guide/configuration.md @@ -0,0 +1,73 @@ +# Configuration +Client configuration holds the necessary information for connecting to the Optimus server as well as for specification +creation. Optimus provides a way for you to initialize the client configuration by using the `init` command. Go to the +directory where you want to have your Optimus specifications. Run the below command and answer the prompt questions: + +```shell +$ optimus init + +? What is the Optimus service host? localhost:9100 +? What is the Optimus project name? sample_project +? What is the namespace name? sample_namespace +? What is the type of data store for this namespace? bigquery +? Do you want to add another namespace? No +Client config is initialized successfully +``` + + +After running the init command, the Optimus client config will be configured. Along with it, the directories for the +chosen namespaces, including the sub-directories for jobs and resources will be created with the following structure: +``` +sample_project +├── sample_namespace +│ └── jobs +│ └── resources +└── optimus.yaml +``` + +Below is the client configuration that has been generated: +```yaml +version: 1 +log: + level: INFO + format: "" +host: localhost:9100 +project: + name: sample_project + config: {} +namespaces: +- name: sample_namespace + config: {} + job: + path: sample_namespace/jobs + datastore: + - type: bigquery + path: sample_namespace/resources + backup: {} +``` + + +| Configuration | Description | +|----------------|-------------------------------------------------| +| Version | Supports only version 1 at the moment. | +| Log | Logging level & format configuration | +| Host | Optimus server host | +| Project | Chosen Optimus project name and configurations. | +| Namespaces | Namespaces that are owned by the project. | + +## Project +- Project name should be unique. +- Several configs are mandatory for job compilation and deployment use case: + - **storage_path** config to store the job compilation result. A path can be anything, for example, a local directory + path or a Google Cloud Storage path. + - **scheduler_host** being used for job execution and sensors. + - Specific secrets might be needed for the above configs. Take a look at the detail [here](managing-secrets.md). +- You can put any other project configurations which can be used in job specifications. + +## Namespaces +- Name should be unique in the project. +- You can put any namespace configurations which can be used in specifications. +- Job path needs to be properly set so Optimus CLI will able to find all of your job specifications to be processed. +- For datastore, currently Optimus only accepts `bigquery` datastore type and you need to set the specification path + for this. Also, there is an optional `backup` config map. Take a look at the backup guide section [here](backup-bigquery-resource.md) + to understand more about this. diff --git a/docs/docs/client-guide/create-job-specifications.md b/docs/docs/client-guide/create-job-specifications.md new file mode 100644 index 0000000000..6000dd997a --- /dev/null +++ b/docs/docs/client-guide/create-job-specifications.md @@ -0,0 +1,242 @@ +# Create Job Specifications + +A Job is the fundamental execution unit of an Optimus data pipeline. It can be scheduled, configured and is always +mapped to a single transformation type (eg, BQ-to-BQ, GCS-to-BQ, etc). It can have dependencies over other jobs and +should only execute once the dependent job is successfully completed. + +A job can also be configured with Hooks as part of its lifecycle, which can be triggered before or after the job. +Please go through the [concept](../concepts/job.md) to know more about it. + +Before we begin, let’s understand the flow of job creation & deployment (later) in Optimus. + +![Create Job Flow](/img/docs/CreateJobSpecFlow.png "CreateJobSpecFlow") + +For this guide, we'll be creating a job that writes "hello YYYY-MM-DD" to a table every day at 03.00 AM. We'll use the +BQ-to-BQ transformation type. For the purpose of this guide, we'll assume that the Google Cloud Project name is +"sample-project" & dataset is just called "playground". + +## Initialize Job Specification + +Open your terminal and create a new directory that will hold the specifications created by Optimus CLI. Once ready, +you can run the following command and answer the corresponding prompts (do note that some prompts would be to select +from options instead of input): + +```shell +$ optimus job create +? Please choose the namespace: sample_namespace +? Provide new directory name to create for this spec? [.] sample-project.playground.table1 +? What is the job name? sample-project.playground.table1 +? Who is the owner of this job? sample_owner +? Select task to run? bq2bq +? Specify the schedule start date 2023-01-26 +? Specify the schedule interval (in crontab notation) 0 2 * * * +? Transformation window daily +? Project ID sample-project +? Dataset Name playground +? Table ID table1 +? Load method to use on destination REPLACE +Job successfully created at sample-project.playground.table1 +``` + +After running the job create command, the job specification file and assets directory are created in the following directory. + +``` +├── sample_namespace +│ └── jobs +| └── sample-project.playground.table1 +| └── assets +| └── query.sql +| └── job.yaml +│ └── resources +└── optimus.yaml +``` + +Do notice that query.sql file is also generated. This is because, for BQ to BQ job, transformation logic lies in the +query.sql file. We will update this file based on the requirement later. + +For now, let’s take a deeper look at the job.yaml that Optimus has generated and understands what it does. After +taking a look at the possible configurations, we will try to complete the transformation task and take a look at how +to add a hook. + +```yaml +version: 1 +name: sample-project.playground.table1 +owner: sample_owner +schedule: + start_date: "2023-01-26" + interval: 0 2 * * * +behavior: + depends_on_past: false +task: + name: bq2bq + config: + DATASET: playground + LOAD_METHOD: REPLACE + PROJECT: sample-project + SQL_TYPE: STANDARD + TABLE: table1 +window: + size: 24h + offset: "0" + truncate_to: d +labels: + orchestrator: optimus +hooks: [] +dependencies: [] +``` + +## Understanding the Job Specifications + +| Job Configuration | Description | +| ----------------- | -------------------------------------------------------------------------------------------------------- | +| Version | Version 1 and 2 (recommended) are available. This affects the windowing capability. | +| Name | Should be unique in the project. | +| Owner | Owner of the job, can be an email, team name, slack handle, or anything that works for your team. | +| Schedule | Specifications needed to schedule a job, such as start_date, end_date and interval (cron) | +| Behavior | Specifications that represents how the scheduled jobs should behave, for example when the run is failed. | +| Task | Specifications related to the transformation task | +| Hooks | Name & configuration of pre/post hooks. Take a look at how to add hooks [here](#adding-hook). | +| Labels | Help you to identify your job. Any of the values will also be marked as a tag in Airflow. | +| Dependencies | Represent the list of jobs that are considered upstream. | +| Metadata | Represents additional resource and scheduler configurations. | + +### Behavior + +Behavior specification might consist: + +- depends_on_past: set to true to not allow the task to run, if the previous task run has not been succeeded yet +- retry + - count: represents how many times it will try to retrigger the job if the job failed to run + - delay + - exponential_backoff +- notify: Alert configurations. Take a look more at this [here](setting-up-alert.md). + +### Task + +Task specification might consist: + +- name +- config: Some configs might be needed for a specific task type. For example, for BQ to BQ task, it is required to have + BQ_SERVICE_ACCOUNT, PROJECT, DATASET, TABLE, SQL_TYPE, LOAD_METHOD configs. Take a look at the details of what is load method here. +- window: Take a look at the details of the window [here](../concepts/intervals-and-windows.md). + +### Dependencies + +Represent the list of jobs that are considered upstream. + +- If the job is in a different project, include the Optimus’ project name in the prefix. +- If the job is in the same project, simply mentioning the job name is sufficient. + +Example: + +```yaml +dependencies: + - job: sample-project.playground.table1 + - job: other-project/other-project.playground.table2 +``` + +### Metadata + +Below specifications can be set in Metadata section: + +- **resource**: set up CPU/memory request/limit +- **airflow**: set up which Airflow pool and what is the queue configuration for this job + +## Completing the Transformation Task + +Let’s retake a look at the generated task specifications + +```yaml +task: + name: bq2bq + config: + DATASET: playground + LOAD_METHOD: REPLACE + PROJECT: sample-project + SQL_TYPE: STANDARD + TABLE: table1 +window: + size: 24h + offset: "0" + truncate_to: d +``` + +Here are the details of each configuration and the allowed values: + +| Config Name | Description | Values | +| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| PROJECT | GCP project ID of the destination BigQuery table | | +| DATASET | BigQuery dataset name of the destination table | | +| TABLE | the table name of the destination table | | +| LOAD_METHOD | method to load data to the destination tables | Take a detailed look [here](https://github.com/raystack/transformers/blob/main/task/bq2bq/README.md) | +| PARTITION_FILTER | Used to identify target partitions to replace in a REPLACE query. This can be left empty and Optimus will figure out the target partitions automatically but it's cheaper and faster to specify the condition. This filter will be used as a where clause in a merge statement to delete the partitions from the destination table. | event_timestamp >= "{{.DSTART}}" AND event_timestamp < "{{.DEND}}" | + +Now let's try to modify the core transformation logic that lies in `assets/query.sql`. Remember that we are going to +create a job that writes "hello YYYY-MM-DD" to a table every day at 03.00 AM. Now, let’s modify the query so it prints +what we intended: + +```sql +SELECT CONCAT("Hello, ", "{{.DEND}}") AS message; +``` + +{{.DEND}} is a macro that is replaced with the current execution date (in YYYY-MM-DD format) of the task ( +note that this is the execution date of when the task was supposed to run, not when it actually runs). Take a detailed +look at the supported macros [here](../concepts/macros.md). + +Do notice that the query is not sourcing from any other table. This means the job we are creating will not have any +[dependency](../concepts/dependency.md) unless we manually specify so in the job specification YAML file. +However, if for any reason you are querying from another resource and want to ignore the dependency, add +`@ignoreupstream` annotation just before the table name, for example: + +```sql +SELECT column1, column2, column3 +FROM `sample-project.playground.source1` s1 +LEFT JOIN /* @ignoreupstream */ +`sample-project.playground.source2` s2 +ON (s1.id = s2.s1_id) +WHERE +DATE(`load_timestamp`) >= DATE('{{.DSTART}}') +AND DATE(`load_timestamp`) < DATE('{{.DEND}}'); +``` + +### Adding Hook + +There might be a certain operation that you might want to run before or after the Job. Please go through the +[concept](../concepts/job.md) to know more about it. + +For this guide, let’s add a post hook that will audit our BigQuery data using [Predator](https://github.com/raystack/predator). +You can find the Predator plugin YAML file [here](https://github.com/raystack/predator/blob/main/optimus-plugin-predator.yaml) +and have the plugin installed in your [server](../server-guide/installing-plugins.md) and [client](installing-plugin.md). + +In order to add a hook to an existing Job, run the following command and answer the corresponding prompts: + +```shell +$ optimus job addhook +? Please choose the namespace: sample_namespace +? Select a Job sample-project.playground.table1 +? Filter expression for extracting transformation rows? __PARTITION__ >= date("{{ .DSTART | Date }}") AND __PARTITION__ < date("{{ .DEND | Date }}") +? Specify the profile/audit result grouping field (empty to not group the result) +? Choose the profiling mode complete + +Hook successfully added to sample-project.playground.table1 +``` + +With the above prompt, we're adding the predator hook post the execution of the primary job. Filter expression +configuration and the rest of the questions are specific to a predator hook, and it might be different for other hooks. + +After this, existing job.yaml file will get updated with the new hook config. + +```yaml +hooks: + - name: predator + config: + AUDIT_TIME: "{{.EXECUTION_TIME}}" + BQ_DATASET: "{{.TASK__DATASET}}" + BQ_PROJECT: "{{.TASK__PROJECT}}" + BQ_TABLE: "{{.TASK__TABLE}}" + FILTER: __PARTITION__ >= date("{{ .DSTART | Date }}") AND __PARTITION__ < date("{{ .DEND | Date }}") + GROUP: "" + MODE: complete + PREDATOR_URL: "{{.GLOBAL__PREDATOR_HOST}}" + SUB_COMMAND: profile_audit +``` diff --git a/docs/docs/client-guide/installing-plugin.md b/docs/docs/client-guide/installing-plugin.md new file mode 100644 index 0000000000..9999fa2986 --- /dev/null +++ b/docs/docs/client-guide/installing-plugin.md @@ -0,0 +1,10 @@ +# Installing Plugin in Client +Creating job specifications requires a plugin to be installed in the system caller. To simplify the installation, +Optimus CLI can sync the YAML plugins supported and served by the Optimus server (with host as declared in project +config) using the following command: + +```shell +$ optimus plugin sync -c optimus.yaml +``` + +Note: This will install plugins in the `.plugins` folder. diff --git a/docs/docs/client-guide/manage-bigquery-resource.md b/docs/docs/client-guide/manage-bigquery-resource.md new file mode 100644 index 0000000000..2acd9b6a5b --- /dev/null +++ b/docs/docs/client-guide/manage-bigquery-resource.md @@ -0,0 +1,112 @@ +# Manage BigQuery Resource + +Below is the list of the resource types that Optimus supported: + +| Type | Description | +|----------------|--------------------------------------------------------------------------------------------------------------------| +| dataset | Resource name format: [project].[dataset]
Spec can includes: table_expiration, description | +| table | Resource name format: [project].[dataset].[table]
Spec can includes: schema, partition, cluster, description | +| view | Resource name format: [project].[dataset].[view]
Spec can includes: view_query, description | +| external_table | Resource name format: [project].[dataset].[table]
Spec can include: schema, source, description | + +You can create any of the above jobs using the same following format: +```shell +$ optimus resource create +``` + +Make sure to put the correct resource type as you are intended. Once you fill in the command prompt questions, Optimus will create a file (resource.yaml) in the configured datastore directory. Below is an example of each of the type’s resource specifications. + +## Dataset +```yaml +version: 1 +name: sample-project.playground +type: dataset +labels: + usage: documentation + owner: optimus +spec: + description: "example description" + table_expiration: 24 # in hours +``` + +## Table +```yaml +version: 1 +name: sample-project.playground.sample_table +type: table +labels: + usage: documentation + owner: optimus +spec: + description: "example description" + schema: + - name: column1 + type: INTEGER + - name: column2 + type: TIMESTAMP + description: "example field 2" + mode: required # (repeated/required/nullable), default: nullable + - name: column3 + type: STRUCT + schema: # nested struct schema + - name: column_a_1 + type: STRING + cluster: + using: [column1] + partition: # leave empty as {} to partition by ingestion time + field: column2 # column name + type: day # day/hour, default: day +``` + + + +## View +```yaml +version: 1 +name: sample-project.playground.sample_view +type: view +labels: + usage: documentation + owner: optimus +spec: + description: "example description" + view_query: | + Select * from sample-project.playground.sample_table +``` + + +## External Table +```yaml +version: 1 +name: sample-project.playground.sample_table +type: external_table +labels: + usage: documentation + owner: optimus +spec: + description: "example description" + schema: + - name: column1 + type: INTEGER + - name: column2 + type: TIMESTAMP + description: "example field 2" + source: + type: google_sheets + uris: + - https://docs.google.com/spreadsheets/d/spreadsheet_id + config: + range: Sheet1!A1:B4 # Range of data to be ingested in the format of [Sheet Name]![Cell Range] + skip_leading_rows: 1 # Row of records to skip +``` + +## Upload Resource Specifications +Once the resource specifications are ready, you can upload all resource specifications using the below command: +```shell +$ optimus resource upload-all --verbose +``` + + +The above command will try to compare the incoming resources to the existing resources in the server. It will create +a new resource if it does not exist yet, and modify it if exists, but will not delete any resources. Optimus does not +support BigQuery resource deletion nor the resource record in the Optimus server itself yet. diff --git a/docs/docs/client-guide/managing-project-namespace.md b/docs/docs/client-guide/managing-project-namespace.md new file mode 100644 index 0000000000..28eda7e612 --- /dev/null +++ b/docs/docs/client-guide/managing-project-namespace.md @@ -0,0 +1,16 @@ +# Managing Project & Namespace + +Optimus provides a command to register a new project specified in the client configuration or update if it exists: +```shell +$ optimus project register +``` + +You are also allowed to register the namespace by using the with-namespaces flag: +```shell +$ optimus project register --with-namespaces +``` + +You can also check the project configuration that has been registered in your server using: +```shell +$ optimus project describe +``` diff --git a/docs/docs/client-guide/managing-secrets.md b/docs/docs/client-guide/managing-secrets.md new file mode 100644 index 0000000000..cd6db1be35 --- /dev/null +++ b/docs/docs/client-guide/managing-secrets.md @@ -0,0 +1,60 @@ +# Managing Secrets +During job execution, specific credentials are needed to access required resources, for example, BigQuery credential +for BQ to BQ tasks. Users are able to register secrets on their own, manage them, and use them in tasks and hooks. +Please go through [concepts](../concepts/secret.md) to know more about secrets. + +Before we begin, let’s take a look at several mandatory secrets that is used for specific use cases in Optimus. + +| Secret Name | Description | +|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| STORAGE | To store compiled jobs if needed. | +| SCHEDULER_AUTH | Scheduler credentials. For now, since Optimus only supports Airflow, this will be Airflow [username:password] | +| BQ_SERVICE_ACCOUNT | Used for any operations involving BigQuery, such as job validation, deployment, run for jobs with BQ to BQ transformation task, as well as for managing BigQuery resources through Optimus. | + + +## Registering secret +Register a secret by running the following command: +```shell +$ optimus secret set someSecret someSecretValue +``` + +By default, Optimus will encode the secret value. However, to register a secret that has been encoded, run the following +command instead: +```shell +$ optimus secret set someSecret encodedSecretValue --base64 +``` + +There is also a flexibility to register using an existing secret file, instead of providing the secret value in the command. +```shell +$ optimus secret set someSecret --file=/path/to/secret +``` + +Secret can also be set to a specific namespace which can only be used by the jobs/resources in the namespace. +To register, run the following command: +```shell +$ optimus secret set someSecret someSecretValue --namespace someNamespace +```` + +Please note that registering a secret that already exists will result in an error. Modifying an existing secret +can be done using the Update command. + +## Updating a secret +The update-only flag is generally used when you explicitly only want to update a secret that already exists and doesn't want to create it by mistake. +```shell +$ optimus secret set someSecret someSecretValue --update-only +``` + +It will return an error if the secret to update does not exist already. + + +## Listing secrets +The list command can be used to show the user-defined secrets which are registered with Optimus. It will list the namespace associated with a secret. +```shell +$ optimus secret list +Secrets for project: optimus-local +NAME | DIGEST | NAMESPACE | DATE +-------------+----------------------------------------------+-----------+---------------------- +secret1 | SIBzsgUuHnExBY4qSzqcrlrb+3zCAHGu/4Fv1O8eMI8= | * | 2022-04-12T04:30:45Z +``` + +It shows a digest for the encrypted secret, so as not to send the cleartext password on the network. diff --git a/docs/docs/client-guide/organizing-specifications.md b/docs/docs/client-guide/organizing-specifications.md new file mode 100644 index 0000000000..d954b1a0b7 --- /dev/null +++ b/docs/docs/client-guide/organizing-specifications.md @@ -0,0 +1,98 @@ +# Organizing Specifications +Optimus supports two ways to deploy specifications +- REST/GRPC +- Optimus CLI deploy command + +When using Optimus CLI to deploy, either manually or from a CI pipeline, it is advised to use a version control system +like git. Here is a simple directory structure that can be used as a template for jobs and datastore resources, +assuming there are 2 namespaces in a project. + +``` +. +├── optimus.yaml +├── README.md +├── namespace-1 +│ ├── jobs +| │ ├── job1 +| │ ├── job2 +| │ └── this.yaml +│ └── resources +| ├── bigquery +│ │ ├── table1 +│ │ ├── table2 +| | └── this.yaml +│ └── postgres +│ └── table1 +└── namespace-2 +└── jobs +└── resources +``` + + +You might have also noticed there are `this.yaml` files being used in some directories. This file is used to share a +single set of configurations across multiple sub-directories. For example, if you create a file at +/namespace-1/jobs/this.yaml, then all subdirectories inside /namespaces-1/jobs will inherit this config as defaults. +If the same config is specified in subdirectory, then subdirectory will override the parent defaults. + +For example a this.yaml in `/namespace-1/jobs` +```yaml +version: 1 +schedule: + interval: @daily +task: + name: bq2bq + config: + BQ_SERVICE_ACCOUNT: "{{.secret.BQ_SERVICE_ACCOUNT}}" +behavior: + depends_on_past: false + retry: + count: 1 + delay: 5s +``` + +and a job.yaml in `/namespace-1/jobs/job1` +```yaml +name: sample_replace +owner: optimus@example.io +schedule: + start_date: "2020-09-25" + interval: 0 10 * * * +behavior: + depends_on_past: true +task: + name: bq2bq + config: + project: project_name + dataset: project_dataset + table: sample_replace + load_method: REPLACE +window: + size: 48h + offset: 24h +``` + +will result in final computed job.yaml during deployment as +```yaml +version: 1 +name: sample_replace +owner: optimus@example.io +schedule: + start_date: "2020-10-06" + interval: 0 10 * * * +behavior: + depends_on_past: true + retry: + count: 1 + delay: 5s +task: + name: bq2bq + config: + project: project_name + dataset: project_dataset + table: sample_replace + load_method: REPLACE + BQ_SERVICE_ACCOUNT: "{{.secret.BQ_SERVICE_ACCOUNT}}" +window: + size: 48h + offset: 24h +``` diff --git a/docs/docs/client-guide/replay-a-job.md b/docs/docs/client-guide/replay-a-job.md new file mode 100644 index 0000000000..11f814ab16 --- /dev/null +++ b/docs/docs/client-guide/replay-a-job.md @@ -0,0 +1,37 @@ +# Replay a Job (Backfill) +Some old dates of a job might need to be re-run (backfill) due to business requirement changes, corrupt data, or other +various reasons. Optimus provides a way to do this using Replay. Please go through [concepts](../concepts/replay-and-backup.md) to know more about it. + +## Run a replay +To run a replay, run the following command: +```shell +$ optimus replay create {job_name} {start_time} {end_time} [flags] +``` + +Example: +```shell +$ optimus replay create sample-job 2023-03-01T00:00:00Z 2023-03-02T15:00:00Z --parallel --project sample-project --namespace-name sample-namespace +``` + +Replay accepts three arguments, first is the DAG name that is used in Optimus specification, second is the scheduled +start time of replay, and third is the scheduled end time (optional) of replay. + +Once your request has been successfully replayed, this means that Replay has cleared the requested runs in the scheduler. +Please wait until the scheduler finishes scheduling and running those tasks. + +## Get a replay status +You can check the replay status using the replay ID given previously and use in this command: +```shell +$ optimus replay status {replay_id} [flag] +``` + +You will see the latest replay status including the status of each run of your replay. + +## Get list of replays +List of recent replay of a project can be checked using this sub command: +```shell +$ optimus replay list [flag] +``` + +Recent replay ID including the job, time window, replay time, and status will be shown. To check the detailed status +of a replay, please use the status sub command. diff --git a/docs/docs/client-guide/setting-up-alert.md b/docs/docs/client-guide/setting-up-alert.md new file mode 100644 index 0000000000..86c57d9cac --- /dev/null +++ b/docs/docs/client-guide/setting-up-alert.md @@ -0,0 +1,35 @@ +# Setting up Alert to Job + +There are chances that your job is failing due to some reason or missed the SLA. For these cases, you might want to set +the alerts and get notified as soon as possible. + +## Supported Events + +| Event Type | Description | +|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| failure | Triggered when job run status is failed. | +| sla_miss | Triggered when the job run does not complete within the duration that you expected. Duration should be specified in the config and should be in string duration. | + + +## Supported Channels + +| Channel | Description | +|-----------|---------------------------------------------------------------------------------------------| +| Slack | Channel/team handle or specific user | +| Pagerduty | Needing `notify_` secret with pagerduty integration key/routing key | + + +## Sample Configuration + +```yaml +behavior: +notify: +- 'on': failure/sla_miss + config : + duration : 2h45m + channels: + - slack://#slack-channel or @team-group or user&gmail.com + - pagerduty://#pagerduty_service_name +``` + + diff --git a/docs/docs/client-guide/uploading-jobs-to-scheduler.md b/docs/docs/client-guide/uploading-jobs-to-scheduler.md new file mode 100644 index 0000000000..9c031319c5 --- /dev/null +++ b/docs/docs/client-guide/uploading-jobs-to-scheduler.md @@ -0,0 +1,13 @@ +# Uploading Job to Scheduler + +Compile and upload all jobs in the project by using this command: +```shell +$ optimus scheduler upload-all +``` +_Note: add --config flag if you are not in the same directory with your client configuration (optimus.yaml)._ + +This command will compile all of the jobs in the project to Airflow DAG files and will store the result to the path +that has been set as `STORAGE_PATH` in the project configuration. Do note that `STORAGE` secret might be needed if +the storage requires a credential. + +Once you have the DAG files in the storage, you can sync the files to Airflow as you’d like. diff --git a/docs/docs/client-guide/verifying-jobs.md b/docs/docs/client-guide/verifying-jobs.md new file mode 100644 index 0000000000..7b020cf55e --- /dev/null +++ b/docs/docs/client-guide/verifying-jobs.md @@ -0,0 +1,41 @@ +# Verifying the Jobs +Minimize the chances of having the job failed in runtime by validating and inspecting it before deployment. + +## Validate Jobs +Job validation is being done per namespace. Try it out by running this command: + +```shell +$ optimus job validate --namespace sample_namespace --verbose +``` + + +Make sure you are running the above command in the same directory as where your client configuration (optimus.yaml) +is located. Or if not, you can provide the command by adding a config flag. + +By running the above command, Optimus CLI will try to fetch all of the jobs under sample_namespace’s job path that +has been specified in the client configuration. The verbose flag will be helpful to print out the jobs being processed. +Any jobs that have missing mandatory configuration, contain an invalid query, or cause cyclic dependency will be pointed out. + +## Inspect Job +You can try to inspect a single job, for example checking what are the upstream/dependencies, does it has any downstream, +or whether it has any warnings. This inspect command can be done against a job that has been registered or not registered +to your Optimus server. + +To inspect a job in your local: +```shell +$ optimus job inspect +``` + + +To inspect a job in the server: +```shell +$ optimus job inspect --server +``` + +You will find mainly 3 sections for inspection: +- **Basic Info**: + Optimus will print the job’s specification, including the resource destination & sources (if any), and whether it has any soft warning. +- **Upstreams**: + Will prints what are the jobs that this job depends on. Do notice there might be internal upstreams, external (cross-server) upstreams, HTTP upstreams, and unknown upstreams (not registered in Optimus). +- **Downstreams**: + Will prints what are the jobs that depends on this job. diff --git a/docs/docs/client-guide/work-with-extension.md b/docs/docs/client-guide/work-with-extension.md new file mode 100644 index 0000000000..df28832506 --- /dev/null +++ b/docs/docs/client-guide/work-with-extension.md @@ -0,0 +1,178 @@ +# Work with Extension +Extension helps you to include third-party or arbitrary implementation as part of Optimus. Currently, the extension is +designed for when the user is running it as CLI. + +## Warning +Extension is basically an executable file outside Optimus. *We do not guarantee whether an extension is safe or not*. +We suggest checking the extension itself, whether it is safe to run in your local or not, before installing and running it. + +## Limitation +Extension is designed to be similar to [GitHub extension](https://cli.github.com/manual/gh_extension). However, since +it's still in the early stage, some limitations are there. +- extension is only an executable file +- installation only looks at the GitHub asset according to the running system OS and Architecture +- convention for extension: + - extension repository should follow optimus-extension-[name of extension] (example: [optimus-extension-valor](https://github.com/gojek/optimus-extension-valor)) + - asset being considered is binary with suffix ...[OS]-[ARC] (example: when installing valor, if the user's OS is + - Linux and the architecture is AMD64, then installation will consider valor_linux-amd64 as binary to be executed) + +## Creating +Extension is designed to be open. Anyone could create their own extension. And as long as it is available, +anyone could install it. In order to create it, the following are the basic steps to do: + +- Decide the name of the extension, example: *valor* +- Create a GitHub repository that follows the convention, example: *optimus-extension-valor* +- Put some implementation and asset with the name based on the convention, example: *valor_linux-amd64, valor_darwin-amd64*, and more. +- Ensure it is available for anyone to download + +## Commands +Optimus supports some commands to help operate on extension. + +### Installation +You can run the installation using Optimus sub-command install under the extension. In order to install an extension, run the following command: +```shell +$ optimus extension install REMOTE [flags] +``` + +You can use the *--alias* flag to change the command name, since by default, Optimus will try to figure it out by itself. +Although, during this process, sometimes an extension name conflicts with the reserved commands. This flag helps to +resolve that. But, do note that this flag cannot be used to rename an *installed* extension. To do such a thing, check rename. + +REMOTE is the Github remote path where to look for the extension. REMOTE can be in the form of +- OWNER/PROJECT +- github.com/OWNER/PROJECT +- https://www.github.com/OWNER/PROJECT + +One example of such an extension is Valor. So, going back to the example above, installing it is like this: +```shell +$ optimus extension install gojek/optimus-extension-valor@v0.0.4 +``` +or +```shell +$ optimus extension install github.com/gojek/optimus-extension-valor@v0.0.4 +``` +or +```shell +$ optimus extension install https://github.com/gojek/optimus-extension-valor@v0.0.4 +``` + +Installation process is then in progress. If the installation is a success, the user can show it by running: +```shell +$ optimus --help +``` + + +A new command named after the extension will be available. For example, if the extension name is *optimus-extension-valor*, +then by default the command named valor will be available. If the user wishes to change it, they can use *--alias* +during installation, or *rename* it (explained later). + +The following is an example when running Optimus (without any command): + +```shell +... +Available Commands: + ... + extension Operate with extension + ... + valor Execute gojek/optimus-extension-valor [v0.0.4] extension + version Print the client version information +... +``` + + +### Executing +In order to execute an extension, make sure to follow the installation process described above. After installation +is finished, simply run the extension with the following command: + +```shell +$ optimus [extension name or alias] +``` + + +Example of valor: +```shell +$ optimus valor +``` + +Operation +The user can do some operations to an extension. This section explains more about the available commands. +Do note that these commands are available on the installed extensions. For more detail, run the following command: + +```shell +$ optimus extension [extension name or alias] +``` + +Example: +```shell +$ optimus extension valor + +The above command shows all available commands for valor extension. + +Output: + +Sub-command to operate over extension [gojek/optimus-extension-valor@v0.0.4] + +USAGE + optimus extension valor [flags] + +CORE COMMANDS + activate activate is a sub command to allow user to activate an installed tag + describe describe is a sub command to allow user to describe extension + rename rename is a sub command to allow user to rename an extension command + uninstall uninstall is a sub command to allow user to uninstall a specified tag of an extension + upgrade upgrade is a sub command to allow user to upgrade an extension command + +INHERITED FLAGS + --help Show help for command + --no-color Disable colored output + -v, --verbose if true, then more message will be provided if error encountered +``` + +### Activate +Activate a specific tag when running extension. For example, if the user has two versions of valor, +which is v0.0.1 and v0.0.2, then by specifying the correct tag, the user can just switch between tag. + +Example: +```shell +$ optimus extension valor activate v0.0.1 +``` + +### Describe +Describes general information about an extension, such information includes all available releases of an extension +in the local, which release is active, and more. + +Example: +```shell +$ optimus extension valor describe +``` + + +### Rename +Rename a specific extension to another command that is not reserved. By default, Optimus tries to figure out the +appropriate command name from its project name. However, sometimes the extension name is not convenient like it +being too long or the user just wants to change it. + +Example: +```shell +$ optimus extension valor rename vl +``` + +### Uninstall +Uninstalls extension as a whole or only a specific tag. This allows the user to do some cleanup to preserve some +storage or to resolve some issues. By default, Optimus will uninstall the extension as a whole. To target a specific tag, +use the flag --tag. + +Example: +```shell +$ optimus extension valor uninstall +``` + +### Upgrade +Upgrade allows the user to upgrade a certain extension to its latest tag. Although the user can use the install command, +using this command is shorter and easier as the user only needs to specify the installed extension. + +Example: +```shell +$ optimus extension valor upgrade +``` + diff --git a/docs/docs/concepts/architecture.md b/docs/docs/concepts/architecture.md index ff7ab644ee..bcfdd2fc17 100644 --- a/docs/docs/concepts/architecture.md +++ b/docs/docs/concepts/architecture.md @@ -1,74 +1,34 @@ # Architecture -Basic building blocks of Optimus are +![Architecture Diagram](/img/docs/OptimusArchitecture.png "OptimusArchitecture") -- Optimus CLI -- Optimus Service -- Optimus Database -- Optimus Plugins -- Scheduler -- Optimus Extension +## CLI -### Overview - -![Architecture Diagram](/img/docs/OptimusArchitecture_dark_07June2021.png "OptimusArchitecture") - -### Optimus CLI - -`optimus` is a command line tool used to interact with the main optimus service and basic scaffolding job -specifications. It can be used to - -- Generate jobs based on user inputs -- Add hooks to existing jobs -- Dump a compiled specification for the consumption of a scheduler -- Deployment of specifications to `Optimus Service` -- Create resource specifications for datastores +Optimus provides a command line interface to interact with the main optimus service and basic scaffolding job +specifications. It can be used to: - Start optimus server +- Create resource specifications for datastores +- Generate jobs & hooks based on user inputs +- Dump a compiled specification for the consumption of a scheduler +- Validate and inspect job specifications +- Deployment of specifications to Optimus Service -Optimus also has an admin flag that can be turned on using `OPTIMUS_ADMIN_ENABLED=1` env flag. -This hides few commands which are used internally during the lifecycle of tasks/hooks -execution. - -### Optimus Service - -Optimus cli can start a service that controls and orchestrates all that Optimus has to -offer. Optimus cli uses GRPC to communicate with the optimus service for almost all the -operations that takes `host` as the flag. Service also exposes few REST endpoints -that can be used with simple curl request for registering a new project or checking -the status of a job, etc. - -As soon as jobs are ready in a repository, a deployment request is sent to the service -with all the specs(normally in yaml) which are parsed and stored in the database. -Once these specs are stored, each of them are compiled to generate a scheduler parsable -job format which will be eventually consumed by a supported scheduler to execute the -job. These compiled specifications are uploaded to an **object store** which gets synced -to the scheduler. - -### Optimus Database - -Specifications once requested for deployment needs to be stored somewhere as a source -of truth. Optimus uses postgres as a storage engine to store raw specifications, job -assets, run details, project configurations, etc. - -### Optimus Plugins - -Optimus itself doesn't govern how a job is supposed to execute the transformation. It -only provides the building blocks which needs to be implemented by a task. A plugin is -divided in two parts, an adapter and a docker image. Docker image contains the actual -transformation logic that needs to be executed in the task and adapter helps optimus -to understand what all this task can do and help in doing it. +## Server -### Scheduler +Optimus Server handles all the client requests from direct end users or from airflow over http & grpc. The functionality +of the server can be extended with the support of various plugins to various data sources & sinks. Everything around +job/resource management is handled by the server except scheduling of jobs. -Job adapters consumes job specifications which eventually needs to be scheduled and -executed via a execution engine. This execution engine is termed here as Scheduler. -Optimus by default recommends using `Airflow` but is extensible enough to support any -other scheduler that satisfies some basic requirements, one of the most important -of all is, scheduler should be able to execute a Docker container. +## Database +Optimus supports postgres as the main storage backend. It is the source of truth for all user specifications, +configurations, secrets, assets. It is the place where all the precomputed relations between jobs are stored. -### Optimus Extension +## Plugins +Currently, Optimus doesn’t hold any logic and is not responsible for handling any specific transformations. This +capability is extended through plugins and users can customize based on their needs on what plugins to use. Plugins can +be defined through a yaml specification. At the time of execution whatever the image that is configured in the plugin +image will be executed. -Optimus extension is a feature in Optimus where the user could extend the -functionality of Optimus itself using third-party or arbitrary -implementation. Currently, extension is designed only for when the -user running it as CLI. +## Scheduler (Airflow) +Scheduler is responsible for scheduling all the user defined jobs. Currently, optimus supports only Airflow as +the scheduler, support for more schedulers can be added. diff --git a/docs/docs/concepts/dependency.md b/docs/docs/concepts/dependency.md new file mode 100644 index 0000000000..cddc78b483 --- /dev/null +++ b/docs/docs/concepts/dependency.md @@ -0,0 +1,16 @@ +# Dependency + +A job can have a source and a destination to start with. This source could be a resource managed by Optimus or +non-managed like an S3 bucket. If the dependency is managed by Optimus, it is obvious that in an ETL pipeline, it is +required for the dependency to finish successfully first before the dependent job can start. + +There are 2 types of dependency depending on how to configure it: + +| Type | Description | +|-----------|-------------------------------------------------------------------------------------------------------------------------------------| +| Inferred | Automatically detected through assets. The logic on how to detect the dependency is configured in each of the [plugins](plugin.md). | +| Static | Configured through job.yaml | + +Optimus also supports job dependency to cross-optimus servers. These Optimus servers are considered external resource +managers, where Optimus will look for the job sources that have not been resolved internally and create the dependency. +These resource managers should be configured in the server configuration. diff --git a/docs/docs/concepts/intervals-and-windows.md b/docs/docs/concepts/intervals-and-windows.md index 7f106913f1..d58c7722da 100644 --- a/docs/docs/concepts/intervals-and-windows.md +++ b/docs/docs/concepts/intervals-and-windows.md @@ -1,55 +1,74 @@ -# Understanding Intervals and Windows +# Intervals and Windows -When defining a new job, you need to define the interval at which it will be triggered. -This parameter can give you a precise value when the job is scheduled for execution but -only a rough estimate exactly when the job is executing. It is very common in a ETL -pipeline to know when the job is exactly executing as well as for what time window -the current transformation will consume the data. Knowledge of what time window this -transformation is consuming data from the source will tell what previous windows -we have already consumed, and we can skip those. - -For example:
-We have a table with 2 columns - -| name | created_at | -| ------- | ---------- | -| Rick | 2021-03-05 | -| Sanchez | 2021-03-06 | -| Serious | 2021-03-07 | -| Sam | 2021-03-07 | - -If we schedule a job for a cron interval of `0 2 * * *` that is daily at 2 AM, and start -the job from `2021-03-06`, on first day job will consume `Rick` as the input of the table -if we apply a filter over the SQL query of this table as +When defining a new job, you need to define the **interval (cron)** at which it will be triggered. This parameter can give +you a precise value when the job is scheduled for execution but only a rough estimate exactly when the job is executing. +It is very common in a ETL pipeline to know when the job is exactly executing as well as for what time window the current +transformation will consume the data. +For example, assume there is a job that querying from a table using below statement: ```sql -Select * from table where -created_at > DATE('{{.DSTART}}') AND -created_at <= DATE('{{.DEND}}') +SELECT * FROM table WHERE +created_at >= DATE('{{.DSTART}}') AND +created_at < DATE('{{.DEND}}') ``` -Where `DSTART` could be replaced at the time of compilation with `2021-03-05` and -`DEND` with `2021-03-06`. This transformation will consume each row every day. Without -the provided filter, we will have to consume all the records which are created till date -inside the table even though the previous rows might already been processed. +**_DSTART_** and **_DEND_** could be replaced at the time of compilation with based on its window configuration. +Without the provided filter, we will have to consume all the records which are created till date inside the table +even though the previous rows might already been processed. -These `DSTART` and `DEND` values of the input window could vary depending on the ETL -job requirement. -- For a simple transformation job executing daily, it would need to consume full day worth of data of yesterday. -- A job might be consuming data for a week/month for an aggregation job, but the data boundaries should be complete, +These _DSTART_ and _DEND_ values of the input window could vary depending on the ETL job requirement. +- For a simple transformation job executing daily, it would need to consume full day work of yesterday’s data. +- A job might be consuming data for a week/month for an aggregation job, but the data boundaries should be complete, not consuming any partial data of a day. -Optimus allows user to define the amount of data window to consume through window configurations. -The configurations act on the schedule_time of the job and applied in order to compute dstart and dend. +## Window Configuration + +Optimus allows user to define the amount of data window to consume through window configurations. The configurations +act on the schedule_time of the job and applied in order to compute _DSTART_ and _DEND_. -- **Truncate_to**: The data window on most of the scenarios needs to be aligned to a well-defined time window - like month start to month end, or week start to weekend with week start being monday, or a complete day. - Inorder to achieve that the truncate_to option is provided which can be configured with either of these values +- **Truncate_to**: The data window on most of the scenarios needs to be aligned to a well-defined time window + like month start to month end, or week start to weekend with week start being monday, or a complete day. + Inorder to achieve that the truncate_to option is provided which can be configured with either of these values "h", "d", "w", "M" through which for a given schedule_time the end_time will be the end of last hour, day, week, month respectively. -- **Offset**: Offset is time duration configuration which enables user to move the `end_time` post truncation. +- **Offset**: Offset is time duration configuration which enables user to move the `end_time` post truncation. User can define the duration like "24h", "2h45m", "60s", "-45m24h", "0", "", "2M", "45M24h", "45M24h30m" - where "h","m","s","M" means hour, month, seconds, Month respectively. + where "h","m","s","M" means hour, month, seconds, Month respectively. - **Size**: Size enables user to define the amount of data to consume from the `end_time` again defined through the duration same as offset. -The above expectation of windowing is properly handled in job spec version 2, version 1 has some limitations in some of these expectations. -You can verify these configurations through `optimus playground command` +For example, previous-mentioned job has `0 2 * * *` schedule interval and is scheduled to run on +**2023-03-07 at 02.00 UTC** with following details: + +| Configuration | Value | Description | +|---------------|-------|----------------------------------------------------------------------------------------| +| Truncate_to | d | Even though it is scheduled at 02.00 AM, data window will be day-truncated (00.00 AM). | +| Offset | -24h | Shifts the window to be 1 day earlier. | +| Size | 24h | Gap between DSTART and DEND is 24h. | + +Above configuration will produce below window: +- _DSTART_: 2023-04-05T00:00:00Z +- _DEND_: 2023-04-06T00:00:00Z + +This means, the query will be compiled to the following query + +```sql +SELECT * FROM table WHERE +created_at >= DATE('2023-04-05T00:00:00Z') AND +created_at < DATE('2023-04-06T00:00:00Z') +``` + +Assume the table content is as the following: + +| name | created_at | +| ------- |------------| +| Rick | 2023-03-05 | +| Sanchez | 2023-03-06 | +| Serious | 2023-03-07 | +| Sam | 2023-03-07 | + +When the job that scheduled at **2023-03-07** runs, the job will consume `Rick` as the input of the table. + +The above expectation of windowing is properly handled in job spec version 2, version 1 has some limitations in some of +these expectations. You can verify these configurations by trying out in below command: +``` +$ optimus playground +``` diff --git a/docs/docs/concepts/job-run.md b/docs/docs/concepts/job-run.md new file mode 100644 index 0000000000..ff7aa83189 --- /dev/null +++ b/docs/docs/concepts/job-run.md @@ -0,0 +1,7 @@ +# Job Run + +A job is mainly created to run on schedule. Let’s take a look at what is happening once a scheduler triggers your job to run. + +![Job Run Flow](/img/docs/Concept_JobRun.png "JobRunFlow") + +Note: to test this runtime interactions on your own, take a look and follow the guide on developer environment [section](https://github.com/raystack/optimus/tree/main/dev). diff --git a/docs/docs/concepts/job.md b/docs/docs/concepts/job.md new file mode 100644 index 0000000000..72dfae72ab --- /dev/null +++ b/docs/docs/concepts/job.md @@ -0,0 +1,101 @@ +# Job + +A Job is the fundamental unit of the data pipeline which enables a data transformation in the warehouse of choice. +A user can configure various details mentioned below for the job: + +- Schedule interval +- Date from when a transformation should start executing +- Task & Hooks +- Assets needed for transformation +- Alerts + +Job specifications are being compiled to later be processed by the scheduler. Optimus is using Airflow as the scheduler, +thus it is compiling the job specification to DAG (_Directed Acryclic Graph_) file. + +Each of the DAG represents a single job, which consists of: + +- Airflow task(s). Transformation tasks and hooks will be compiled to Airflow tasks. +- Sensors, only if the job has dependency. + +Each job has a single base transformation, we call them **Task** and might have the task pre or/and post operations, +which are called **Hooks**. + +## Task + +A task is a main transformation process that will fetch data, transform as configured, and sink to the destination. +Each task has its own set of configs and can inherit configurations from a global configuration store. + +Some examples of task are: + +- BQ to BQ task +- BQ to Email task +- Python task +- Tableau task +- Etc. + +## Hook + +Hooks are the operations that you might want to run before or after a task. A hook is only associated with a single +parent although they can depend on other hooks within the same job. There can be one or many or zero hooks for a Job as +configured by the user. Some examples of hooks are: + +- [Predator](https://github.com/raystack/predator) (Profiling & Auditing for BQ) +- Publishing transformed data to Kafka +- Http Hooks + +Each hook has its own set of configs and shares the same asset folder as the base job. Hook can inherit configurations +from the base transformation or from a global configuration store. + +The fundamental difference between a hook and a task is, a task can have dependencies over other jobs inside the +repository whereas a hook can only depend on other hooks within the job. + +## Asset + +There could be an asset folder along with the job.yaml file generated via optimus when a new job is created. This is a +shared folder across base transformation task and all associated hooks. Assets can use macros and functions powered by +[Go templating engine](https://golang.org/pkg/text/template/). + +Section of code can be imported from different asset files using template. For example: + +- File partials.gtpl + +```gotemplate +DECLARE t1 TIMESTAMP; +``` + +- Another file query.sql + +```gotemplate +{{template "partials.gtpl"}} +SET t1 = '2021-02-10T10:00:00+00:00'; +``` + +During execution query.sql will be rendered as: + +```gotemplate +DECLARE t1 TIMESTAMP; +SET t1 = '2021-02-10T10:00:00+00:00'; +``` + +whereas **partials.gtpl** will be left as it is because file was saved with .gtpl extension. + +Similarly, a single file can contain multiple blocks of code that can function as macro of code replacement. For example: + +- file.data + +```gotemplate +Name: {{ template "name"}}, Gender: {{ template "gender" }} +``` + +- partials.gtpl + +```gotemplate +{{- define "name" -}} Adam {{- end}} +{{- define "gender" -}} Male {{- end}} +``` + +This will render file.data as + +``` +Name: Adam, Gender: Male +``` diff --git a/docs/docs/concepts/macros.md b/docs/docs/concepts/macros.md new file mode 100644 index 0000000000..fef5052ab6 --- /dev/null +++ b/docs/docs/concepts/macros.md @@ -0,0 +1,14 @@ +# Macros +Macros are special variables that will be replaced by actual values when before execution. Custom macros are not +supported yet. + +Below listed the in built macros supported in optimus. + +| Macros | Description | +| -------------------- |---------------------------------------------------------------------------------| +| {{.DSTART}} | start date/datetime of the window as 2021-02-10T10:00:00+00:00 that is, RFC3339 | +| {{.DEND}} | end date/datetime of the window, as RFC3339 | +| {{.JOB_DESTINATION}} | full qualified table name used in DML statement | +| {{.EXECUTION_TIME}} | timestamp when the specific job run starts | + +Take a detailed look at the windows concept and example [here](intervals-and-windows.md). diff --git a/docs/docs/concepts/namespace.md b/docs/docs/concepts/namespace.md new file mode 100644 index 0000000000..f6613be247 --- /dev/null +++ b/docs/docs/concepts/namespace.md @@ -0,0 +1,5 @@ +# Namespace + +A namespace represents a grouping of specified jobs and resources which are accessible only through the namespace owners. +You may override the project configuration or define the configuration locally at the namespace level. A namespace always +belongs to a Project. All Namespaces of a Project share the same infrastructure and the Scheduler. diff --git a/docs/docs/concepts/overview.md b/docs/docs/concepts/overview.md deleted file mode 100644 index 3e91d32c11..0000000000 --- a/docs/docs/concepts/overview.md +++ /dev/null @@ -1,513 +0,0 @@ -# Overview - -## Optimus Project - -A Project/Tenant represents a group of Jobs, Resources, Scheduler with the specified -configurations and infrastructure. A Project contains multiple user created Namespaces, -and each Namespace contains multiple Jobs/Hooks and configurations. - -## Namespace - -A Namespace represents a grouping of specified Jobs and Resources which can be accessible -only through the namespace owners. User may override the Project configuration or define -configuration locally at the namespace level. A namespace always belongs to a Project. -All Namespaces of a Project share same infrastructure and the Scheduler. They share all -the accesses and secrets provided by the Project, however, they cannot access or modify -the Jobs and Datastore Resources of other namespaces. - -A use case for Namespace could be when multiple teams want to re-use the existing -infrastructure but want to maintain their specifications like Jobs, Resources etc -independently. The namespace's name can be chosen by user or can be provided by the -authentication service. - -## Optimus cli - -Optimus provides a cli used to start Optimus service using `serve` command and a -lot of other features like interacting with the remote/local optimus service, bootstrapping -specifications, validating, testing, etc. Although it is not necessary to use cli -and GRPC/REST can also be used directly which is what CLI does internally for communication -with the service. - -## Job - -A Job is the fundamental unit of the data pipeline which enables a data transformation -in the warehouse of choice. A job has all the basic details required to perform a scheduled -operation few of which are: - -- Schedule interval -- Date from when a transformation should start executing -- How much data this job will consume at every transformation - -Each job has a single base transformation, we call them **Transformer** or **Task**. -Some examples of jobs include: - -1. BQ2BQTask - transformation from BigQuery to BigQuery in SQL -2. SparkSQLTask - transformation from BQ/GCS to BQ/GCS in SparkSQL -3. PySparkTask - transformation using python. - -## Hook - -Hooks are the operations that you might want to run before or after a Job. A hook is -only associated with a single parent although they can depend on other hooks within -the same job. There can be many or zero hooks for a Job as configured by the user. -Some examples of hooks are: - -1. Transporter(BQ/GCS to Kafka) -2. Predator(Auditing & Profiling for BQ) -3. BeastLagChecker -4. Http Hooks -5. Tableau view updates - -Each hook has its own set of configs and share the same asset folder as the base job. -Hook can inherit configurations from the base transformation or from a global configuration -store. - -> The fundamental difference between a hook and a task is, task can have dependencies -> over other jobs inside the repository whereas hook can only depend on other hooks within -> the job. - -## Job Specification - -Optimus has a specification repository that holds all the details required to -define a scheduled operation. Repository has a fixed folder structure which is -maintained by Optimus CLI. Users can create and delete the jobs from the -repository using either optimus CLI or a simple text editor like -[VSCode](https://code.visualstudio.com/download). A sample command to create -a new job is "optimus create job", calling this will ask for a -few inputs which are required for the execution of this job and -leave rest for the user to modify of its own eg, the SQL. - -If you're new to YAML and want to learn more, see [Learn YAML in Y minutes.](https://learnxinyminutes.com/docs/yaml/) - -Following is a sample job specification: - -```yaml -# specification version, for now just keep it fixed unless optimus has any -# breaking change -version: 1 - -# unique name for the job, try to use simple ascii characters and less than 200 chars -# to keep scheduler db's happy -name: example_job - -# owner of the job -owner: example@example.com - -# description of this job, what this do -description: sample example job - -# configure when it should start, when the job should stop executing and what -# interval scheduler should use for execution -schedule: - # time format should be RFC3339 - start_date: "2021-02-18" - end_date: "2021-02-25" - - # supports standard cron notations - # leave as empty string for manually triggered jobs - interval: 0 3 * * * - -# extra modifiers to change the behavior of the job -behavior: - # should the job wait for previous runs to finish successfully before executing - # next run, this will make it execute in sequence - depends_on_past: false - - # if start_date is set in the past, and catchup is true, it will allow scheduler - # to automatically backfill history executions till it reaches today - catch_up: true - - # retry behaviour of this job if it fails to successfully complete in first try - retry: - # maximum number of tries before giving up, cannot be 0 - count: 3 - - # delay between retries - delay: "15m" - - # allow progressive longer waits between retries by using exponential backoff algorithm - # on retry delay (delay will be converted into seconds) - exponential_backoff: false - - # send a notification to routing channel based on an event - notify: - - # event to listen for - # possible options failure/sla_miss - on: failure - - # list of routes that will recieve the notification - channel: - # email id of a user in slack - - slack://example@example.com - # slack channel - - slack://#optimus-devs - # slack user group - - slack://@optimus-devs - - # additional configs required for certain events like sla_miss - config: - - duration: 2h - -# transformation task configuration for this job -task: - # name of the task type - name: bq2bq - - # configuration passed to the task before execution - config: - PROJECT: example - DATASET: data - TABLE: hello_table - LOAD_METHOD: APPEND - SQL_TYPE: STANDARD - PARTITION_FILTER: 'event_timestamp >= "{{.DSTART}}" AND event_timestamp < "{{.DEND}}"' - - # time window, could be used by task for running incremental runs instead of processing - # complete past data at every iteration - window: - # size of incremental window - # eg: 1h, 6h, 48h, 2h30m - size: 24h - - # shifting window forward of backward in time, by default it is yesterday - offset: "0" - - # truncate time window to nearest hour/day/week/month - # possible values: h/d/w/M - truncate_to: d - -# labels gets passed to task/hooks -# these can be used to attach metadata to running transformation -# discovering usage, identifying cost, grouping identities, etc -labels: - orchestrator: optimus - -# static dependencies that can be used to wait for upstream job to finish -# before this job can be started for execution -dependencies: - # list `job: ` - - job: sample_internal_job - # provide where the upstream dependency is stored, intra/inter/extra - # intra: within this project - # inter: within optimus but cross project - # extra: outside optimus[not properly supported] - # optional, default: intra - type: intra - - - # inter dependencies should prefix job name with project name divided by - # a forward slash / - job: cross_project/sample_external_job - type: inter - -# adhoc operations marked for execution at different hook points -# accepts a list -hooks: - - # name of the hook - name: transporter - - # where & when to attach this process - type: post - - # configuration passed to hook before execution - config: - KAFKA_TOPIC: optimus_example-data-hello_table - - # configuration being inherited from project level variables - PRODUCER_CONFIG_BOOTSTRAP_SERVERS: "{{.GLOBAL__TransporterKafkaBroker}}" - - PROTO_SCHEMA: example.data.HelloTable - -# contains additional metadata information -metadata: - # contains metadata on the resource of a job - resource: - # defines the requested configuration of a resource for a job - request: - # defines the requested memory for a job's resource - memory: 128Mi - # defines the requested cpu for a job's resource - cpu: 250m - # defines the limit configuration of a resource for a job - limit: - # defines the limit memory for a job's resource - memory: 256Mi - # defines the limit cpu for a job's resource - cpu: 500m - # contains airflow specific configuration - airflow: - # defines the pool to be assigned for this job - pool: poolA - # defines the queue to be assigend for this job - queue: queueA -``` - -`resource` under metadata follows most of the convention specified [here](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container). -Though it's similar, the difference is only on how to write it in the specification YAML file. - -`airflow` pool and queue are to be sent to the BaseOperator. See the specification [here](https://airflow.apache.org/docs/apache-airflow/stable/concepts/pools.html). - -Configuring `metadata`, including but not limited to `resource` and `airflow`, is **NOT** mandatory. - -## Macros & Templates - -Optimus allows using pre-defined macros/templates to make the pipelines more -dynamic and extensible. Macros can be used in Job/Hooks configurations or Assets. -Some macros are: - -- `"{{.DEND}}"`: this macro is replaced with the current execution date - (in yyyy-mm-ddThh:mm:ssZ format) of the task (note that this is the execution date - of when the task was supposed to run, not when it actually runs). It would - translate to a timestamp in runtime. eg, "2021-01-30T00:00:00Z" -- `"{{.DSTART}}"`: the value of this macro is DEND minus the task window. For - the DAILY task window, DSTART is one day behind DEND, if the task window is - weekly, DSTART is 7 days before DEND. -- `"{{.EXECUTION_TIME}}"`: the value of this marco is always the current timestamp. - -You can use these in either `job.yml` configs or in assets. For example: - -- Asset for a SQL query `query.sql` - -```sql -select CONCAT("Hello, ", "{{.DEND}}") as message -``` - -- Configuration in `job.yml` - -```yaml -version: 1 -name: example_job -... omitting few configs ... -hooks: -- name: transporter - config: - BQ_TABLE: hello_table - FILTER_EXPRESSION: event_timestamp >= '{{.DSTART}}' AND event_timestamp < '{{.DEND}}' -``` - -Macros can be chained together via pipe-sign with predefined functions. - -- `Date`: Converters Timestamp to Date. For example - -```sql -SELECT * FROM table1 -WHERE DATE(event_timestamp) < '{{ .DSTART|Date }}' -``` - -## Configuration - -Each job specification has a set of configs made with a key value pair. Keys are always -specific to the execution unit and value could be of 3 types. - -- User provided: These inputs are values provided by users at the time of creating - via optimus cli or modifying the job using a text editor. -- Task inherited: Hooks can inherit the configuration values from base transformation and - avoid providing the same thing using `{{.TASK__}}` macro. - For example: - -```yaml -task: - name: bq2bq - config: - DATASET: playground -hooks: - name: myhook - config: - MY_DATASET: { { .TASK__DATASET } } -``` - -- Repository global: Configs that will be shared across multiple jobs and should remain static - can be configured in a global config store as part of tenant registration. These configs are - available to only the registered repository and will remain same for all the jobs. Jobs can access - them via `{{.GLOBAL__}}`. - For example: - -```yaml -task: - name: bq2bq - config: - DATASET: { { .GLOBAL__COMMON_DATASET } } -hooks: - name: myhook - config: - KAFKA_BROKER: { { .GLOBAL__KAFKA_BROKERS } } -``` - -At the moment we only support these configs to be registered via REST API exposed in optimus -which will be discussed in a different section but in near future should be configurable via -a configuration file inside the repository. - -## Assets - -There could be an asset folder along with the `job.yaml` file generated via `optimus` when -a new job is created. This is a shared folder across base transformation task -and all associated hooks. For example, if BQ2BQ task is selected, it should generate a -template `query.sql` file for writing the BigQuery transformation SQL. Assets can use -macros and functions powered by [Go templating engine](https://golang.org/pkg/text/template/). -Optimus also injects few helper functions provided in [sprig](http://masterminds.github.io/sprig/) -library. -For example: - -```sql -{{ $name := "admin" }} -select CONCAT("Hello, ", "{{.name}}") as message -``` - -Section of code can be imported from different asset files using -[template](https://golang.org/pkg/text/template/#hdr-Actions). For example: - -- File `partials.gtpl` - -```sql -DECLARE t1 TIMESTAMP; -``` - -- Another file `query.sql` - -```sql -{{template "partials.gtpl"}} -SET t1 = '2021-02-10T10:00:00+00:00'; -``` - -During execution `query.sql` will be rendered as: - -```sql -DECLARE t1 TIMESTAMP; -SET t1 = '2021-02-10T10:00:00+00:00'; -``` - -whereas `partials.gtpl` will be left as it is because file was saved with `.gtpl` -extension. - -Similarly, a single file can contain multiple blocks of code that can function -as macro of code replacement. For example: - -- `file.data` - -``` - Name: {{ template "name"}}, Gender: {{ template "gender" }} -``` - -- `partials.gtpl` - -``` - {{- define "name" -}} Adam {{- end}} - {{- define "gender" -}} Male {{- end}} -``` - -This will render `file.data` as - -``` -Name: Adam, Gender: Male -``` - -## Scheduler - -A scheduler is one of the core unit responsible for scheduling the jobs for execution -on a defined interval. By default, Optimus uses [Airflow](https://airflow.apache.org/) -as the schedule but does support extending to different schedulers that follow -few guidelines. -TODO: Docs for supporting custom scheduler - -## Dependency Resolver - -A job can have a source and a destination to start with. This source could be a resource -managed by optimus or non-managed like a S3 bucket. If the dependency is managed -by optimus, it is obvious that in an ETL pipeline, it is required for the dependency to -finish successfully first before the dependent job can start. This direct or indirect -dependency can be automatically inferred in job specifications based on task inputs. -For example, in BQ2BQ task, it parses the SQL transformation and look for tables that -are used as source using FROM, JOIN, etc keywords and mark them as the dependency for the -current job. Optimus call this automatic dependency resolution which happens automatically. -There are options to manually specify a dependency using the job name within the same -project if needed to. - -Optimus also supports job dependency to cross optimus servers. These optimus servers are -considered as external resource managers, where optimus will look for the job sources that -have not been resolved internally and create the dependency. These resource managers should -be configured in the server configuration. - -## Priority Resolver - -Schedulers who support "Priorities" to handle the problem of "What to execute first" -can take the advantage of Optimus Priority Resolver. To understand this lets take an -example taking Airflow as the scheduler: - -Let's say we provide limited slots to airflow i.e. 10, that means only 10 tasks can be -executed at a time. Now these tasks could be a [Sensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/index.html) -to check if the upstream [DAG](https://airflow.apache.org/docs/apache-airflow/stable/dag-run.html) -is finished, or it could be a task that actually executes the transformation. -The issue is when Airflow don’t know what to prioritise when if all of them are scheduled -to execute at the same time. If airflow keep on scheduling these sensors(which will -never pass because upstream DAG never really got the chance to execute as airflow didn’t schedule -the transformation task) it will get stuck in kind of a deadlock. All those 10 slots -will be filled by sensors again and again and Airflow will take enormous time to schedule -a actual transformation. Its not really a deadlock but very similar and waste a lot of time -finding the correct task to execute like a needle in haystack. So recently we have -taken a story to prioritise these tasks based on how many downstream dependencies are waiting -for it. That is, in a dependency tree, whatever is at the root(depends on nothing) will always -be prioritised first like Standardised layer dags and then it will move to downstream -sensors and tasks. - -This will help fully utilize the Scheduler capabilities. - -## Optimus Plugins - -Optimus's responsibilities are currently divided in two parts, scheduling a transformation [task](#Job) and running one time action to create or modify a [datastore](#Datastore) resource. Defining how a datastore is managed can be easy and doesn't leave many options for configuration or ambiguity although the way datastores are implemented gives developers flexibility to contribute additional type of datastore, but it is not something we do every day. - -Whereas tasks used in jobs that define how the transformation will execute, what configuration does it need as input from user, how does this task resolves dependencies between each other, what kind of assets it might need. These questions are very open and answers to them could be different in different organisation and users. To allow flexibility of answering these questions by developers themselves, we have chosen to make it easy to contribute a new kind of task or even a hook. This modularity in Optimus is achieved using plugins. - -> Plugins are self-contained binaries which implements predefined protobuf interfaces to extend Optimus functionalities. - -Optimus can be divided in two logical parts when we are thinking of a pluggable model, one is the **core** where everything happens which is common for all job/datastore, and the other part which could be variable and needs user specific definitions of how things should work which is a **plugin**. - -## Datastore - -Optimus datastores are managed warehouses that provides CRUD on resources attached to it. Each warehouse supports fixed set of resource types, each type has its own specification schema. - -At the moment, Optimus supports BigQuery datastore for 3 types of resources: - -- [Dataset](https://cloud.google.com/bigquery/docs/datasets-intro) -- [Table](https://cloud.google.com/bigquery/docs/tables-intro) -- [Standard View](https://cloud.google.com/bigquery/docs/views-intro) - -## Secret Management - -A lot of transformation operations require credentials to execute. These credentials (secrets) are needed in some tasks, hooks, and may also be needed in plugin adapters to compute dependencies/compile assets/etc. before the actual transformation even begins. Optimus provides a convenient way to store secrets and make them accessible in containers during the execution. - -Optimus has two sets of secrets, User-Defined secrets & System secrets which are needed for server operations. - -### User-Defined Secrets -Users can easily create, update, and delete their own secrets using CLI or REST API. Secrets can be created in a project level which is accessible from all the namespaces in the project, or can just be created in namespace level. These secrets will then can be used as part of the job spec configuration using macros with their names. Only the secrets created at project & namespace the job belongs to can be referenced. - -### System Secrets -System secrets are available for the entire project and are intended to be managed by only the administrator. These system secrets are being used in server operations, for example storage and scheduler access. Each of the system secrets are prefixed by `_OPTIMUS_`, for example: -``` -_OPTIMUS_someSecret superSecretValue -``` - - -## Replay & Backups - -A job might need to be re-run (backfill) due to business requirement changes or other various reasons. Optimus provides -an easy way to do this using Replay. Replay accepts which job and range of date to be updated, validating it, -and re-run the job tasks. Replay will also figure the dependents of the job and re-run all the downstream jobs within -the same project just after the upstream tasks are finished. - -When validating, Optimus checks if replay with the same job and date are currently running and also checks if the task -scheduler instances are still running to avoid any duplication and conflicts. - -After passing the validation, Replay will clear task instances of the requested job in the scheduler, letting the tasks to be picked -up and run. Replay will frequently check the status of each task from the scheduler (every 5 minutes) to track if -each task is still in progress, failed, or succeeded. - -Optimus also provides Backup to duplicate a resource that can be perfectly used before running Replay. Optimus accepts -which datastore and resource that needs to be backed up and users have a choice to also back up the downstream resources -within the same project. Where the backup result will be located, and the expiry detail can be configured in the project -configuration. - -Both Replay and Backup are provided with Dry Run to simulate all the impacted tasks or resources without actually re-running -the tasks or backing up the resources. - -## Monitoring & Alerting - -TODO diff --git a/docs/docs/concepts/plugin.md b/docs/docs/concepts/plugin.md new file mode 100644 index 0000000000..a926bee89c --- /dev/null +++ b/docs/docs/concepts/plugin.md @@ -0,0 +1,7 @@ +# Plugin +Optimus can provide support for various data warehouses & any third party system to handle all the data transformations +or movement through plugins. You can bring your own plugin by encapsulating all the logic in a docker container. + +Currently, plugins can be defined as YAML or binary executables. YAML plugin provides the questionnaire and default +values for job task’s / hook’s creation, as well as defines the image to execute. While a binary plugin, it is +complementing the YAML plugin by providing support for automated dependency resolution. diff --git a/docs/docs/concepts/project.md b/docs/docs/concepts/project.md new file mode 100644 index 0000000000..aa0004449b --- /dev/null +++ b/docs/docs/concepts/project.md @@ -0,0 +1,4 @@ +# Project + +A project/tenant represents a group of jobs, resources, and a scheduler with the specified configurations and infrastructure. +A project contains multiple user-created namespaces, and each has various jobs and resources. diff --git a/docs/docs/concepts/replay-and-backup.md b/docs/docs/concepts/replay-and-backup.md new file mode 100644 index 0000000000..b4335dd55f --- /dev/null +++ b/docs/docs/concepts/replay-and-backup.md @@ -0,0 +1,21 @@ +# Replay & Backup +A job might need to be re-run (backfill) due to business requirement changes or other various reasons. Optimus provides +an easy way to do this using Replay. Replay accepts which job and range of date to be updated, validates it, and re-runs +the job tasks. + +When validating, Optimus checks if there is any Replay with the same job and date currently running and also checks if +the task scheduler instances are still running to avoid any duplication and conflicts. + +After passing the validation checks, a Replay request will be created and will be processed by the workers based on the +mode chosen (sequential/parallel). To re-run the tasks, Optimus clears the existing runs from the scheduler. + +**Sequential (Default)** + +![Sequential Mode Flow](/img/docs/ReplaySequential.png "SequentialMode") + +**Parallel** + +![Parallel Mode Flow](/img/docs/ReplayParallel.png "ParallelMode") + +Optimus also provides a Backup feature to duplicate a resource that can be perfectly used before running Replay. Where +the backup result will be located, and the expiry detail can be configured in the project configuration. diff --git a/docs/docs/concepts/resource.md b/docs/docs/concepts/resource.md new file mode 100644 index 0000000000..c40d42e60c --- /dev/null +++ b/docs/docs/concepts/resource.md @@ -0,0 +1,14 @@ +# Resource + +A resource is the representation of the warehouse unit that can be a source or a destination of a transformation job. +The warehouse resources can be created, modified, and be read from Optimus, as well as can be backed up as requested. +Each warehouse supports a fixed set of resource types and each type has its own specification schema. +Optimus’ managed warehouse is called Optimus datastore. + +At the moment, Optimus supports BigQuery datastore for these type of resources: +- Dataset +- Table +- Standard View +- External Table + +_Note: BigQuery resource deletion is currently not supported._ diff --git a/docs/docs/concepts/secret.md b/docs/docs/concepts/secret.md new file mode 100644 index 0000000000..e57e9f6b4a --- /dev/null +++ b/docs/docs/concepts/secret.md @@ -0,0 +1,9 @@ +# Secret +A lot of transformation operations require credentials to execute. These credentials (secrets) are needed in some tasks, +hooks, and may also be needed in deployment processes such as dependency resolution. Optimus provides a convenient way +to store secrets and make them accessible in containers during the execution. + +You can easily create, update, and delete your own secrets using CLI or REST API. Secrets can be created at a project +level which is accessible from all the namespaces in the project, or can just be created at the namespace level. These +secrets will then can be used as part of the job spec configuration using macros with their names. Only the secrets +created at the project & namespace the job belongs to can be referenced. diff --git a/docs/docs/contribute/contributing.md b/docs/docs/contribute/contributing.md deleted file mode 100644 index ae2490ed2a..0000000000 --- a/docs/docs/contribute/contributing.md +++ /dev/null @@ -1,37 +0,0 @@ -# Contributing - -First off, thanks for taking the time to contribute! 🌟🥳 - -When contributing to this repository, please first discuss the change you wish to make via issue, -email, or any other method with the owners of this repository before making a change. - -Please note we have a code of conduct, please follow it in all your interactions with the project. - -## Best practices - -- Write clear and meaningful git commit messages. -- If the PR will *completely* fix a specific issue, include `fixes #123` in the PR body (where 123 is the specific issue number the PR will fix. This will automatically close the issue when the PR is merged. -- Make sure you don't include `@mentions` or `fixes` keywords in your git commit messages. These should be included in the PR body instead. -- When you make a PR for small change (such as fixing a typo, style change, or grammar fix), please squash your commits so that we can maintain a cleaner git history. -- Make sure you include a clear and detailed PR description explaining the reasons for the changes, and ensuring there is sufficient information for the reviewer to understand your PR. -- Additional Readings: - - [chris.beams.io/posts/git-commit/](https://chris.beams.io/posts/git-commit/) - - [github.com/blog/1506-closing-issues-via-pull-requests ](https://github.com/blog/1506-closing-issues-via-pull-requests) - - [davidwalsh.name/squash-commits-git ](https://davidwalsh.name/squash-commits-git) - - [https://mtlynch.io/code-review-love/](https://mtlynch.io/code-review-love/) - -## Code of Conduct - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the project - -Things to keep in mind before creating a new commit: - -* Go through the project code conventions. -* Commit [guidelines](https://www.conventionalcommits.org/en/v1.0.0/) -* [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md) diff --git a/docs/docs/contribute/contribution-process.md b/docs/docs/contribute/contribution-process.md new file mode 100644 index 0000000000..ce54863c8b --- /dev/null +++ b/docs/docs/contribute/contribution-process.md @@ -0,0 +1,34 @@ +# Contributing + +First off, thanks for taking the time to contribute! 🌟🥳 + +Before start contributing, feel free to ask questions or initiate conversation via GitHub discussion. +You are also welcome to create issue if you encounter a bug or to suggest feature enhancements. + +Please note we have a code of conduct, please follow it in all your interactions with the project. + +## Best practices + +- Follow the [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) format for all commit messages. +- Link the PR with the issue. This is mandatory to ensure there is sufficient information for the reviewer to understand + your PR. +- When you make a PR for small change (such as fixing a typo, style change, or grammar fix), please squash your commits + so that we can maintain a cleaner git history. +- Docs live in the code repo under [docs](https://github.com/raystack/optimus/tree/main/docs). Please maintain the docs + and any docs changes can be done in the same PR. +- Avoid force-pushing as it makes reviewing difficult. + +## Code of Conduct + +Examples of behavior that contributes to creating a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the project + +Things to keep in mind before creating a new commit: + +- Go through the project code conventions. +- Commit [guidelines](https://www.conventionalcommits.org/en/v1.0.0/) +- [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md) diff --git a/docs/docs/contribute/developer-env-setup.md b/docs/docs/contribute/developer-env-setup.md new file mode 100644 index 0000000000..7544c2f333 --- /dev/null +++ b/docs/docs/contribute/developer-env-setup.md @@ -0,0 +1,4 @@ +# Developer Environment Setup + +To test Optimus including the integration with Airflow, as well as testing the runtime interactions, Optimus provides +a way to simplify setting up the environment. Take a look and follow the guide in dev setup [section](https://github.com/raystack/optimus/tree/main/dev). diff --git a/docs/docs/development/building-plugin.md b/docs/docs/development/building-plugin.md deleted file mode 100644 index 71c92ba5f0..0000000000 --- a/docs/docs/development/building-plugin.md +++ /dev/null @@ -1,953 +0,0 @@ ---- -id: building-plugin -title: Developing plugins ---- - -Optimus's responsibilities are currently divided in two parts, scheduling a transformation [task](../concepts/overview.md#Job) and running one time action to create or modify a [datastore](../concepts/overview.md#Datastore) resource. Defining how a datastore is managed can be easy and doesn't leave many options for configuration or ambiguity although the way datastores are implemented gives developers flexibility to contribute additional type of datastore, but it is not something we do every day. - -Whereas tasks used in jobs that define how the transformation will execute, what configuration does it need as input from user, how does this task resolves dependencies between each other, what kind of assets it might need. These questions are very open and answers to them could be different in different organisation and users. To allow flexibility of answering these questions by developers themselves, we have chosen to make it easy to contribute a new kind of task or even a hook. This modularity in Optimus is achieved using plugins. - -Optimus can be divided in two logical parts when we are thinking of a pluggable model, one is the **core** where everything happens which is common for all job/datastore, and the other part which could be variable and needs user specific definitions of how things should work which is a **plugin**. - -Currently Optimus plugin can be implemented as binary executable. -And `support for yaml` implementation of plugins is also introduced with limited -scope (discussed below). - -Optimus Plugin is just an adapter between optimus and what actually needs to be executed. Actual transformation will be packed in a docker image and Optimus will execute these arbitrary docker images as long as it has access to reach container registry. Plugin provides the optimus server with the info about the docker image. - -> Plugin itself is not executed for transformation but only used for adapting conditions which Optimus requires to be defined for each task. - -## Types of Plugins in Optimus -At the moment mainly there are two types of plugins which optimus supports. These are : ***Hook*** and ***Task*** -Before getting into the difference between two plugins ,we need to get familiar with [Jobs](../concepts/overview.md#Job). - -| Type | Task | Hook | -| ---------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| Definition | It is the single base transformation in a Job. | It is the operation that we preferably run before or after a Job. | -| Fundamental Difference | It can have dependencies over other jobs inside the Optimus project. | It can have dependencies over other hooks within the job. | -| Configuration | It has its own set of configs and asset directory. | It has its own set of configs and share the same asset directory across all hooks as the base job. | - - -## Supported Use-Cases of Plugins in Optimus - -* Plugin Info Usecases: - * Discover all plugins and list their info. - * Refer - `optimus version` (lists all the plugins available), -* Project Side Usecases : - * Survey to populate job specifications and assets. - * Plugins provide the questionare and default values (default assets for job) to the survey implemtnation in optimus. - * Refer - `optimus job create` -* Server Side Usecases : - * CompileAssets & DependencyResolver - * Theses are currently supported server side behaviour that is delegated to plugins implementations. - * Refer - [transformers](https://github.com/odpf/transformers/blob/main/task/bq2bq/main.go#L274) - -## Binary Implementation of Plugin - -Binary implementation of Plugins are self-contained binaries which implements predefined protobuf interfaces to extend Optimus functionalities. -Binary Plugins are implemented using [go-plugin](https://github.com/hashicorp/go-plugin) developed by Hashicorp used in terraform and other similar products. - -> Plugins can be implemented in any language as long as they can be exported as a single self-contained executable binary and implements a GRPC server. - -It is recommended to use Go currently for writing plugins because of its cross platform build functionality and to reuse protobuf sdk provided within Optimus core. - -> Binary Plugins can potentially modify the behavior of Optimus in undesired ways. Exercise caution when adding new plugins developed by unrecognized developers. - - -## Yaml Implementation of Plugin -Most plugins are expected to implement just the info and project side use-cases (mentioned above) and thease are data-driven i.e., plugin just provide data to optimus. -To simplify the development process of plugins, support for yaml mode of defining plugins is added. - -```go -// representation of a yaml plugin schema in golang - -// below struct definition in golang can be marshalled -// to generate yaml plugins - -type YamlPlugin struct { - // info use-case - Name string `yaml:"name"` - Description string `yaml:"description"` - Plugintype string `yaml:"plugintype"` - Pluginversion string `yaml:"pluginversion"` - Image string `yaml:"image"` - Secretpath string `yaml:"secretpath"` - - // survey use-case - Questions []struct { - Name string `yaml:"name"` - Prompt string `yaml:"prompt"` - Help string `yaml:"help"` - Regexp string `yaml:"regexp"` - Validationerror string `yaml:"validationerror"` - Minlength int `yaml:"minlength"` - Required bool `yaml:"required,omitempty"` - Maxlength int `yaml:"maxlength,omitempty"` - Subquestions []struct { - Ifvalue string `yaml:"ifvalue"` - Questions []struct { - Name string `yaml:"name"` - Prompt string `yaml:"prompt"` - Help string `yaml:"help"` - Multiselect []string `yaml:"multiselect"` - Regexp string `yaml:"regexp"` - Validationerror string `yaml:"validationerror"` - Minlength int `yaml:"minlength"` - Required bool `yaml:"required,omitempty"` - Maxlength int `yaml:"maxlength,omitempty"` - } `yaml:"questions"` - } `yaml:"subquestions,omitempty"` - } `yaml:"questions"` - - // default-static-values use-case - Defaultassets []struct { - Name string `yaml:"name"` - Value string `yaml:"value"` - } `yaml:"defaultassets"` - Defaultconfig []struct { - Name string `yaml:"name"` - Value string `yaml:"value"` - } `yaml:"defaultconfig"` -} -``` -refer to sample implemenation [here](#2a-creating-a-yaml-plugin) -### Limitations of Yaml plugins: - -Here the scope of yaml plugins is limited to drive survey, provide default values for job config and assets and provide plugin info. As majoiry of the plugins are expected to implement subset these use-cases, the support for yaml definitions for plugins is added which simplifies development, packaging and distribution of plugins. - -For plugins that require to enrich optimus server side behaviour, yaml definitions falls short as this would require some code. - -### Validating Yaml plugins: -Also support for validating yaml plugin is added into optimus. -After creating yaml definitions of plugin, one can validate them as below: -```bash -optimus plugin validate --path {{directory of yaml plugins}} -``` - -** Note: The yaml plugin is expected to have file name as `optimus-plugin-{{name}}.yaml` - -** Note: If Both yaml and binary plugin with same name are installed, Yaml implementation is prioritised over the corresponding counterparts in binary implemenation. -## Creating Plugin : Tutorial - -To demonstrate the above mentioned wrapping functionality, let's create a plugin in Go as well as a yaml definition and use python for actual transformation logic. You can choose to fork this [example](https://github.com/kushsharma/optimus-plugins) template and modify it as per your needs or start fresh. To demonstrate how to start from scratch, we will be starting from an empty git repository and build a plugin which will find potential hazardous **Near Earth Orbit** objects every day, let's call it **neo** for short. - -Brief description of Neo is as follows - -- Using [NASA API](https://api.nasa.gov/) we can get count of hazardous objects, their diameter and velocity. -- Task will need two config as input, `RANGE_START`, `RANGE_END` as date time string which will filter the count for this specific period only. -- Execute every day, say at 2 AM. -- Need a secret token that will be passed to NASA api endpoint for each request. -- Output of this object count can be printed in logs for now but in a real use case can be pushed to Kafka topic or written to a database. -- Plugin will be written in **Go** and **Neo** in **python**. - -### 1. Preparing task executor - -Start by initialising an empty git repository with the following folder structure - -```shell -.git -/task - /neo - /executor - /main.py - /requirements.txt - /Dockerfile -README.md -``` - -That is three folders one inside another. This might look confusing for now, a lot of things will, but just keep going. Create an empty python file in executor `main.py`, this is where the main logic for interacting with nasa api and generating output will be. For simplicity, lets use as minimal things as possible. - -Add the following code to `main.py` - -```python -import os -import requests -import json - -def start(): - """ - Sends a http call to nasa api, parses response and prints potential hazardous - objects in near earth orbit - :return: - """ - opt_config = fetch_config_from_optimus() - - # user configuration for date range - range_start = opt_config["envs"]["RANGE_START"] - range_end = opt_config["envs"]["RANGE_END"] - - secret_key = os.environ["SECRET_KEY"] - - # secret token required for NASA API being passed using job spec - api_key = json.loads(secret_key) - if api_key is None: - raise Exception("invalid api token") - - # send the request for given date range - r = requests.get(url="https://api.nasa.gov/neo/rest/v1/feed", - params={'start_date': range_start, 'end_date': range_end, 'api_key': api_key}) - - # extracting data in json format - print("for date range {} - {}".format(range_start, range_end)) - print_details(r.json()) - - return - - -def fetch_config_from_optimus(): - """ - Fetch configuration inputs required to run this task for a single schedule day - Configurations are fetched using optimus rest api - :return: - """ - # try printing os env to see what all we have for debugging - # print(os.environ) - - # prepare request - optimus_host = os.environ["OPTIMUS_HOSTNAME"] - scheduled_at = os.environ["SCHEDULED_AT"] - project_name = os.environ["PROJECT"] - job_name = os.environ["JOB_NAME"] - - r = requests.post(url="http://{}/api/v1/project/{}/job/{}/instance".format(optimus_host, project_name, job_name), - json={'scheduled_at': scheduled_at, - 'instance_name': "neo", - 'instance_type': "TASK"}) - instance = r.json() - - # print(instance) - return instance["context"] - - - -if __name__ == "__main__": - start() -``` - - - -`api_key` is a token provided by nasa during registration. This token will be passed as a parameter in each http call. `SECRET_PATH` is the path to a file which will contain this token in json and will be mounted inside the docker container by Optimus. - -`start` function is using `fetch_config_from_optimus()` to get the date range for which this task executes for an iteration. In this example, configuration is fetched using REST APIs provided by optimus although there are variety of ways to get them. After extracting `API_KEY` from secret file, unmarshalling it to json with ` json.load()` send a http request to nasa api. Response can be parsed and printed using the following function - -```python -def print_details(jd): - """ - Parse and calculate what we need from NASA endpoint response - - :param jd: json data fetched from NASA API - :return: - """ - element_count = jd['element_count'] - potentially_hazardous = [] - for search_date in jd['near_earth_objects'].keys(): - for neo in jd['near_earth_objects'][search_date]: - if neo["is_potentially_hazardous_asteroid"] is True: - potentially_hazardous.append({ - "name": neo["name"], - "estimated_diameter_km": neo["estimated_diameter"]["kilometers"]["estimated_diameter_max"], - "relative_velocity_kmh": neo["close_approach_data"][0]["relative_velocity"]["kilometers_per_hour"] - }) - - print("total tracking: {}\npotential hazardous: {}".format(element_count, len(potentially_hazardous))) - for haz in potentially_hazardous: - print("Name: {}\nEstimated Diameter: {} km\nRelative Velocity: {} km/h\n\n".format( - haz["name"], - haz["estimated_diameter_km"], - haz["relative_velocity_kmh"] - )) - return -``` - - - -Finish it off by adding the main function - -```python -if __name__ == "__main__": - start() -``` - - - -Add `requests` library in `requirements.txt` - -```ini -requests==v2.25.1 -``` - - - -Once the python code is ready, wrap this in a `Dockerfile` - -```dockerfile -# set base image (host OS) -FROM python:3.8 - -# set the working directory in the container -RUN mkdir -p /opt -WORKDIR /opt - -# copy the content of the local src directory to the working directory -COPY task/neo/executor . - -# install dependencies -RUN pip install -r requirements.txt - -CMD ["python3", "main.py"] -``` -### 2a. Creating a yaml plugin -The Yaml implementation is as simple as providing the plugin details as below. -```yaml -name: Neo -description: Near earth object tracker -plugintype: task -pluginversion: latest -image: ghcr.io/kushsharma/optimus-task-neo-executor -secretpath: /tmp/.secrets - -questions: -- name: RANGE_START - prompt: Date range start - help: YYYY-MM-DD format - required: true -- name: RANGE_END - prompt: Date range end - help: YYYY-MM-DD format - required: true -``` -Based on the usecase, additional validation can be added to the questions section. Refer [above](#yaml-implementation-of-plugin) for more usecases and features provided. - -### 2b. Creating a binary plugin - -At the moment Optimus supports task as well as hook plugins. In this section we will be explaining how to write a new task although both are very similar. - -Now that base image is ready for execution, this needs to be scheduled at a fixed interval using `jobs` but for optimus to understand **Neo** task, we need to write an adapter for it. - -#### Implementing plugin interface - -Because we are using Go, start by initialising Go module in `neo` directory as follows - -```go -go mod init github.com/kushsharma/optimus-plugins/task/neo -``` - -Prepare `main.go` in the same directory structure - -``` -.git -/task - /neo - /executor - /main.py - /requirements.txt - /Dockerfile - /main.go - /go.mod - /go.sum -README.md -``` - - - -Start by adding the following boilerplate code - -```go -package main - -import ( - "context" - "errors" - "fmt" - "strconv" - - "github.com/hashicorp/go-hclog" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/plugin" - "github.com/odpf/optimus/plugin/base" -) - -var ( - Name = "neo" - Version = "latest" - Image = "ghcr.io/kushsharma/optimus-task-neo-executor" -) - -type Neo struct{} - -func main() { - plugin.Serve(func(log hclog.Logger) interface{} { - return &Neo{ - log: log, - } - }) -} -``` - - - -The plugin binary serves a GRPC server on start but before the communication channel is created protocol version, socket, port, and some other metadata needs to be printed as the handshake information to stdout which the core will read. Plugin and core needs to mutually conclude on same protocol version to start the communication. Client side protocol version announcement is done using `HandshakeConfig` provided in `main()`. - -**Handshake contract:** -CORE-PROTOCOL-VERSION | APP-PROTOCOL-VERSION | NETWORK-TYPE | NETWORK-ADDR | PROTOCOL - -**For example:** - -1|1|tcp|127.0.0.1:1234|grpc - -You don't have to worry about this if you are using the provided `plugin.Serve` and all this happens automatically behind the scene. Core will initiate a connection with the plugin server as a client when the core binary boots and caches the connection for further internal use. - -A single binary can serve more than one kind of plugin, in this example stick with just one. Each plugin is composed of one `base` plugin implementation and some additional optional `mods`. - -#### Base Plugin - -Base plugin interface needs to be [implemented](https://github.com/odpf/proton/blob/54e0bec2df4235cabea4ac2127534a468584e932/odpf/optimus/plugins/base.proto) by every plugin. It is responsible for providing plugin metadata to Optimus core. - -```protobuf -syntax = "proto3"; -package odpf.optimus.plugins; - -// Base must be implemented by all plugins -service Base { - // PluginInfo provides basic details for this plugin - rpc PluginInfo(PluginInfoRequest) returns (PluginInfoResponse); -} - -// PluginType enumerates the type of plugins Optimus supports -enum PluginType { - PluginType_UNKNOWN = 0; - PluginType_TASK = 1; - PluginType_HOOK = 2; -} - -// PluginMod enumerates the type of mods this plugin supports -enum PluginMod { - PluginMod_UNKNOWN = 0; - PluginMod_CLI = 1; - PluginMod_DEPENDENCYRESOLVER = 2; -} - -// HookType enumerates the type of hook Optimus supports -enum HookType { - HookType_UNKNOWN = 0; - HookType_PRE = 1; - HookType_POST = 2; - HookType_FAIL = 3; -} - -message PluginInfoRequest {} -message PluginInfoResponse { - string name = 1; - string description = 2; - PluginType plugin_type = 3; - repeated PluginMod plugin_mods = 4; - - // plugin_version is the semver version of this individual plugin - string plugin_version = 5; - // api_versions indicates the versions of the Optimus Plugin API - // this plugin supports - repeated string api_version = 6; - - // docker image including version if this executes a docker image - string image = 10; - - // HOOK specific - // name of hooks on which this should depend on before executing - repeated string depends_on = 20; - HookType hook_type = 21; - - // Experimental - // will be mounted inside the container as volume - string secret_path = 30; -} -``` - -If your plugin simply wants to register itself as task or hook for execution and nothing else then that's it. You don't need to implement anything else but for additional features we can implement plugin `mod`. - -#### Plugin Mods - -Plugin can have none or many plugins mods being implemented at the same time. At the moment there are 2 mods available for usage - -1. [CLIMod](https://github.com/odpf/proton/blob/54e0bec2df4235cabea4ac2127534a468584e932/odpf/optimus/plugins/cli.proto): It provides plugin to interact with Optimus cli. Plugin can provide default configs, ask questions from users to create job specification, override default asset macro compilation behaviour, etc. -2. [DependencyResolverMod](https://github.com/odpf/proton/blob/54e0bec2df4235cabea4ac2127534a468584e932/odpf/optimus/plugins/dependency_resolver.proto): It provides plugin to implement automatic dependency resolution using assets/configs. - -In this example we will use the CLIMod. - -To start serving GRPC, either we write our own implementation for serialising/deserialising Go structs to protobufs or reuse the one already provided by [core](https://github.com/odpf/optimus/blob/eaa50bb37d7e738d9b8a94332312f34b04a7e16b/plugin/task/server.go). Optimus GRPC server accepts an interface which we will implement next on Neo struct. Custom protobuf adapter can also be written using the [provided](https://github.com/odpf/proton/blob/54e0bec2df4235cabea4ac2127534a468584e932/odpf/optimus/plugins/base.proto) protobuf stored in odpf [repository](https://github.com/odpf/proton). - -Add the following code in the existing `main.go` as an implementation to [BasePlugin](https://github.com/odpf/proton/blob/54e0bec2df4235cabea4ac2127534a468584e932/odpf/optimus/plugins/base.proto) - -```go -type Neo struct{} - -// GetSchema provides basic task details -func (n *Neo) PluginInfo() (*models.PluginInfoResponse, error) { - return &models.PluginInfoResponse{ - Name: Name, - Description: "Near earth object tracker", - PluginType: models.PluginTypeTask, - PluginMods: []models.PluginMod{models.ModTypeCLI}, - PluginVersion: Version, - APIVersion: []string{strconv.Itoa(base.ProtocolVersion)}, - - // docker image that will be executed as the actual transformation task - Image: fmt.Sprintf("%s:%s", Image, Version), - }, nil -} -``` - -You might have noticed we have specified at line number 9 that we are supporting `models.ModTypeCLI`. This will let Optimus know what all this plugin is capable of. Let's implement the [CLIMod](https://github.com/odpf/proton/blob/54e0bec2df4235cabea4ac2127534a468584e932/odpf/optimus/plugins/cli.proto) now. - - -```go -// GetQuestions provides questions asked via optimus cli when a new job spec -// is requested to be created -func (n *Neo) GetQuestions(ctx context.Context, req models.GetQuestionsRequest) (*models.GetQuestionsResponse, error) { - tQues := []models.PluginQuestion{ - { - Name: "Start", - Prompt: "Date range start", - Help: "YYYY-MM-DD format", - }, - { - Name: "End", - Prompt: "Date range end", - Help: "YYYY-MM-DD format", - }, - } - return &models.GetQuestionsResponse{ - Questions: tQues, - }, nil -} - -// ValidateQuestion validate how stupid user is -// Each question config in GetQuestions will send a validation request -func (n *Neo) ValidateQuestion(ctx context.Context, req models.ValidateQuestionRequest) (*models.ValidateQuestionResponse, error) { - var err error - switch req.Answer.Question.Name { - case "Start": - err = func(ans interface{}) error { - d, ok := ans.(string) - if !ok || d == "" { - return errors.New("not a valid string") - } - // can choose to parse here for a valid date but we will use optimus - // macros here {{.DSTART}} instead of actual dates - // _, err := time.Parse(time.RFC3339, d) - // return err - return nil - }(req.Answer.Value) - case "End": - err = func(ans interface{}) error { - d, ok := ans.(string) - if !ok || d == "" { - return errors.New("not a valid string") - } - // can choose to parse here for a valid date but we will use optimus - // macros here {{.DEND}} instead of actual dates - // _, err := time.Parse(time.RFC3339, d) - // return err - return nil - }(req.Answer.Value) - } - if err != nil { - return &models.ValidateQuestionResponse{ - Success: false, - Error: err.Error(), - }, nil - } - return &models.ValidateQuestionResponse{ - Success: true, - }, nil -} - -func findAnswerByName(name string, answers []models.PluginAnswer) (models.PluginAnswer, bool) { - for _, ans := range answers { - if ans.Question.Name == name { - return ans, true - } - } - return models.PluginAnswer{}, false -} - -// DefaultConfig are a set of key value pair which will be embedded in job -// specification. These configs can be requested by the docker container before -// execution -// PluginConfig Value can contain valid go templates and they will be parsed at -// runtime -func (n *Neo) DefaultConfig(ctx context.Context, request models.DefaultConfigRequest) (*models.DefaultConfigResponse, error) { - start, _ := findAnswerByName("Start", request.Answers) - end, _ := findAnswerByName("End", request.Answers) - - conf := []models.PluginConfig{ - { - Name: "RANGE_START", - Value: start.Value, - }, - { - Name: "RANGE_END", - Value: end.Value, - }, - } - return &models.DefaultConfigResponse{ - Config: conf, - }, nil -} - -// DefaultAssets are a set of files which will be embedded in job -// specification in assets folder. These configs can be requested by the -// docker container before execution. -func (n *Neo) DefaultAssets(ctx context.Context, _ models.DefaultAssetsRequest) (*models.DefaultAssetsResponse, error) { - return &models.DefaultAssetsResponse{}, nil -} - -// override the compilation behaviour of assets - if needed -func (n *Neo) CompileAssets(ctx context.Context, req models.CompileAssetsRequest) (*models.CompileAssetsResponse, error) { - return &models.CompileAssetsResponse{ - Assets: req.Assets, - }, nil -} -``` - - - -All the functions are prefixed with comments to give you basic idea of what each one is doing, for advanced usage, look at other plugins used in the wild. - -Few things to note: - -- `PluginInfo` is used to define a unique `name` used by your plugin to identify yourself, keep it simple. -- `PluginInfo` contains `Image` field that specify the docker image which Optimus will execute when needed. This is where the neo python image will go. -- `Version` field can be injected using build system, here we are only keeping a default value. -- `PluginType` in `PluginInfo` will tell of this plugin should be read as `Task` or `Hook` by Optimus core. - - - -### Building everything - -Once the code is ready, to build there is a pretty nice tool available for golang [goreleaser](https://github.com/goreleaser/goreleaser/). A single configuration file will contain everything to build the docker image as well as the binary. - -Put this in the root of the project as `.goreleaser.yml` - -```yaml -builds: - - dir: ./task/neo - main: . - id: "neo" - binary: "optimus-neo_{{.Os}}_{{.Arch}}" - ldflags: - - -s -w -X main.Version={{.Version}} -X main.Image=ghcr.io/kushsharma/optimus-task-neo-executor - goos: - - linux - - darwin - - windows - goarch: - - amd64 - - arm64 - env: - - CGO_ENABLED=0 -archives: - - replacements: - darwin: darwin - linux: linux - windows: windows - amd64: amd64 - format_overrides: - - goos: windows - format: zip -release: - prerelease: auto -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' -dockers: - - - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/kushsharma/optimus-task-neo-executor:latest" - - "ghcr.io/kushsharma/optimus-task-neo-executor:{{ .Version }}" - dockerfile: ./task/neo/executor/Dockerfile - extra_files: - - task/neo/executor - -brews: - - name: optimus-plugins-kush - install: | - bin.install Dir["optimus-*"] - tap: - owner: kushsharma - name: homebrew-taps - license: "Apache 2.0" - description: "Optimus plugins - [Optimus Near earth orbit tracker]" - commit_author: - name: Kush Sharma - email: 3647166+kushsharma@users.noreply.github.com -``` - -Please go through goreleaser documentation to understand what this config is doing but just to explain briefly - -- It will build golang task plugin adapter for multiple platforms, archives them and release on Github -- Build and push the docker image for the python neo task -- Create a Formula for installing this plugin on Mac using brew -- Each plugin will follow the binary naming convention as `optimus-__`. For example: `optimus-bq2bq_linux_amd64` - -Once installed, run goreleaser using - -```shell -goreleaser --snapshot --rm-dist -``` - -Use this [repository](https://github.com/kushsharma/optimus-plugins) as an example to see how everything fits in together. It uses github workflows to run goreleaser and publish everything. - -## How to use - -### Installing a plugin - -Plugins need to be installed in Optimus server before it can be used. Optimus uses following directories for discovering plugin binaries -``` -./.plugins -./ -/ -/.optimus/plugins -$HOME/.optimus/plugins -/usr/bin -/usr/local/bin -``` -Even though the above list of directories are involved in plugin discovery, it is advised to use `.plugins` in the current working directory of the project or optimus binary. - -### Server-side installation -On Server side, plugins (both binary and yaml) can be installed declaratively at runtime by listing the plugin artifacts in plugins section of server config. -```bash -optimus plugin install -c config.yaml # This will install plugins in `.plugins` folder. -``` -Plugin section to be added in server config: -```yaml -plugin: - artifacts: - - https://...path/to/optimus-plugin-neo.yaml # http - - http://.../plugins.zip # zip - - ../transformers/optimus-bq2bq_darwin_arm64 # relative paths - - ../transformers/optimus-plugin-neo.yaml -``` -### Project-side installation -On the project side, where optimus cli is used to generate specifications or deployment, optimus cli can sync the yaml plugins supported-and-served by optimus server (with host as declared in project config). - -```bash -optimus plugin sync -c optimus.yaml # This will install plugins in `.plugins` folder. -``` - -### Using in job specification - -Once everything is built and in place, we can generate job specifications that uses **neo** as the task type. - -```shell -optimus create job -? What is the job name? is_last_day_on_earth -? Who is the owner of this job? kush.sharma@example.io -? Which task to run? neo -? Specify the start date 2021-05-25 -? Specify the interval (in crontab notation) 0 2 * * * -? Transformation window daily -? Date range start {{.DSTART}} -? Date range end {{.DEND}} -job created successfully is_last_day_on_earth -``` - -Create a commit and deploy this specification if you are using optimus with a git managed repositories or send a REST call or use GRPC, whatever floats your boat. - -### Checking the output - -If your optimus deployment is using Airflow as the scheduling engine, open the task log and verify something like this - -``` -total tracking: 14 -potential hazardous: 1 -Name: (2014 KP4) -Estimated Diameter: 0.8204270649 km -Relative Velocity: 147052.9914506647 km/h -``` - -## Additional details - -A task is like a pipeline, it takes some input, it runs a procedure on the input and then produces an output. Procedure is wrapped inside the docker image, output is owned by the procedure which could be anything but input should be injected somehow by optimus or at least provide some information about where/what input is. Currently, Optimus supports two kind of inputs: - -- Key value configuration -- File assets - -##### Task Configuration - -Task configurations are key value pair provided as part of job specification in `job.yaml` file. These are based on plugin implementation of `TaskPlugin` interface. These configurations accept simple strings as well as Optimus [macros](../concepts/overview.md#Macros-&-Templates). There are few Optimus provided configuration to all tasks and hooks even if users don't specifically provide them: - -- DSTART -- DEND -- EXECUTION_TIME - -Secrets can be used in the task configuration by using macros like ` SECRET_PATH: "{{.secret.api_key_path}}" `. -Where `api_key_path` is a value stored inside secrets. This configuration in macros will be replaced by optimus serer while sending a request to the plugin with actual value and can be used by the plugin. In the executor of the plugin, this configuration will be made available as environment variable. - -##### File Assets - -Sometimes a task may need more than just key value configuration, this is where assets can be used. Assets are packed along with the job specification and should have unique names. A task can have more than one asset file but if any file name conflicts with any already existing plugin in the optimus, it will throw an error, so it is advised to either prefix them or name them very specific to the task. These assets should ideally be small and not more than ~5 MB and any heavy lifting if required should be done directly inside the task container. - -### Requesting task context - -Optimus calls these task configuration and asset inputs for each scheduled execution of a task as `context`. There are variety of ways to fetch task context from optimus. - -- REST API -- GRPC function call -- Optimus cli - -##### REST API - -This is probably the easiest way using [REST API](https://github.com/odpf/optimus/blob/0ab5a4d44a7b2b85e9a160aef3648d8ba798536a/third_party/OpenAPI/odpf/optimus/runtime_service.swagger.json#L187) provided by optimus server. Each container when boots up has few pre-defined environment variables injected by optimus, few of them are: - -- JOB_NAME -- OPTIMUS_HOSTNAME -- JOB_DIR -- PROJECT -- SCHEDULED_AT -- INSTANCE_TYPE -- INSTANCE_NAME - -These variables might be needed to make the call and in response, container should get configuration and files as key value pairs in json. - -##### GRPC call - -Plugin can choose to make a GRPC call using `RegisterInstance` [function](https://github.com/odpf/proton/blob/main/odpf/optimus/runtime_service.proto#L124) and should get the context back in return. - -##### Optimus cli - -There could be scenarios where it is not possible or maybe not convenient to modify the base execution image and still task need context configuration values. One easy way to do this is by wrapping the base docker image into another docker image and using optimus binary to request task context. Optimus command will internally send a GRPC call and store the output in `${JOB_DIR}/in/` directory. It will create one `.env` file containing all the configurations, one `.secret` file with environment variables with potentially sensitive values, and all the asset files belong to the provided task. Optimus command can be invoked as - -```shell -OPTIMUS_ADMIN_ENABLED=1 /opt/optimus admin build instance $JOB_NAME --project $PROJECT --output-dir $JOB_DIR --type $INSTANCE_TYPE --name $INSTANCE_NAME --scheduled-at $SCHEDULED_AT --host $OPTIMUS_HOSTNAME -``` - -You might have noticed, optimus need OPTIMUS_ADMIN_ENABLED as env variable to enable admin commands. An example of wrapper `Dockerfile` is as follows - -```dockerfile -FROM ghcr.io/kushsharma/optimus-task-neo-executor:latest - -# path to optimus release tar.gz -ARG OPTIMUS_RELEASE_URL - -RUN apt install curl tar -y -RUN mkdir -p /opt -RUN curl -sL ${OPTIMUS_RELEASE_URL} | tar xvz optimus -RUN mv optimus /opt/optimus || true -RUN chmod +x /opt/optimus - -# or copy like this -COPY task/neo/example.entrypoint.sh /opt/entrypoint.sh -RUN chmod +x /opt/entrypoint.sh - -ENTRYPOINT ["/opt/entrypoint.sh"] -CMD ["python3", "/opt/main.py"] -``` - -Where `entrypoint.sh` is as follows - -```shell -#!/bin/sh -# wait for few seconds to prepare scheduler for the run -sleep 5 - -# get resources -echo "-- initializing optimus assets" -OPTIMUS_ADMIN_ENABLED=1 /opt/optimus admin build instance $JOB_NAME --project $PROJECT --output-dir $JOB_DIR --type $TASK_TYPE --name $TASK_NAME --scheduled-at $SCHEDULED_AT --host $OPTIMUS_HOSTNAME - -# TODO: this doesnt support using back quote sign in env vars -echo "-- exporting env" -set -o allexport -source $JOB_DIR/in/.env -set +o allexport - -echo "-- current envs" -printenv - -echo "-- exporting secret envs" -set -o allexport -source $JOB_DIR/in/.secret -set +o allexport - -echo "-- running unit" -exec $(eval echo "$@") -``` - -All of it can be built using goreleaser as well - -```yaml -dockers: - - - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/kushsharma/optimus-task-neo:latest" - - "ghcr.io/kushsharma/optimus-task-neo:{{ .Version }}" - dockerfile: ./task/neo/example.Dockerfile - extra_files: - - task/neo/example.entrypoint.sh - build_flag_templates: - - "--build-arg=OPTIMUS_RELEASE_URL=https://github.com/odpf/optimus/releases/download/v0.0.1-rc.2/optimus_0.0.1-rc.2_linux_x86_64.tar.gz" -``` - -Keep in mind, the plugin binary now needs to point to this `optimus-task-neo` docker image and not the base one. An example of this approach can be checked in the provided [repository](https://github.com/kushsharma/optimus-plugins). - -### Directory Structure - -You might have already understood it by now but still just to state, the reason we went ahead with the provided directory structure earlier so that we can support more than one task and even hooks if we need to in the same repository. Image a single repository of plugins as an organization repository where one can find all that can be contributed by an entity - -``` -/task - /neo - /executor - /main.py - /requirements.txt - /Dockerfile - /main.go - /go.mod - /go.sum - /task-2 - /task-3 -/hook - /hook-1 - /hook-2 -.goreleaser.yml -README.md -``` - -### Secret management - -You must be wondering from where that api token came from when we said it will be mounted inside the container. Optimus need to somehow know what the secret is, for this current implementation of optimus relies on Kubernetes [Secrets](https://kubernetes.io/docs/concepts/configuration/secret/). Optimus is built to be deployed on kubernetes, although it can work just fine without it as well but might need some tweaking here and there. An example of creating this secret - -```yaml -apiVersion: v1 -kind: Secret -metadata: - name: optimus-task-neo -type: Opaque -data: - key.json: base64encodedAPIkeygoes -``` - -Notice the name of the secret `optimus-task-neo` which is actually based on a convention. That is if secret is defined, Optimus will look in kubernetes using `optimus-task-` as the secret name and mount it to the path provided in `SecretPath` field of `PluginInfo`. - -There is also a new way to using secrets in the job for a plugin or otherwise, we can store a user defined secret in the optimus server with the following command -```shell -optimus secret set secret_name -``` -Verify if the secret is registered properly with optimus server using following command -```shell -optimus secret list -``` -It should list the secret registered above. - -Then we can mention the secret in the job spec configuration like mentioned in the Task Configuration section. The configuration with secrets will be made available to the calls to plugins on dependency mod, and set as environment variable in the executor used by the scheduler. - diff --git a/docs/docs/getting-started/configuration.md b/docs/docs/getting-started/configuration.md deleted file mode 100644 index 4ffd57db42..0000000000 --- a/docs/docs/getting-started/configuration.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -id: configuration -title: Configurations ---- - -## Client Configuration - -### Initialization - -Client configuration can be initialized using Optimus. -To do so, use Optimus `init` command. -An interactive questionaire will be presented, such as below: - -```zsh -$ optimus init - -? What is the Optimus service host? [? for help] localhost:9100 -? What is the Optimus project name? local-project -? What is the namespace name? namespace1 -? What is the type of data store for this namespace? bigquery -? Do you want to add another namespace? No -Client config is initialized successfully -If you want to modify, go to [optimus.yaml] -``` - -After running the `init` command, Optimus client config will be configured. -Along with it is the directories for the chosen namespaces. -For example, since the above example only specifies _namespace1_, then directory _namespace1_ will be created along with `optimus.yaml` client config. - -The user can optionally update the `optimus.yaml` file if necessary. -For clearer example, see client configuration example on `optimus.sample.yaml` - -### Usage - -Optimus client configuration can be loaded from file (use `--config` flag), or `optimus.yaml` file in current working directory where the Optimus command is executed. - ---- -**1. Using --config flag** - -```sh -$ optimus deploy --config /path/to/config/file.yaml -``` - ---- -**2. Using default optimus.yaml file** - -```sh -$ tree -. # current project structure -├── namespace-1 -│   └── jobs -│   └── resources -├── namespace-2 -│   └── jobs -│   └── resources -└── optimus.yaml # use this file -$ optimus deploy -``` - ---- - -If both `--config` flag and `optimus.yaml` do exist, then the one will be used is the file defined in `--config` flag. - -## Server Configuration - -See server configuration example on `config.sample.yaml` - -Optimus server configuration can be loaded from file (use `--config` flag), environment variable `OPTIMUS_`, or `config.yaml` file in executable directory. - ---- -**1. Using --config flag** -```sh -$ optimus serve --config /path/to/config/file.yaml -``` - ---- -**2. Using environment variable** - -All the configs can be passed as environment variables using `OPTIMUS_` convention. `` is the key name of config using `_` as the path delimiter to concatenate between keys. - -For example, to use environment variable, assuming the following configuration layout: - -```yaml -version: 1 -serve: - port: 9100 - app_key: randomhash -``` - -Here is the corresponding environment variable for the above - -Configuration key | Environment variable | -------------------|----------------------| -version | OPTIMUS_VERSION | -serve.port | OPTIMUS_PORT | -serve.app_key | OPTIMUS_SERVE_APP_KEY| - -Set the env variable using export -```sh -$ export OPTIMUS_PORT=9100 -``` - ---- -**3. Using default config.yaml from executable binary directory** -```sh -$ which optimus -/usr/local/bin/optimus -``` - -So the `config.yaml` file can be loaded on `/usr/local/bin/config.yaml` - ---- - -If user specify configuration file using `--config` flag, then any configs defined in env variable and default config.yaml from exec directory will not be loaded. - -If user specify the env variable and user also have config.yaml from exec directory, then any key configs from env variable will override the key configs defined in config.yaml from exec directory. - ---- - -App key is used to encrypt credentials and can be randomly generated using -```shell -head -c 50 /dev/random | base64 -``` -Just take the first 32 characters of the string. \ No newline at end of file diff --git a/docs/docs/getting-started/installation.md b/docs/docs/getting-started/installation.md index 9fce6bf586..69f760c40a 100644 --- a/docs/docs/getting-started/installation.md +++ b/docs/docs/getting-started/installation.md @@ -1,58 +1,66 @@ # Installation -Installing Optimus on any system is straight forward. We provide pre-built [binaries](https://github.com/odpf/optimus/releases), -Docker Images and support package managers. +Installing Optimus on any system is straight forward. There are several approaches to install Optimus: -## MacOS +- Using a pre-built binary +- Installing with package manager +- Installing with Docker +- Installing from source -You can install Optimus using homebrew on macOS: +## Using a Pre-built Binary + +The client and server binaries are downloadable at the [releases](https://github.com/raystack/optimus/releases) section. + +Once installed, you should be able to run: ```shell -brew install odpf/tap/optimus -optimus version +$ optimus version ``` -## Download Binaries +## Installing with Package Manager -The client and server binaries are downloadable at the releases tab. There is -currently no installer available. You have to add the Optimus binary to the PATH -environment variable yourself or put the binary in a location that is already -in your $PATH (e.g. /usr/local/bin, ...). +For macOS, you can install Optimus using homebrew: -Once installed, you should be able to run: +```shell +$ brew install raystack/tap/optimus +$ optimus version +``` + +## Installing using Docker + +To pull latest image: ```shell -optimus version +$ docker pull raystack/optimus:latest ``` -## Compiling from source +To pull specific image: + +```shell +$ docker pull raystack/optimus:0.6.0 +``` + +## Installing from Source ### Prerequisites Optimus requires the following dependencies: -- Golang (version 1.16 or above) +- Golang (version 1.18 or above) - Git ### Build -Run the following commands to compile `optimus` from source +Run the following commands to compile optimus from source ```shell -git clone git@github.com:odpf/optimus.git -cd optimus -make build +$ git clone git@github.com:raystack/optimus.git +$ cd optimus +$ make build ``` Use the following command to test ```shell -./optimus version -``` - -Optimus service can be started with the following command although there are few required -[configurations](./configuration.md) for it to start. - -```shell -./optimus serve +$ optimus version ``` diff --git a/docs/docs/getting-started/quick-start.md b/docs/docs/getting-started/quick-start.md new file mode 100644 index 0000000000..aca34b2394 --- /dev/null +++ b/docs/docs/getting-started/quick-start.md @@ -0,0 +1,344 @@ +# Quickstart + +This quick start will guide you to try out Optimus fast without getting into many details. As part of this, you will +be provided with step-by-step instructions to start Optimus server, connect Optimus client with server, create +BigQuery resource through Optimus, create BigQuery to BigQuery job, and deploy it. + +## Prerequisite + +- Docker or a local installation of Optimus. +- [Postgres](https://www.postgresql.org/download/) database. +- BigQuery project +- [Airflow](https://airflow.apache.org/docs/apache-airflow/stable/installation/index.html) + - This is not mandatory to complete the quick start, but needed for scheduling jobs. + +## Step 1: Start Server + +Start server with Raystack’s BigQuery to BigQuery [plugin](https://github.com/raystack/transformers). + +Create a config.yaml file: + +```yaml +version: 1 + +log: + level: debug + +serve: + port: 9100 + host: localhost + ingress_host: localhost:9100 + app_key: + db: + dsn: postgres://@localhost:5432/dbname?sslmode=disable + +plugin: + artifacts: + - https://github.com/raystack/transformers/releases/download/v0.2.1/transformers_0.2.1_macos_x86_64.tar.gz +``` + +_Note: make sure you put artifacts link that suitable to your system._ + +### Start Server + +With the config.yaml available in the same working directory, you can start server by running: + +```shell +$ optimus serve --install-plugins +``` + +This will automatically install the plugins as specified in your server configuration. + +## Step 2: Connect Client With Server + +Go to the directory where you want to have your Optimus specifications. Create client configuration by using +optimus `init` command. An interactive questionnaire will be presented, such as below: + +```shell +$ optimus init + +? What is the Optimus service host? localhost:9100 +? What is the Optimus project name? sample_project +? What is the namespace name? sample_namespace +? What is the type of data store for this namespace? bigquery +? Do you want to add another namespace? No +Client config is initialized successfully +``` + +After running the init command, Optimus client config will be configured. Along with it, the directories for the chosen +namespaces, including the subdirectories for jobs and resources will be created with the following structure: + +``` +sample_project +├── sample_namespace +│ └── jobs +│ └── resources +└── optimus.yaml +``` + +Below is the client configuration that has been generated: + +```yaml +version: 1 +log: + level: INFO + format: "" +host: localhost:9100 +project: + name: sample_project + config: {} +namespaces: + - name: sample_namespace + config: {} + job: + path: sample_namespace/jobs + datastore: + - type: bigquery + path: sample_namespace/resources + backup: {} +``` + +Let’s add `storage_path` project configuration that is needed to store the result of job compilation and +`scheduler_host` which is needed for compilation. + +```yaml +project: + name: sample_project + config: + storage_path: file:///Users/sample_user/optimus/sample_project/compiled + scheduler_host: http://sample-host +``` + +_Note: storage path is the location where airflow is reading its dags from._ + +Now, let's register `sample_project` and `sample_namespace` to your Optimus server. + +```shell +$ optimus project register --with-namespaces +``` + +You can verify if the project has been registered successfully by running this command: + +```shell +$ optimus project describe +``` + +## Step 3: Create BigQuery resource + +Before creating BigQuery resources, make sure your Optimus server has access to your BQ project by adding a +`BQ_SERVICE_ACCOUNT` secret. + +Assume you have your service account json file in the same directory (project directory), create the secret using the +following command. Make sure the service account that you are using is authorized to create tables. + +```shell +$ optimus secret set BQ_SERVICE_ACCOUNT --file service_account.json +``` + +Check whether the secret has been registered successfully by running this command. + +```shell +$ optimus secret list +``` + +Now, let’s create a resource using the following interactive command. + +```shell +$ optimus resource create + +? Please choose the namespace: sample_namespace +? What is the resource name? sample-project.sample_namespace.table1 +? What is the resource type? table +? Provide new directory name to create for this spec? [sample_namespace/resources] sample-project.sample_namespace.table1 + +Resource spec [sample-project.sample_namespace.table1] is created successfully +``` + +_Note: resource name should be unique within the project. Take a look at the complete guide on how to create resource +[here](../client-guide/manage-bigquery-resource.md) if needed._ + +After running the command, the resource specification file will be automatically created in the following directory: + +``` +sample_project +├── sample_namespace +│ └── jobs +│ └── resources +| └── sample-project.sample_namespace.table1 +| └── resource.yaml +└── optimus.yaml +``` + +Let’s open the resource.yaml file and add additional spec details as follows: + +```yaml +version: 1 +name: sample-project.sample_namespace.table1 +type: table +labels: {} +spec: + description: "sample optimus quick start table" + schema: + - name: sample_day + type: STRING + mode: NULLABLE + - name: sample_timestamp + type: TIMESTAMP + mode: NULLABLE +``` + +Now that resource specification is complete, let’s deploy this to the Optimus server and it will create the resource +in BigQuery. + +```shell +$ optimus resource upload-all --verbose + +> Validating namespaces +namespace validation finished! + +> Uploading all resources for namespaces [sample_namespace] +> Deploying bigquery resources for namespace [sample_namespace] +> Receiving responses: +[success] sample-project.sample_namespace.table1 +resources with namespace [sample_namespace] are deployed successfully +finished uploading resource specifications to server! +``` + +## Step 4: Create & Deploy Job + +Sync plugins to your local for optimus to provide an interactive UI to add jobs, this is a prerequisite before +creating any jobs. + +```shell +$ optimus plugin sync +``` + +Let’s verify if the plugin has been synced properly by running below command. + +```shell +$ optimus version +``` + +You should find `bq2bq` plugin in the list of discovered plugins. + +To create a job, we need to provide a job specification. Let’s create one using the interactive optimus job command. + +```shell +$ optimus job create +? Please choose the namespace: sample_namespace +? Provide new directory name to create for this spec? [.] sample-project.sample_namespace.table1 +? What is the job name? sample-project.sample_namespace.table1 +? Who is the owner of this job? sample_owner +? Select task to run? bq2bq +? Specify the schedule start date 2023-01-26 +? Specify the schedule interval (in crontab notation) 0 2 * * * +? Transformation window daily +? Project ID sample-project +? Dataset Name sample_namespace +? Table ID table1 +? Load method to use on destination REPLACE +Job successfully created at sample-project.sample_namespace.table1 +``` + +_Note: take a look at the details of job creation [here](../client-guide/create-job-specifications.md)._ + +After running the job create command, the job specification file and assets directory are created in the following directory. + +``` +├── sample_namespace +│ └── jobs +| └── sample-project.sample_namespace.table1 +| └── assets +| └── query.sql +| └── job.yaml +│ └── resources +| └── sample-project.sample_namespace.table1 +| └── resource.yaml +└── optimus.yaml +``` + +For BQ2BQ job, the core transformation logic lies in `assets/query.sql`. Let’s modify the query to the following script: + +```sql +SELECT +FORMAT_DATE('%A', CAST("{{ .DSTART }}" AS TIMESTAMP)) AS `sample_day`, +CAST("{{ .DSTART }}" AS TIMESTAMP) AS `sample_timestamp`; +``` + +_Note: take a look at Optimus’ supported macros [here](../concepts/macros.md)._ + +Let’s also verify the generated job.yaml file. + +```yaml +version: 1 +name: sample-project.sample_namespace.table1 +owner: sample_owner +schedule: + start_date: "2023-01-26" + interval: 0 2 * * * +behavior: + depends_on_past: false +task: + name: bq2bq + config: + DATASET: sample_namespace + LOAD_METHOD: REPLACE + PROJECT: sample-project + SQL_TYPE: STANDARD + TABLE: table1 +window: + size: 24h + offset: "0" + truncate_to: d +labels: + orchestrator: optimus +hooks: [] +dependencies: [] +``` + +For this quick start, we are not adding any hooks, dependencies, or alert configurations. Take a look at the details +of job specification and the possible options [here](../client-guide/create-job-specifications.md#understanding-the-job-specifications). + +Before proceeding, let’s add the BQ_SERVICE_ACCOUNT secret in the task configuration. + +```yaml +task: + name: bq2bq + config: + BQ_SERVICE_ACCOUNT: "{{.secret.BQ_SERVICE_ACCOUNT}}" + DATASET: sample_namespace +``` + +Later, you can avoid having the secret specified in every single job specification by adding it in the parent yaml +specification instead. For more details, you can take a look [here](../client-guide/organizing-specifications.md). + +Now the job specification has been prepared, lets try to add it to the server by running this command: + +```shell +$ optimus job replace-all --verbose + +> Validating namespaces +validation finished! + +> Replacing all jobs for namespaces [sample_namespace] +> Receiving responses: +[sample_namespace] received 1 job specs +[sample_namespace] found 1 new, 0 modified, and 0 deleted job specs +[sample_namespace] processing job job1 +[sample_namespace] successfully added 1 jobs +replace all job specifications finished! +``` + +Above command will try to add/modify all job specifications found in your project. We are not providing registering +a single job through Optimus CLI, but it is possible to do so using API. + +Now that the jobs has been registered to Optimus, let’s compile and upload it to the scheduler by using the following command. + +```shell +$ optimus scheduler upload-all +``` + +The command will try to compile your job specification to the DAG file. The result will be stored in the `storage_path` +location as you have specified when configuring the optimus.yaml file. + +Later, once you have Airflow ready and want to try out, this directory can be used as a source to be scheduled by Airflow. diff --git a/docs/docs/guides/adding-hook.md b/docs/docs/guides/adding-hook.md deleted file mode 100644 index f2113d9fb0..0000000000 --- a/docs/docs/guides/adding-hook.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -id: adding-hook -title: Adding hook to a Job ---- - -There might be a certain operations that you might want to run before or after the Job. -Please go through [concepts](../concepts/overview.md) to know more about it. - -In order to add a hook to an existing Job, run the following command and answer the -corresponding prompts: - -``` -$ ./optimus job addhook -? Select a Job example_job -? Which hook to run? transporter -? Filter expression for extracting transformation rows? event_timestamp >= '{{.DSTART}}' - AND event_timestamp < '{{.DEND}}' -``` - -With the above prompt, we're adding the *transporter* hook *post* the execution of -primary job. Filter expression configuration is specific to a transporter hook, -and it might be different for other hooks. - -After this, existing job.yaml file will get updated with the new hook config, and -the job specification would look like: - -```yaml -version: 1 -name: example_job -owner: example@example.com -description: example job to demonstrate hook -schedule: - start_date: "2021-02-18" - interval: 0 3 * * * -behavior: - depends_on_past: false - catch_up: true -task: - name: bq2bq - config: - DATASET: data - LOAD_METHOD: APPEND - PROJECT: example - SQL_TYPE: STANDARD - TABLE: hello_table - window: - size: 24h - offset: "0" - truncate_to: d -labels: - orchestrator: optimus -dependencies: [] -hooks: -- name: transporter - config: - BQ_DATASET: '{{.TASK__DATASET}}' # inherited from task configs - BQ_PROJECT: '{{.TASK__PROJECT}}' - BQ_TABLE: '{{.TASK__TABLE}}' - FILTER_EXPRESSION: 'event_timestamp >= "{{.DSTART}}" AND event_timestamp < "{{.DEND}}"' - KAFKA_TOPIC: optimus_example-data-hello_table - PRODUCER_CONFIG_BOOTSTRAP_SERVERS: '{{.GLOBAL__TRANSPORTER_KAFKA_BROKERS}}' - PROTO_SCHEMA: example.data.HelloTable - STENCIL_URL: '{{.GLOBAL__TRANSPORTER_KAFKA_BROKERS}}' # will be defined as global config -``` - -Now to finish this, create a commit and push changes to target repository. -The gitlab pipeline is idempotent and hence Optimus will handle the new -specifications accordingly. \ No newline at end of file diff --git a/docs/docs/guides/alerts.md b/docs/docs/guides/alerts.md deleted file mode 100644 index 204af28df8..0000000000 --- a/docs/docs/guides/alerts.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -id: alerts -title: Alerts ---- - -User needs to be alerted on specific events on jobs: -* There are two specific events on which a users can configure alerts as of today, `sla_miss` and `failure` -* Add the below sample configuration in your jobspec to configure the alerts. - -Sample configuration -```yaml -behavior: - notify: - - 'on': failure/sla_miss - config : - duration : 2h45m - channels: - - slack://#slack-channel or @team-group or user&gmail.com - - pagerduty://#pagerduty_service_name -``` - -* sla_miss expects a duration config expect users to provide the duration as string. -* slack alerting is supported now which users can configure to channel or team handle or a specific user. -* for pagerduty alerts to work, ```notify_``` secret with pagerduty integration key/routing key needs to be registered with optimus. diff --git a/docs/docs/guides/backup.md b/docs/docs/guides/backup.md deleted file mode 100644 index efa9c85bb8..0000000000 --- a/docs/docs/guides/backup.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -id: backup -title: Backup Resources ---- - -Backup is a common prerequisite step to be done before re-running or modifying a resource. Currently, Optimus supports -backup for BigQuery tables and provides dependency resolution, so backup can be also done to all the downstream tables -as long as it is registered in Optimus and within the same project. - -## Configuring backup details - -Several configurations can be set to have the backup result in your project as your preference. Here are the -available configurations for BigQuery datastore. - -Configuration key | Description | Default | -------------------|------------------------------------------|----------------| -ttl | Time to live in duration | 720h | -prefix | Prefix of the result table name | backup | -dataset | Where the table result should be located | optimus_backup | - -These values can be set in the project [configuration](../getting-started/configuration.md). - - -## Run a backup - -To start a backup, run the following command: - -```shell -$ optimus backup create --resource "resource_name" --project sample-project --namespace sample-namespace -``` - -After you run the command, prompts will be shown. You will need to answer the questions. - -``` -$ optimus backup create --resource "resource_name" --project sample-project --namespace sample-namespace -? Select supported datastore? bigquery -? Why is this backup needed? backfill due to business logic change -? Backup downstream? Yes -``` - -You will be shown a list of resources that will be backed up, including the downstream resources (if you chose to do so). -You can confirm to proceed if the list is as expected, and please wait until the backup is finished. - -Once the backup is finished, the list of backup results along with where it is located will be shown. - - -## Get list of backups - -List of recent backups of a project can be checked using this sub command: - -```shell -$ optimus backup list --project sample-project -``` - -Recent backup ID including the resource, when it was created, what is the description or purpose of the backup will be -shown. Backup ID is used as a postfix in backup result name, thus you can find those results in the datastore -(for example BigQuery) using the backup ID. However, keep in mind that these backup results have expiry time set. - -## Run a backup dry run - -A dry run is also available to simulate all the resources that can be backed up without actually doing it. Example of dry -run usage: - -```shell -$ optimus backup create --resource "resource_name" --project sample-project --namespace sample-namespace --dry-run -``` diff --git a/docs/docs/guides/create-bigquery-dataset.md b/docs/docs/guides/create-bigquery-dataset.md deleted file mode 100644 index 3c74a16108..0000000000 --- a/docs/docs/guides/create-bigquery-dataset.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -id: create-bigquery-dataset -title: Create bigquery dataset ---- - -A dataset is contained within a specific Google project. Datasets are top-level -containers that are used to organize and control access to your tables and views. -A table or view must belong to a dataset, so you need to create at least one. - -There are 3 ways to create a dataset: - -### Creating dataset with Optimus - -Supported datastore can be selected by calling -```bash -optimus resource create -``` -Optimus will request a resource name which should be unique across whole datastore. -All resource specification contains a name field which conforms to a fixed format. -In case of bigquery dataset, format should be -`projectname.datasetname`. -After the name is provided, `optimus` will create a file in configured datastore -directory. Open the created specification file and add additional spec details -as follows: -```yaml -version: 1 -name: temporary-project.optimus-playground -type: dataset -labels: - usage: testdataset - owner: optimus -spec: - description: "example description" - table_expiration: 24 # in hours -``` -This will add labels, description and default table expiration(in hours) to dataset -once the `deploy` command is invoked. - -### Creating dataset over REST - -Optimus exposes Create/Update rest APIS -``` -Create: POST /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource -Update: PUT /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource -Read: GET /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource/{resource_name} -``` - -```json -{ - "resource": { - "version": 1, - "name" : "temporary-project.optimus-playground", - "datastore" : "bigquery", - "type" : "dataset", - "labels": { - "usage": "testdataset", - "owner": "optimus" - }, - "spec" : { - "description": "example description", - "table_expiration": 24 - } - } -} -``` - -### Creating dataset over GRPC - -Optimus in RuntimeService exposes an RPC -```protobuf -rpc CreateResource(CreateResourceRequest) returns (CreateResourceResponse) {} - -message CreateResourceRequest { - string project_name = 1; - string datastore_name = 2; - ResourceSpecification resource = 3; - string namespace = 4; -} -``` -Function payload should be self-explanatory other than the struct `spec` part which -is very similar to how json representation look. - -Spec will use `structpb` struct created with `map[string]interface{}` -For example: -```go -map[string]interface{ - "description": "example description", - "table_expiration": 24 -} -``` \ No newline at end of file diff --git a/docs/docs/guides/create-bigquery-external-table.md b/docs/docs/guides/create-bigquery-external-table.md deleted file mode 100644 index 36993be5d9..0000000000 --- a/docs/docs/guides/create-bigquery-external-table.md +++ /dev/null @@ -1,161 +0,0 @@ ---- -id: create-bigquery-external-table -title: Create bigquery external table ---- - -A BigQuery external table is a data source stored in external storage that you can query directly -in BigQuery the same way you query a table. You can specify the schema of the external table when -it is created. At the moment only Google Drive source with Google Sheets format is supported. - -There are 3 ways to create an external table: - -### Creating external table with Optimus - -Supported datastore can be selected by calling - -```bash -optimus resource create -``` - -Optimus will request a resource name which should be unique across whole datastore. -All resource specification contains a name field which conforms to a fixed format. -In case of bigquery external table, format should be -`projectname.datasetname.tablename`. -After the name is provided, `optimus` will create a file in configured datastore -directory. Open the created specification file and add additional spec details -as follows: - -```yaml -version: 1 -name: temporary-project.optimus-playground.first_table -type: external_table -labels: - usage: testexternaltable - owner: optimus -spec: - description: "example description" - schema: - - name: colume1 - type: INTEGER - - name: colume2 - type: TIMESTAMP - description: "example field 2" - source: - type: google_sheets - uris: - - https://docs.google.com/spreadsheets/d/spreadsheet_id - config: - range: Sheet1!A1:B4 # Range of data to be ingested in format of [Sheet Name]![Cell Range] - skip_leading_rows: 1 # Row of records to skip -``` - -This will add labels, description, schema, and external table source specification depending -on the type of external table. - -Optimus generates specification on the root directory inside datastore with directory -name same as resource name, although you can change directory name to whatever you -find fit to organize resources. Directory structures inside datastore doesn't -matter as long as `resource.yaml` is in a unique directory. - -For example following is a valid directory structure - -```shell -./ -./bigquery/temporary-project/optimus-playground/resource.yaml -./bigquery/temporary-project/optimus-playground/first_external_table/resource.yaml -``` - -### Creating external table over REST - -Optimus exposes Create/Update rest APIS - -``` -Create: POST /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource -Update: PUT /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource -Read: GET /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource/{resource_name} -``` - -```json -{ - "resource": { - "version": 1, - "name": "temporary-project.optimus-playground.first_table", - "datastore": "bigquery", - "type": "external_table", - "labels": { - "usage": "testexternaltable", - "owner": "optimus" - }, - "spec": { - "description": "example description", - "schema": [ - { - "name": "column1", - "type": "INTEGER" - }, - { - "name": "column2", - "type": "TIMESTAMP", - "description": "example description", - "mode": "required" - } - ], - "source": { - "type": "google_sheets", - "uris": ["https://docs.google.com/spreadsheets/d/spreadsheet_id"], - "config": { - "range": "Sheet1!A1:B4", - "skip_leading_rows": 1 - } - } - } - } -} -``` - -### Creating external table over GRPC - -Optimus in RuntimeService exposes an RPC - -```protobuf -rpc CreateResource(CreateResourceRequest) returns (CreateResourceResponse) {} - -message CreateResourceRequest { - string project_name = 1; - string datastore_name = 2; - ResourceSpecification resource = 3; - string namespace = 4; -} -``` - -Function payload should be self-explanatory other than the struct `spec` part which -is very similar to how json representation look. - -Spec will use `structpb` struct created with `map[string]interface{}` -For example: - -```go -map[string]interface{ - "description": "example description", - "schema": []interface{ - map[string]interface{ - "name": "colume1", - "type": "integer" - }, - map[string]interface{ - "name": "colume2", - "type": "timestamp" - "description": "some description", - "mode": "required" - }, - }, - "source": map[string]interface{ - "type": "google_sheets", - "uris": []string{"https://docs.google.com/spreadsheets/d/spreadsheet_id"}, - "config": map[string]interface{ - "range": "Sheet1!A1:B4", - "skip_leading_rows": 1 - } - }, -} -``` diff --git a/docs/docs/guides/create-bigquery-table.md b/docs/docs/guides/create-bigquery-table.md deleted file mode 100644 index 4487f8d37c..0000000000 --- a/docs/docs/guides/create-bigquery-table.md +++ /dev/null @@ -1,178 +0,0 @@ ---- -id: create-bigquery-table -title: Create bigquery table ---- - -A BigQuery table contains individual records organized in rows. Each record is -composed of columns (also called fields). -Every table is defined by a schema that describes the column names, data types, -and other information. You can specify the schema of a table when it is created. -At the moment only native table is supported. - -There are 3 ways to create a table: - -### Creating table with Optimus - -Supported datastore can be selected by calling -```bash -optimus resource create -``` -Optimus will request a resource name which should be unique across whole datastore. -All resource specification contains a name field which conforms to a fixed format. -In case of bigquery table, format should be -`projectname.datasetname.tablename`. -After the name is provided, `optimus` will create a file in configured datastore -directory. Open the created specification file and add additional spec details -as follows: -```yaml -version: 1 - -# unique name that must conform to validations of type of resource we are creating -# in case of bigquery table, this is fully qualified name -name: temporary-project.optimus-playground.first_table - -# type of resource that belong to this datastore -# e.g.: table, dataset, view -type: table - -# labels being passed to datastore which will be injected in the bigquery table -labels: - usage: testtable - owner: optimus - -# actual specification details that matches the type we are trying to create/update -spec: - description: "example description" - schema: - - name: colume1 # name of the column - type: INTEGER # datatype of the column - - name: colume2 - type: TIMESTAMP - description: "example field 2" # description for the column - mode: required # possible options (repeated/required/nullable), default is nullable - - name: colume3 - type: STRUCT - schema: # nested struct schema - - name: colume_a_1 - type: STRING - cluster: - using: [colume1] - partition: # leave empty as {} to partition by ingestion time - field: colume2 # column name - type: day # day/hour, default: day -# expiration: 24 # in hours -# range: -# start: 30 -# end: 60 -# interval: 2 -# expiration_time: 200 # in hours - -``` -This will add labels, description, schema, clustering, partition over colume2 by day -on the table once the `deploy` command is invoked. - -Optimus generates specification on the root directory inside datastore with directory -name same as resource name, although you can change directory name to whatever you -find fit to organize resources. Directory structures inside datastore doesn't -matter as long as `resource.yaml` is in a unique directory. - -For example following is a valid directory structure -```shell -./ -./bigquery/temporary-project/optimus-playground/resource.yaml -./bigquery/temporary-project/optimus-playground/first_table/resource.yaml -``` - -### Creating table over REST - -Optimus exposes Create/Update rest APIS -``` -Create: POST /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource -Update: PUT /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource -Read: GET /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource/{resource_name} -``` - -```json -{ - "resource": { - "version": 1, - "name": "temporary-project.optimus-playground.first_table", - "datastore": "bigquery", - "type": "table", - "labels": { - "usage": "testdataset", - "owner": "optimus" - }, - "spec": { - "description": "example description", - "schema": [ - { - "name": "column1", - "type": "INTEGER" - }, - { - "name": "column2", - "type": "TIMESTAMP", - "description": "example description", - "mode": "required" - }, - { - "name": "column3", - "type": "STRUCT", - "schema": [ - { - "name": "column_a_1", - "type": "STRING" - } - ] - } - ], - "partition": { - "field": "column2" - }, - "cluster": { - "using": ["column1"] - } - } - } -} -``` - -### Creating table over GRPC - -Optimus in RuntimeService exposes an RPC -```protobuf -rpc CreateResource(CreateResourceRequest) returns (CreateResourceResponse) {} - -message CreateResourceRequest { - string project_name = 1; - string datastore_name = 2; - ResourceSpecification resource = 3; - string namespace = 4; -} -``` -Function payload should be self-explanatory other than the struct `spec` part which -is very similar to how json representation look. - -Spec will use `structpb` struct created with `map[string]interface{}` -For example: -```go -map[string]interface{ - "description": "example description", - "schema": []interface{ - map[string]interface{ - "name": "colume1", - "type": "integer" - }, - map[string]interface{ - "name": "colume2", - "type": "timestamp" - "description": "some description", - "mode": "required" - }, - }, - "partition": map[string]interface{ - "field": "column2" - }, -} -``` diff --git a/docs/docs/guides/create-bigquery-view.md b/docs/docs/guides/create-bigquery-view.md deleted file mode 100644 index fff4a890e7..0000000000 --- a/docs/docs/guides/create-bigquery-view.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -id: create-bigquery-view -title: Create bigquery view ---- - -A view is a virtual table defined by a SQL query. When you create a view, -you query it in the same way you query a table. When a user queries the view, -the query results contain data only from the tables and fields specified in the -query that defines the view. -At the moment only standard view is supported. - -There are 3 ways to create a view: - -### Creating table with Optimus - -Supported datastore can be selected by calling -```bash -optimus resource create -``` -Optimus will request a resource name which should be unique across whole datastore. -All resource specification contains a name field which conforms to a fixed format. -In case of bigquery view, format should be -`projectname.datasetname.viewname`. -After the name is provided, `optimus` will create a file in configured datastore -directory. Open the created specification file and add additional spec details -as follows: -```yaml -version: 1 -name: temporary-project.optimus-playground.first_view -type: view -labels: - usage: testview - owner: optimus -spec: - description: "example description" - view_query: | - Select * from temporary-project.optimus-playground.first_table -``` -This will add labels, description, along with the query for view once the -`deploy` command is invoked. -To use text editor intellisense for SQL formatting and linting, view query can -also be added in a separate file inside the same directory with the name `view.sql`. -Directory will look something like: -```shell -./ -./bigquery/temporary-project.optimus-playground.first_view/resource.yaml -./bigquery/temporary-project.optimus-playground.first_view/view.sql -``` -Remove the `view_query` field from the resource specification if the query is -specified in a seperate file. - -### Creating table over REST - -Optimus exposes Create/Update rest APIS -``` -Create: POST /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource -Update: PUT /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource -Read: GET /api/v1beta1/project/{project_name}/namespace/{namespace}/datastore/{datastore_name}/resource/{resource_name} -``` - -```json -{ - "resource": { - "version": 1, - "name": "temporary-project.optimus-playground.first_view", - "datastore": "bigquery", - "type": "view", - "labels": { - "usage": "testview", - "owner": "optimus" - }, - "spec": { - "description": "example description", - "view_query": "Select * from temporary-project.optimus-playground.first_table" - } - } -} -``` - -### Creating table over GRPC - -Optimus in RuntimeService exposes an RPC -```protobuf -rpc CreateResource(CreateResourceRequest) returns (CreateResourceResponse) {} - -message CreateResourceRequest { - string project_name = 1; - string datastore_name = 2; - ResourceSpecification resource = 3; - string namespace = 4; -} -``` -Function payload should be self-explanatory other than the struct `spec` part which -is very similar to how json representation look. - -Spec will use `structpb` struct created with `map[string]interface{}` -For example: -```go -map[string]interface{ - "description": "example description", - "view_query": "Select * from temporary-project.optimus-playground.first_table" -} -``` \ No newline at end of file diff --git a/docs/docs/guides/create-job.md b/docs/docs/guides/create-job.md deleted file mode 100644 index 883dc2c1d9..0000000000 --- a/docs/docs/guides/create-job.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -id: create-job -title: Using Optimus to create a Job ---- - -A Job is the fundamental execution unit of an Optimus data pipeline. -It can be scheduled, configured and is always mapped to a single transformation type -(eg, BQ-to-BQ, GCS-to-BQ, etc). It can have dependencies over other jobs and should -only execute once the dependent job is successfully completed. - -A job can also be configured with Hooks as part of its lifecycle, which can be -triggered before or after the job. Please go through [concepts](../concepts/overview.md) -to know more about it. - -Let's start with a basic example. For our tutorial, we'll be creating a job that -writes "hello YYYY-MM-DD" to a table every day at 3 am. We'll use BQ-to-BQ transformation type. -For the purpose of this tutorial, we'll assume that the Google Cloud Project name -is "example" & dataset is just called "data". - - -## Creating a Job - -Open your terminal and create a new directory that will hold the specifications -created by `optimus` (The CLI of Optimus). Once ready, you can run the following -command and answer the corresponding prompts (do note that some prompts -would be to select from options instead of input): - -``` -$ optimus job create -? What is the job name? example_job -? Who is the owner of this job? example@example.com -? Which task to run? bq2bq -? Specify the start date 2021-02-18 -? Specify the interval (in crontab notation) 0 3 * * * -? Project ID: example -? Dataset Name: data -? Table Name: hello_table -? Load method to use on destination? APPEND -``` - -Note: The cron schedule of a Job is as per UTC timezone. -With the above prompt, we have created a Job with name example_job that writes to table `hello_table` -every day at 3 AM UTC, with the load method APPEND (we'll come back to this later). -The task `bq2bq` refers to "BigQuery to BigQuery" transformation. As you can notice, -each Job is mapped with a specific table. This will create the following files: - -``` -. -└── example_job - ├── assets - │ └── query.sql - └── job.yaml -``` - -You can now edit `query.sql` and write the SQL query in it. for example: - -```bash -$ cat > example_job/assets/query.sql <<_EOF -select CONCAT("Hello, ", "{{.DEND}}") as message -_EOF -``` - -`{{.DEND}}` is a macro that is replaced with the current execution date (in YYYY-MM-DD format) -of the task (note that this is the execution date of when the task was supposed to run, -not when it actually runs). There's another corresponding macro for start date called ` -{{.DSTART}}` the value of which is DEND minus the task window. If the task window is DAILY, -DSTART is one day behind DEND, if the window is weekly, DSTART is 7 days before DEND. -Do note the format of macros, these are as per [golang template](https://golang.org/pkg/text/template/). - -What about the load method then? Load method specifies write disposition of the task. -There are currently 3 configurations available: -- APPEND -- REPLACE -- MERGE - -When the load method is set to APPEND new rows are inserted to the table/partition -when the job runs, REPLACE will truncate the table/partition before writing new rows -and MERGE is used when you want to use BigQuery DML/Scripts. Which load method you use depends -on the nature of the transformation, however it's advised to use the REPLACE method -with a partitioned table to keep your queries idempotent. Another alternative would -be to use the MERGE load method with DML. Keeping queries idempotent helps backfilling data. - -Finally, this is how our Job Specification will look like (example_job/job.yaml): -```yaml -version: 1 -name: example_job -owner: example@example.com -schedule: - start_date: "2021-02-18" - interval: 0 3 * * * -behavior: - depends_on_past: false - catch_up: true -task: - name: bq2bq - config: - PROJECT: example - DATASET: data - TABLE: hello_table - LOAD_METHOD: APPEND - SQL_TYPE: STANDARD - window: - size: 24h - offset: "0" - truncate_to: d -labels: - orchestrator: optimus -dependencies: [] -hooks: [] -``` - -Now you can finally push all the files in a git repository. Create a commit and -push to repository which will initiate gitlab pipeline and apply all of your changes. -In this case: - -1. Table is migrated in BigQuery for above bq2bq task [TODO] -2. Compiles your job specifications as Airflow DAG definitions and upload them to - Google cloud storage (or any other configured store) that gets synced to airflow - (or any other configured scheduler) linked with this git repository. - -Optimus also supports managing Job Specifications via APIs. We'll talk about this in other sections. -You have now successfully deployed your transformation job onto your infrastructure. \ No newline at end of file diff --git a/docs/docs/guides/extension.md b/docs/docs/guides/extension.md deleted file mode 100644 index 824c7f0433..0000000000 --- a/docs/docs/guides/extension.md +++ /dev/null @@ -1,214 +0,0 @@ ---- -id: extension -title: Work with Extension ---- - -Extension helps the user to include third-party or arbitrary implementation -as part of Optimus. Currently, extension is designed for when the user -is running it as CLI. - -## Warning - -Extension is basically an executable file outside Optimus. **We do not guarantee whether an extension is safe or not**. We suggest to check the extension itself, whether it is safe to run in your local or not, before installing and running it. - -## Limitation - -Extension is designed to be similar to [Github extension](https://cli.github.com/manual/gh_extension). -However, since it's still in early stage, some limitations are there. - -* extension is only an executable file -* installation only looks at the Github asset according to the running system OS and Architecture -* convention for extension: - * extension repository should follow `optimus-extension-[name of extension]` (example: [optimus-extension-valor](https://github.com/gojek/optimus-extension-valor)) - * asset being consdered is binary with suffix `...[OS]-[ARC]` (example: when installing [`valor`](https://github.com/gojek/optimus-extension-valor), if the user's OS is Linux and the architecture is AMD64, then installation will consider `valor_linux-amd64` as binary to be executed) - -## Creating - -Extension is designed to be open. Anyone could create their own extension. And as long as it is avilable, anyone could install it. In order to create it, the following is the basic steps to do: - -1. Decide the name of the extension, example: `valor` -2. Create a Github repository that follows the convention, example: `optimus-extension-valor` -3. Put some implementation and asset with name based on the convention, example: `valor_linux-amd64`, `valor_darwin-amd64`, and more. -4. Ensure it is available for anyone to download - -## Commands - -Optimus support some commands to help operating on extension. - -### Installation - -The user can run installation using Optimus sub-command `install` under `extension`. -In order to install extension, run the following command: - -```zsh -optimus extension install REMOTE [flags] -``` - -The user can use `--alias` flag to change the command name, since by default, Optimus -will try to figure it out by itself. Although, during this process, sometime -an extension name conflict with the reserved commands. This flag helps to resolve that. -But, do note that this flag cannot be used to rename an **installed** extension. -To do such a thing, check [rename](#rename). - -REMOTE is the Github remote path where to look for the extension. -REMOTE can be in the form of: - -* OWNER/PROJECT -* github.com/OWNER/PROJECT -* https://www.github.com/OWNER/PROJECT - -One example of such extension is [`Valor`](https://github.com/gojek/optimus-extension-valor). -So, going back to the example above, installing it is like this: - -```zsh -optimus extension install gojek/optimus-extension-valor -``` - -or - -```zsh -optimus extension install github.com/gojek/optimus-extension-valor -``` - -or - -```zsh -optimus extension install https://github.com/gojek/optimus-extension-valor -``` - -Installation process is then in progress. If installation is a success, the user can show it by running: - -```zsh -optimus --help -``` - -A new command named after the extension will be available. -For example, if the extension name is `optimus-extension-valor`, then by default the command named `valor` will be available. -If the user wish to change it, they can use `--alias` during installation, or -`rename` it (explained later). - -The following is example when running `optimus` (without any command): - -```zsh -... -Available Commands: - ... - extension Operate with extension - ... - valor Execute gojek/optimus-extension-valor [v0.0.2] extension - version Print the client version information -... -``` - -### Executing - -In order to execute an extension, make sure to follow the installation process described [above](#installation). -After installation is finished, simply run the extension with the following command: - -```zsh -optimus [extension name or alias] -``` - -Example of `valor`: - -```zsh -optimus valor -``` - -### Operation - -The user can do some operations to an extension. This section explain more about the available commands. Do note that these commands are available on the installed extensions. -For more detail, run the following command: - -```zsh -optimus extension [extension name or alias] -``` - -Example: - -```zsh -optimus extension valor -``` - -The above command shows all available commands for `valor` extension. - -Output: - -```zsh -Sub-command to operate over extension [gojek/optimus-extension-valor@v0.0.4] - -USAGE - optimus extension valor [flags] - -CORE COMMANDS - activate activate is a sub command to allow user to activate an installed tag - describe describe is a sub command to allow user to describe extension - rename rename is a sub command to allow user to rename an extension command - uninstall uninstall is a sub command to allow user to uninstall a specified tag of an extension - upgrade upgrade is a sub command to allow user to upgrade an extension command - -INHERITED FLAGS - --help Show help for command - --no-color Disable colored output - -v, --verbose if true, then more message will be provided if error encountered -``` - -#### Activate - -Activate a specific tag when running extension. For example, if the user has two version of `valor`, which is `v0.0.1` and `v0.0.2`, then by specifying the correct tag, the user can just switch between tag. - -Example: - -```zsh -optimus extension valor activate v0.0.1 -``` - -#### Describe - -Describes general information about an extension, such information includes all -available releases of an extension in the local, which release is active, -and more. - -Example: - -```zsh -optimus extension valor describe -``` - -#### Rename - -Rename a specific extension to another command that are not reserved. -By default, Optimus tries to figure out the appropriate command name from its project name. -However, sometime the extension name is not convenient like it being too long or the user -just want to change it. - -Example: - -```zsh -optimus extension valor rename vl -``` - -#### Uninstall - -Uninstalls extension as a whole or only a specific tag. This allows the user to do -some clean up to preserve some storage or to resolve some issues. -By default, Optimus will uninstall the extension as a whole. To target a specific tag, -use flag `--tag`. - -Example: - -```zsh -optimus extension valor uninstall -``` - -#### Upgrade - -Upgrade allows the user to upgrade a certain extension to its latest tag. -Although the user can use the install command, but using this command is shorter -and easier as the user only needs to specify the installed extension. - -Example: - -```zsh -optimus extension valor upgrade -``` diff --git a/docs/docs/guides/manage-secrets.md b/docs/docs/guides/manage-secrets.md deleted file mode 100644 index 1915412e0a..0000000000 --- a/docs/docs/guides/manage-secrets.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -id: secret -title: Manage Secrets ---- - -During job execution, specific credentials are needed to access required resources, for example, BigQuery credential -for BQ to BQ tasks. Users are able to register secrets on their own, manage it, and use it in tasks and hooks. -Please go through [concepts](../concepts/overview.md) to know more about it. - -## Registering secret with Optimus - -Register a secret by running the following command: -```shell -$ optimus secret set someSecret someSecretValue -```` - -By default, Optimus will encode the secret value. However, to register secret that has been encoded, run the following -command instead: -```shell -$ optimus secret set someSecret encodedSecretValue --base64 -```` - -There is also a flexibility to register using an existing secret file, instead of providing the secret value in the -command. -```shell -$ optimus secret set someSecret --file=/path/to/secret -``` - -Please note that registering a secret which already exists will result in error. Modifying an existing secret can be -done using the Update command. - -## Updating a secret - -The update-only flag is generally used when you explicitly only want to update a secret which already exists -and don't want to create it by mistake. - -```shell -$ optimus secret set someSecret someSecretValue --update-only -``` - -It will return an error if the secret to update does not exist already. - - -## Listing a secret - -The list command can be used to show the user defined secrets which are registered with optimus. It will list -the namespace associated for a secret. - -```shell -$ optimus secret list -Secrets for project: optimus-local - NAME | DIGEST | NAMESPACE | DATE --------------+----------------------------------------------+-----------+----------------------- - secret1 | SIBzsgUuHnExBY4qSzqcrlrb+3zCAHGu/4Fv1O8eMI8= | * | 2022-04-12T04:30:45Z -``` - -It shows a digest for the encrypted secret, so as not to send the cleartext password on the network. diff --git a/docs/docs/guides/optimus-serve.md b/docs/docs/guides/optimus-serve.md deleted file mode 100644 index 4a769eb1e3..0000000000 --- a/docs/docs/guides/optimus-serve.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -id: optimus-serve -title: Starting Optimus Server ---- - -Once the optimus binary is installed, it can be started in serve mode using -```shell -optimus serve -``` -It needs few [configurations](../getting-started/configuration.md) as prerequisites, for example, create a `config.yaml` file with -```yaml -version: 1 -host: localhost:9100 -serve: - port: 9100 - host: localhost - ingress_host: optimus.example.io:80 - app_key: 32charrandomhash32charrandomhash - db: - dsn: postgres://user:password@localhost:5432/optimus?sslmode=disable -``` -You will need to change `dsn` and `app_key` according to your installation. And then run `optimus serve -c config.yaml` - -Once the server is up and running, before it is ready to deploy `jobs` we need to -- Register an optimus project -- Register a namespace under project -- Register required secrets under project - -This needs to be done in order using REST/GRPC endpoints provided by the server. \ No newline at end of file diff --git a/docs/docs/guides/organising-specifcations.md b/docs/docs/guides/organising-specifcations.md deleted file mode 100644 index 60dc9e862a..0000000000 --- a/docs/docs/guides/organising-specifcations.md +++ /dev/null @@ -1,133 +0,0 @@ ---- -id: organising-specifications -title: Organising specifications ---- - -Optimus supports two ways to deploy specifications -- REST/GRPC -- Optimus CLI deploy command - -When using Optimus cli to deploy, either manually or from a CI pipeline, it is advised to use version control system like git. Here is a simple directory structure that can be used as a template for jobs and datastore resources. - - -``` -. -├── optimus.yaml -├── README.md -├── namespace-1 -│   ├── jobs -| │   ├── job1 -| │   ├── job2 -| │   └── this.yaml -│   └── resources -|    ├── bigquery -│      │ ├── table1 -│      │   ├── table2 -|    | └── this.yaml -│   └── postgres -│   └── table1 -└── namespace-2 -    └── jobs -    └── resources -``` - -A sample `optimus.yaml` would look like - -```yaml -version: 1 -host: localhost:9100 -project: - name: project-1 -namespaces: -- name: namespace-1 - config: {} - job: - path: namespace-1/jobs - datastore: - - type: bigquery - path: namespace-1/resources/bigquery - - type: postgres - path: namespace-1/resources/postgres -- name: namespace-2 - config: {} - job: - path: namespaces-2/jobs - datastore: - - type: bigquery - path: namespace-2/resources/bigquery -``` - - - -You might have also noticed there are `this.yaml` files being used in some directories. This file is used to share a single set of configuration across multiple sub directories. For example if I create a file at `/namespace-1/jobs/this.yaml`, then all sub directories inside `/namespaces-1/jobs` will inherit this config as defaults. If same config is specified in sub directory, then sub directory will override the parent defaults. For example a `this.yaml` in `/namespace-1/jobs` - -```yaml -version: 1 -schedule: - interval: @daily -behavior: - depends_on_past: false - catch_up: true - retry: - count: 1 - delay: 5s -labels: - owner: overlords - transform: sql -``` - -and a `job.yaml` in `/namespace-1/jobs/job1` - -```yaml -name: sample_replace -owner: optimus@example.io -schedule: - start_date: "2020-09-25" - interval: 0 10 * * * -behavior: - depends_on_past: true -task: - name: bq2bq - config: - project: project_name - dataset: project_dataset - table: sample_replace - load_method: REPLACE - window: - size: 48h - offset: 24h -labels: - process: bq -``` - -will result in final computed `job.yaml` during deployment as - -```yaml -version: 1 -name: sample_replace -owner: optimus@example.io -schedule: - start_date: "2020-10-06" - interval: 0 10 * * * -behavior: - depends_on_past: true - catch_up: true - retry: - count: 1 - delay: 5s -task: - name: bq2bq - config: - project: project_name - dataset: project_dataset - table: sample_replace - load_method: REPLACE - window: - size: 48h - offset: 24h -labels: - process: bq - owner: overlords - transform: sql -``` - diff --git a/docs/docs/guides/predator.md b/docs/docs/guides/predator.md deleted file mode 100644 index f124f24d1e..0000000000 --- a/docs/docs/guides/predator.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -id: profiling-auditing -title: Profiling and Auditing Bigquery ---- - -# Profiling and Auditing BigQuery - -To enable Profiler and Auditor (Predator), answer the related questions in Job specification. -Note: this is not available for public use at the moment - -```bash -• $ optimus job addhook -? What is the job name? test_job -? Who is the Owner of this job? de@go-jek.com -? Specify the start date (YYYY-MM-DD) 2021-01-01 -? Specify the interval (in crontab notation) @daily -? Enable profile for the destination table? true -? Enable audit for the destination table? true -? Filter expression for profiling? (empty for always do full scan profiling) -event_timestamp >= '{{.DSTART}}' AND event_timestamp < '{{.DEND}}' -? Specify the profile/audit result grouping field (empty to not group the result) __PARTITION__ -? Choose the profiling mode complete -``` - -Configs: -- **Filter expression**: Expression is used as a where clause to restrict the number of rows to only profile the ones - that needed to be profiled. - Expression can be templated with: DSTART and DEND. These will be replaced with the window for which the current - transformation is getting executed. EXECUTION_TIME will be replaced with job execution time that is being - used by the transformation task. `__PARTITION__` represents the partitioning field of the table and the type of - partition. If it is a daily partition using field `event_timestamp`, then the macros is equal to date - `event_timestamp`. -- **Group**: Represent the column on which the records will be grouped for profiling. Can be `__PARTITION__` or any other - field in the target table. -- **Mode**: Mode represents the profiling strategy used with the above configurations, it doesn’t affect the profile - results. `complete` means all the records in a given group are considered for profiling. ‘incremental’ only the newly added records for the given group are considered for profiling. This input is needed when DataQuality results are shown in UI. - -Here is a sample DAG specification that has Predator enabled. -```yaml -version: 1 -name: test_job -owner: de@go-jek.com -schedule: - start_date: "2021-02-26" - interval: 0 2 * * * -behavior: - depends_on_past: false - catch_up: true -task: - name: bq2bq - config: - DATASET: playground - LOAD_METHOD: REPLACE - PROJECT: gcp-project - SQL_TYPE: STANDARD - TABLE: hello_test_table - window: - size: 24h - offset: "0" - truncate_to: d -dependencies: [] -hooks: - - name: predator - config: - AUDIT_TIME: '{{.EXECUTION_TIME}}' - BQ_DATASET: '{{.TASK__DATASET}}' - BQ_PROJECT: '{{.TASK__PROJECT}}' - BQ_TABLE: '{{.TASK__TABLE}}' - FILTER: 'event_timestamp >= "{{.DSTART}}" AND event_timestamp < "{{.DEND}}"' - GROUP: __PARTITION__ - MODE: complete - PREDATOR_URL: '{{.GLOBAL__PREDATOR_HOST}}' - SUB_COMMAND: profile_audit -``` - -After the Job is created, create a Data Quality Spec of the particular table and -place it in the Optimus jobs repository, inside the Predator directory. -Detail of quality spec creation is available in Predator documentation. diff --git a/docs/docs/guides/publishing-from-bigquery-to-kafka.md b/docs/docs/guides/publishing-from-bigquery-to-kafka.md deleted file mode 100644 index 4bdd4ed868..0000000000 --- a/docs/docs/guides/publishing-from-bigquery-to-kafka.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -id: publishing-bigquery-to-kafka -title: Publishing from bigQuery to kafka ---- - -Following are the steps to publish BQ data to Kafka: - -1. Raise a ticket with DE to create the proto, soon this will be automated. -2. As part of Job Specification answer the questions related to pushing data to Kafka. -3. Commit and Push - -Publishing from Bigquery to Kafka is done using an Optimus hook called `Transporter`. -Once data is pushed to Kafka you can use firehose to consume messages for your needs. -In order to add hook to an existing Job, run the following command and answer the -corresponding prompts: - -``` -$ ./optimus job addhook -? Select a Job example_job -? Which hook to run? transporter -? Filter expression for extracting transformation rows? event_timestamp >= '{{.DSTART}}' AND event_timestamp < '{{.DEND}}' -``` -Note: this is not available for public use at the moment - -### Config: - -- Filter expression: Expression is used as a where clause to restrict the number of rows to only push the ones -that are affected by current transformation. Expression can be templated with DSTART and DEND macros which will be replaced with the window for which the current transformation is getting executed similar to what we do in Job specifications. - -After this, existing job.yaml file will get updated with the new hooks config and the job specification would look like below: - -```yaml -version: 1 -name: example_job -owner: example@example.com -schedule: - start_date: "2021-02-18" - interval: 0 3 * * * -behavior: - depends_on_past: false - catch_up: true -task: - name: bq2bq - config: - DATASET: data - LOAD_METHOD: APPEND - PROJECT: example - SQL_TYPE: STANDARD - TABLE: hello_table - window: - size: 24h - offset: "0" - truncate_to: d -dependencies: [] -hooks: -- name: transporter - config: - BQ_DATASET: '{{.TASK__DATASET}}' # inherited from task configs - BQ_PROJECT: '{{.TASK__PROJECT}}' - BQ_TABLE: '{{.TASK__TABLE}}' - FILTER_EXPRESSION: 'event_timestamp >= "{{.DSTART}}" AND event_timestamp < "{{.DEND}}"' - KAFKA_TOPIC: optimus_example-data-hello_table - PRODUCER_CONFIG_BOOTSTRAP_SERVERS: '{{.GLOBAL__TRANSPORTER_KAFKA_BROKERS}}' - PROTO_SCHEMA: example.data.HelloTable - STENCIL_URL: '{{.GLOBAL__TRANSPORTER_KAFKA_BROKERS}}' # will be defined as global config -``` - -Some configuration would be auto-generated by Optimus. -You can now commit and push the changes in Job specification. - -There are standards that we want users to maintain but haven’t enforced: - -1. Single table to topic mapping to be maintained & following a naming convention - helps in better discoverability. Topic names are auto populated with the same naming convention. -2. Kafka Brokers are not modifiable & pre-selected per every entity. -3. All Protos & Stencil are managed & doesn’t need any user intervention. - -### Bigquery and Protobuf Data Type Mapping - -| Bigquery Type | Protobuf Type | -|---------------|---------------------------| -| STRING | string | -| BYTES | bytes | -| INTEGER | int64 | -| FLOAT | float | -| BOOLEAN | bool | -| TIMESTAMP | google.protobuf.Timestamp | -| DATE | string | -| TIME | string | -| DATETIME | string | -| NUMERIC | float | -| GEOGRAPHY | string | diff --git a/docs/docs/guides/refresh-jobs.md b/docs/docs/guides/refresh-jobs.md deleted file mode 100644 index 5604a2d422..0000000000 --- a/docs/docs/guides/refresh-jobs.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: refresh-jobs -title: Refresh Jobs ---- - -Jobs might need to be refreshed on certain cases, for example: -* When job source is a `view` and the source view has been modified. -* When there is some issues on job dependencies or priorities and need to do a clean up -* When jobs need to have its plugin refreshed to the latest version - -Optimus refresh will try to resolve the dependencies for the **requested** jobs and deploy **all** jobs in the project. - -## Refresh jobs - -Refresh all jobs in the requested project: -```shell -$ optimus job refresh --project sample-project --verbose -``` -Note: use verbose flag to show list of jobs being refreshed and deployed - -### Refresh jobs on selected namespaces -Use `namespaces` flag to refresh only the selected namespace. Only all the jobs in the selected namespaces will be -refreshed, but all the jobs in the project will be deployed. -```shell -$ optimus job refresh --project sample-project --namespaces namespace-a,namespace-b -``` - -### Refresh only selected jobs -Use `jobs` flag to only refresh selected jobs. Only the selected jobs will be refreshed, but all the jobs in the project -will be deployed. -```shell -$ optimus job refresh --project sample-project --namespaces namespace-a --jobs job-a,job-b -``` -Note: All the selected jobs should be inside the same namespace. \ No newline at end of file diff --git a/docs/docs/guides/replay.md b/docs/docs/guides/replay.md deleted file mode 100644 index f57ad8044e..0000000000 --- a/docs/docs/guides/replay.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -id: replay -title: Backfill jobs using Replay ---- - -Some old dates of a job might need to be re-run (backfill) due to business requirement changes, corrupt data, or other -various reasons. Optimus provides an easy way to do this using Replay. Please go through -[concepts](../concepts/overview.md) to know more about it. - -## Run a replay - -In order to run a replay, run the following command: - -```shell -$ optimus replay create sample-job 2021-01-01 2021-02-01 --project sample-project --namespace sample-namespace -``` - -Replay accepts three arguments, first is the DAG name that is used in optimus specification, second is -start date of replay, third is end date (optional) of replay. - -If the replay request passes the basic validation, you will see all the tasks including the downstream that will be -replayed. You can confirm to proceed to run replay if the run simulation is as expected. - -Once your request has been successfully replayed, this means that Replay has cleared the mentioned task in the scheduler. -Please wait until the scheduler finishes scheduling and running those tasks. - -## Get a replay status - -You can check the replay status using the replay ID given previously and use in this command: - -```shell -$ optimus replay status {replay_id} --project sample-project -``` - -You will see the latest replay status including the status of each run of your replay. - -## Get list of replays - -List of recent replay of a project can be checked using this sub command: - -```shell -$ optimus replay list --project sample-project -``` - -Recent replay ID including the job, time window, replay time, and status will be shown. To check the detailed status of a -replay, please use the `status` sub command. - -## Run a replay dry run - -A dry run is also available to simulate all the impacted tasks without actually re-running the tasks. Example of dry run -usage: - -```shell -$ optimus replay create sample-job 2021-01-01 2021-02-01 --project sample-project --namespace sample-namespace --dry-run -``` diff --git a/docs/docs/guides/task-bq2bq.md b/docs/docs/guides/task-bq2bq.md deleted file mode 100644 index 22a0e3ab2e..0000000000 --- a/docs/docs/guides/task-bq2bq.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -id: task-bq2bq -title: Bigquery to bigquery transformation task ---- - -### Creating Task -Command to create a task : -``` -optimus job create -``` -This command will invoke an interactive cli that contains configurations that -need to be filled for the task. The tasks files will be generated at -`{PWD}/jobs/{JOB_NAME}/assets` folder. - -Inside the assets folder there could be several files, one that is -needed to configure this task is : - -* query.sql - file that contains the transformation query - -This will also configure the `job.yaml` with few defaults and few inputs requested at the time -of creation. User still able to change the config values after the file is generated. - -For example `job.yaml` config : - -```yaml -version: 1 -name: example_job -owner: example@example.com -schedule: - start_date: "2021-02-18" - interval: 0 3 * * * -behavior: - depends_on_past: false - catch_up: true -task: - name: bq2bq - config: - DATASET: data - LOAD_METHOD: APPEND - PROJECT: example - SQL_TYPE: STANDARD - TABLE: hello_table - TASK_BQ2BQ: "{{.secret.TASK_BQ2BQ}}" - GOOGLE_APPLICATION_CREDENTIALS: "/tmp/auth.json" - window: - size: 24h - offset: "0" - truncate_to: d -``` - -Here are the details of each configuration and the allowed values : - -| Config Name | Description | Values | -| ----------------------- |-----------------------------------------------------------------------------------------------------------------| ------------------------------------| -| `PROJECT` | google cloud platform project id of the destination bigquery table | ... | -| `DATASET` | bigquery dataset name of the destination table | ... | -| `TABLE` | the table name of the destination table | ... | -| `LOAD_METHOD` | method to load data to the destination tables | APPEND, REPLACE, MERGE | -| `PARTITION_FILTER` | Used to identify target partitions to replace in a REPLACE query. This can be left empty and optimus will figure the target partitions automatically but its cheaper and faster to specify the condition. This filter will be used as a where clause in a merge statement to delete the partitions from the destination table. | event_timestamp >= "{{.DSTART}}" AND event_timestamp < "{{.DEND}}" | - -### Load Method - -The way data loaded to destination table depends on the partition configuration of the destination tables - -| Load Method | No Partition | Partitioned Table | -| -------------|------------------------------------------------------------------------------------------------| -------------------------------------------------------------------------------------------| -| APPEND | Append new records to destination table | Append new records to destination table per partition based on localised start_time | -| REPLACE | Truncate/Clean the table before insert new records | Clean records in destination partition before insert new record to new partition | -| MERGE | Load the data using DML Merge statement, all of the load logic lies on DML merge statement | Load the data using DML Merge statement, all of the load logic lies on DML merge statement | - -## query.sql file - -The *query.sql* file contains transformation logic - -```sql -select count(1) as count, date(created_time) as dt -from `project.dataset.tablename` -where date(created_time) >= '{{.DSTART|Date}}' and date(booking_creation_time) < '{{.DEND|Date}}' -group by dt -``` - -### SQL macros - -Macros is special variables in SQL that will be replaced by actual values when transformation executed - -There are several SQL macros available - -- {{.DSTART}} - start date/datetime of the window as `2021-02-10T10:00:00+00:00` - that is, RFC3339 -- {{.DEND}} - end date/datetime of the window, as RFC3339 -- {{.JOB_DESTINATION}} - full qualified table name used in DML statement -- {{.EXECUTION_TIME}} - full qualified table name used in DML statement - -The value of `DSTART` and `DEND` depends on `window` config in `job.yaml`. This is very similar to Optimus v1 - -| Window config | DSTART | DEND -| ----------------------------------- |--------------------------------------------------------------------| ---------------------------------------------------------------------| -| size:24h, offset:0, truncate_to:d | The current date taken from input, for example 2019-01-01 | The next day after DSTART date 2019-01-02 | -| size:168h, offset:0, truncate_to:w | Start of the week date for example : 2019-04-01 | End date of the week , for example : 2019-04-07 | -| size:1M, offset:0, truncate_to:M | Start of the month date, example : 2019-01-01 | End date of the month, for example : 2019-01-31 | -| size:2h, offset:0, truncate_to:h | Datetime of the start of the hour, for example 2019-01-01 01:00:00 | Datetime the start of the next hour, for example 2019-01-01 02:00:00 | - -Please find more details under [concepts](../concepts/intervals-and-windows.md) section. - -Macros in SQL transformation example : - -```sql -select count(1) as count, date(created_time) as dt -from `project.dataset.tablename` -where date(created_time) >= '{{.DSTART|Date}}' and date(booking_creation_time) < '{{.DEND|Date}}' -group by dt -``` - -Rendered SQL for DAILY window example : - -```sql -select count(1) as count, date(created_time) as dt -from `project.dataset.tablename` -where date(created_time) >= '2019-01-01' and date(booking_creation_time) < '2019-01-02' -group by dt -``` - -Rendered SQL for HOURLY window example : -the value of `DSTART` and `DEND` is YYYY-mm-dd HH:MM:SS formatted datetime - -```sql -select count(1) as count, date(created_time) as dt -from `project.dataset.tablename` -where date(created_time) >= '2019-01-01 06:00:00' and date(booking_creation_time) < '2019-01-01 07:00:00' -group by dt -``` - -destination_table macros example : - -```sql -MERGE `{{.JOB_DESTINATION}}` S -using -( -select count(1) as count, date(created_time) as dt -from `project.dataset.tablename` -where date(created_time) >= '{{.DSTART}}' and date(created_time) < '{{.DEND}}' -group by dt -) N -on S.date = N.date -WHEN MATCHED then -UPDATE SET `count` = N.count -when not matched then -INSERT (`date`, `count`) VALUES(N.date, N.count) -``` - -## SQL Helpers - -Sometimes default behaviour of how tasks are being understood by optimus is not ideal. You can change this using helpers inside the query.sql file. To use, simply add them inside sql multiline comments where it’s required. -At the moment there is only one sql helper: - -- `@ignoreupstream`: By default, Optimus adds all the external tables used inside the query file as its upstream -dependency. This helper can help ignore unwanted waits for upstream dependency to finish before the current transformation can be executed. -Helper needs to be added just before the external table name. For example: -```sql -select -hakai, -rasengan, -`over`, -load_timestamp as `event_timestamp` -from /* @ignoreupstream */ -`g-project.playground.sample_select` -WHERE -DATE(`load_timestamp`) >= DATE('{{.DSTART}}') -AND DATE(`load_timestamp`) < DATE('{{.DEND}}') -``` - diff --git a/docs/docs/introduction.md b/docs/docs/introduction.md index 4d63c6ce94..3c8cb912fd 100644 --- a/docs/docs/introduction.md +++ b/docs/docs/introduction.md @@ -5,35 +5,44 @@ title: Introduction # Optimus -Optimus is an ETL orchestration tool that helps manage warehouse resources and -schedule transformation over cron interval. Warehouses like Bigquery can be used -to create, update, read, delete different types of resources(dataset/table/standard view). -Similarly, jobs can be SQL transformations taking inputs from single/multiple -source tables executing over fixed schedule interval. Optimus was made from start -to be extensible, which is, adding support for different kind of warehouses, -transformations and executors can be done easily. - -## Features - -- BigQuery - - Schedule BigQuery transformation - - Query compile time templating (variables, loop, if statements, macros, etc) - - BigQuery Dataset/Table/View creation - - BigQuery UDF creation **[in roadmap]** - - Audit/Profile BigQuery tables - - Sink BigQuery tables to Kafka - - Automatic dependency resolution: In BigQuery if a query references - tables/views as source, jobs required to create these tables will be added - as dependencies automatically and optimus will wait for them to finish first. - - Cross tenant dependency: Optimus is a multi-tenant service, if there are two - tenants registered, serviceA and serviceB then service B can write queries - referencing serviceA as source and Optimus will handle this dependency as well - - Dry run query: Before SQL query is scheduled for transformation, during - deployment query will be dry-run to make sure it passes basic sanity - checks -- Extensibility to support Python transformation -- Git based specification management -- GRPC/REST based APIs - -NOTE: This is still in early stages and very close to use for production. -We are taking feedback and making breaking changes based on user requirements. +Optimus is an ETL orchestration tool that helps manage data transformation jobs and manage warehouse resources. +It enables you to transform your data by writing the transformation script and YAML configuration while Optimus handles +the dependency, schedules it, and handles all other aspects of running transformation jobs at scale. Optimus also supports +warehouse resource management (currently BigQuery), which enables you to create, update, and read BigQuery tables, views, and datasets. + +![High Level Optimus Diagram](/img/docs/OptimusIntro.png "OptimusIntro") + +Optimus was made to be extensible. Adding support for different kinds of sources/sinks and transformation executors +can be done easily. If your organization has to setup & manage data pipelines that are complex with multiple sources, +sinks & there are many team members managing them, then Optimus is the perfect tool for you. + +## Multi-Tenancy Support + +Optimus supports multi-tenancy. Each tenant manages their own jobs, resources, secrets, and configuration while optimus +managing dependencies across tenants. + +## Extensible + +Optimus provides the flexibility to you to define how your transformation jobs should behave, which data source or +warehouse sink you want to support, and what configurations you need from the users. This flexibility is addressed +through [plugin](concepts/plugin.md). At the moment, we provide a [BigQuery to BigQuery task plugin](https://github.com/raystack/transformers/tree/main/task/bq2bq), +but you can write custom plugins such as Python transformations. + +Also, in order to provide a unified command line experience of various tools, Optimus provides [extensions](client-guide/work-with-extension.md) +support on client side through which you can extend the capabilities for example providing governance. + +## Automated Dependency Resolution + +Optimus parses your data transformation queries and builds a dependency graph automatically without the user explicitly +defining the same. The dependencies are managed across tenants, so teams doesn’t need to coordinate among themselves. + +## In-Built Alerting + +Always get notified when your job is not behaving as expected, on failures or on SLA misses. Optimus supports +integrations with slack & pagerduty. + +## Verification in Advance + +Minimize job runtime issues by validating and inspecting jobs before submitting them which enables them for faster +turnaround time when submitting their jobs. Users can get to know about job dependencies, validation failures & some +warnings before submitting the jobs. diff --git a/docs/docs/reference/API.md b/docs/docs/reference/API.md index 743e9bb845..0ce208dc9b 100644 --- a/docs/docs/reference/API.md +++ b/docs/docs/reference/API.md @@ -1,11 +1,6 @@ ---- -id: api -title: API ---- - # API Optimus service supports REST and GRPC for interaction, currently on the same port. -- [REST API](https://github.com/odpf/optimus/blob/a32e35aef61e5d51672b1afc131e9ea828cff1a5/api/third_party/openapi/odpf/optimus/core/v1beta1/runtime.swagger.json) -- [GRPC](https://github.com/odpf/proton/blob/ef83b9e9248e064a1c366da4fe07b3068266fe59/odpf/optimus/core/v1beta1/runtime.proto) +- [REST API](https://github.com/raystack/optimus/blob/a32e35aef61e5d51672b1afc131e9ea828cff1a5/api/third_party/openapi/raystack/optimus/core/v1beta1/runtime.swagger.json) +- [GRPC](https://github.com/raystack/proton/blob/ef83b9e9248e064a1c366da4fe07b3068266fe59/raystack/optimus/core/v1beta1/runtime.proto) diff --git a/docs/docs/reference/FAQ.md b/docs/docs/reference/FAQ.md index 69e61ececc..7cb2212806 100644 --- a/docs/docs/reference/FAQ.md +++ b/docs/docs/reference/FAQ.md @@ -1,8 +1,3 @@ ---- -id: faq -title: FAQ ---- - # FAQ - **I want to run a DDL/DML query like DELETE, how can I do that?** @@ -12,4 +7,32 @@ title: FAQ - **What should not be changed once the specifications are created?** - Optimus uses Airflow for scheduling job execution and it does not support change of start_date & schedule_interval once the dag is created. For that please delete the existing one or recreate it with a different suffix. Also make sure you don’t change the dag name if you don’t want to lose the run history of Airflow. + Optimus uses Airflow for scheduling job execution and it does not support change of start_date & schedule_interval + once the dag is created. For that please delete the existing one or recreate it with a different suffix. + Also make sure you don’t change the dag name if you don’t want to lose the run history of Airflow. + +- **Can I have a job with only a transformation task (without a hook) or the other way around?** + + Transformation task is mandatory but hook is optional. You can have a transformation task without a hook but cannot + have a hook without a transformation task. + +- **I have a job with a modified view source, however, it does not detect as modified when running the job replace-all command. + How should I apply the change?** + + It does not detect as modified as the specification and the assets of the job itself is not changed. Do run the job refresh command. + +- **My job is failing due to the resource is not sufficient. Can I scale a specific job to have a bigger CPU / memory limit?** + + Yes, resource requests and limits are configurable in the job specification’s metadata field. + +- **I removed a resource specification, but why does the resource is not deleted in the BigQuery project?** + + Optimus currently does not support resource deletion to avoid any accidental deletion. + +- **I removed a job specification, but why does it still appear in Airflow UI?** + + You might want to check the log of the replace-all command you are using. It will show whether your job has been + successfully deleted or not. If not, the possible causes are the job is being used by another job as a dependency. + You can force delete it through API if needed. + + If the job has been successfully deleted, it might take time for the deletion to reflect which depends on your Airflow sync or DAG load configuration. diff --git a/docs/docs/reference/metrics.md b/docs/docs/reference/metrics.md new file mode 100644 index 0000000000..85ff959a2c --- /dev/null +++ b/docs/docs/reference/metrics.md @@ -0,0 +1,50 @@ +# Metrics + +## Job Change Metrics + +| Name | Type | Description | Labels | +|----------------------------------|---------|------------------------------------------------------|--------------------------------------------------| +| job_events_total | counter | Number of job changes attempt. | project, namespace, status | +| job_upload_total | counter | Number of jobs uploaded to scheduler. | project, namespace, status | +| job_removal_total | counter | Number of jobs removed from scheduler. | project, namespace, status | +| job_namespace_migrations_total | counter | Number of jobs migrated from a namespace to another. | project, namespace_source, namespace_destination | +| job_replace_all_duration_seconds | counter | Duration of job 'replace-all' process in seconds. | project, namespace | +| job_refresh_duration_seconds | counter | Duration of job 'refresh' process in seconds. | project | +| job_validation_duration_seconds | counter | Duration of job 'validation' process in seconds. | project, namespace | + +## JobRun Metrics + +| Name | Type | Description | Labels | +|------------------------------|---------|-----------------------------------------------------------------------------------------------------------------------|------------------------------------------| +| jobrun_events_total | counter | Number of jobrun events in a job broken by the status, e.g sla_miss, wait_upstream, in_progress, success, failed. | project, namespace, job, status | +| jobrun_sensor_events_total | counter | Number of sensor run events broken by the event_type, e.g start, retry, success, fail. | project, namespace, event_type | +| jobrun_task_events_total | counter | Number of task run events for a given operator (task name) broken by the event_type, e.g start, retry, success, fail. | project, namespace, event_type, operator | +| jobrun_hook_events_total | counter | Number of hook run events for a given operator (task name) broken by the event_type, e.g start, retry, success, fail. | project, namespace, event_type, operator | +| jobrun_replay_requests_total | counter | Number of replay requests for a single job. | project, namespace, job, status | +| jobrun_alerts_total | counter | Number of the alerts triggered broken by the alert type. | project, namespace, type | + +## Resource Metrics + +| Name | Type | Description | Labels | +|--------------------------------------|---------|---------------------------------------------------------------------------------|--------------------------------------------------| +| resource_events_total | counter | Number of resource change attempts broken down by the resource type and status. | project, namespace, datastore, type, status | +| resource_namespace_migrations_total | counter | Number of resources migrated from a namespace to another namespace. | project, namespace_source, namespace_destination | +| resource_upload_all_duration_seconds | gauge | Duration of uploading all resource specification in seconds. | project, namespace | +| resource_backup_requests_total | counter | Number of backup requests for a single resource. | project, namespace, resource, status | + +## Tenant Metrics + +| Name | Type | Description | Labels | +|----------------------|---------|------------------------------------|----------------------------| +| secret_events_total | counter | Number of secret change attempts. | project, namespace, status | + +## System Metrics + +| Name | Type | Description | Labels | +|-------------------------------------|---------|----------------------------------------------------------|--------| +| application_heartbeat | counter | Optimus server heartbeat pings. | - | +| application_uptime_seconds | gauge | Seconds since the application started. | - | +| notification_queue_total | counter | Number of items queued in the notification channel. | type | +| notification_worker_batch_total | counter | Number of worker executions in the notification channel. | type | +| notification_worker_send_err_total | counter | Number of events created and to be sent to writer. | type | +| publisher_kafka_events_queued_total | counter | Number of events queued to be published to kafka topic. | - | diff --git a/docs/docs/reference/shell-autocompletion.md b/docs/docs/reference/shell-autocompletion.md deleted file mode 100644 index e4704afb25..0000000000 --- a/docs/docs/reference/shell-autocompletion.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -id: shell-autocompletion -title: Shell autocompletion ---- -### Bash auto-completion - -The optimus completion script for Bash can be generated with `optimus completion bash`. Sourcing this script in your shell enables optimus completion. - -However, the completion script depends on bash-completion, which means that you have to install this software first (you can test if you have bash-completion already installed by running -`type _init_completion`). - - ->Warning: There are two versions of bash-completion, v1 and v2. V1 is for Bash 3.2 (which is the default on macOS), and v2 is for Bash 4.1+. The optimus completion script doesn't work correctly with bash-completion v1 and Bash 3.2. It requires bash-completion v2 and Bash 4.1+. Thus, to be able to correctly use optimus completion on macOS, you have to install and use Bash 4.1+ (instructions). The following instructions assume that you use Bash 4.1+ (that is, any Bash version of 4.1 or newer). - - -You now have to ensure that the optimus completion script gets sourced in all your shell sessions. There are multiple ways to achieve this: -- Source the completion script in your ~/.bash_profile file: - -``` -echo 'source <(optimus completion bash)' >> ~/.bash_profile -``` - -- Add the completion script to the /usr/local/etc/bash_completion.d directory: -``` -# To load completions for each session, execute once: -# Linux: -$ optimus completion bash > /etc/bash_completion.d/_optimus -# macOS: -$ optimus completion bash > /usr/local/etc/bash_completion.d/_optimus -``` - -- If you installed optimus with Homebrew (as explained in [getting started](../getting-started/installation.md)), then the optimus completion script should already be in /usr/local/etc/bash_completion.d/_optimus. In that case, you don't need to do anything. - ->Note: The Homebrew installation of bash-completion v2 sources all the files in the BASH_COMPLETION_COMPAT_DIR directory, that's why the latter two methods work. - -In any case, after reloading your shell, optimus completion should be working. - - -### Zsh Auto-completion - -The optimus completion script for Zsh can be generated with the command `optimus completion zsh`. Sourcing the completion script in your shell enables optimus autocompletion. - -- If shell completion is not already enabled in your environment, you will need to enable it. You can execute the following once: - ->If you get an error like `complete:13: command not found: compdef`, then add the following to the beginning of your `~/.zshrc` file: - -``` - $ echo "autoload -U compinit; compinit" >> ~/.zshrc -``` -- To load completions for each session, execute once: -``` - $ optimus completion zsh > "${fpath[1]}/_optimus" -``` -- Now start a new shell for this setup to take effect and execute the below command to do sourcing in all your shell session: -``` - $ source ~/.zshrc -``` - -After setup is completed -``` - # Run the following command in shell (bash/zsh) - $ optimus [tab][tab] -``` - -Output : - ``` -$ optimus -Optimus is an easy-to-use, reliable, and performant workflow orchestrator for -data transformation, data modeling, pipelines, and data quality management. - -For passing authentication header, set one of the following environment -variables: -1. OPTIMUS_AUTH_BASIC_TOKEN -2. OPTIMUS_AUTH_BEARER_TOKEN - -USAGE - optimus [flags] - -CORE COMMANDS - backup Backup a resource and its downstream - deploy Deploy current optimus project to server - job Interact with schedulable Job - replay Re-running jobs in order to update data for older dates/partitions - resource Interact with data resource - -DEV COMMANDS - serve Starts optimus service - -ADDITIONAL COMMANDS - completion generate the autocompletion script for the specified shell - config Manage optimus configuration required to deploy specifications - extension Operate with extension - help Help about any command - version Print the client version information - -FLAGS - --help Show help for command - --no-color Disable colored output - -EXAMPLES - $ optimus job create - $ optimus backup create - $ optimus backup list - $ optimus replay create - -LEARN MORE - Use 'optimus --help' for more information about a command. - Read the manual at https://odpf.github.io/optimus/ - -FEEDBACK - Open an issue here https://github.com/odpf/optimus/issues - ``` \ No newline at end of file diff --git a/docs/docs/rfcs/20220507_simplify_plugin_maintenance.md b/docs/docs/rfcs/20220507_simplify_plugin_maintenance.md index da7a0e5bb2..7944089e03 100644 --- a/docs/docs/rfcs/20220507_simplify_plugin_maintenance.md +++ b/docs/docs/rfcs/20220507_simplify_plugin_maintenance.md @@ -8,25 +8,33 @@ The scope of this rfc is to simplify the release and deployment operations w.r.t the optimus plugin ecosystem. The proposal here is to : -1. **Avoid Wrapping Executor Images** : -Decouple the executor_boot_process and the executor as separate containers where the airflow worker launches a pod with init-container (for boot process) adjacent to executor container. + +1. **Avoid Wrapping Executor Images** : + Decouple the executor_boot_process and the executor as separate containers where the airflow worker launches a pod with init-container (for boot process) adjacent to executor container. 2. **Simplfy Plugin Installation** : - - `Server end` : Install plugins declaratively at runtime instead of manually baking them into the optimus server image (in kubernetes setup). - - `Client end` : Plugin interface for client-end is limited to support Version, Survey Questions and Answers etc. that can be extracted out from the current plugin interface and maintained as yaml file which simplifies platform dependent plugin distribution for cli. + - `Server end` : Install plugins declaratively at runtime instead of manually baking them into the optimus server image (in kubernetes setup). + - `Client end` : Plugin interface for client-end is limited to support Version, Survey Questions and Answers etc. that can be extracted out from the current plugin interface and maintained as yaml file which simplifies platform dependent plugin distribution for cli. + # Technical Design + ## Background : + ### Changes that trigger a new release in Optimus setup: -* Executor Image changes -* Executor Image Wrapper changes -* Plugin binary changes -* Optimus binary changes + +- Executor Image changes +- Executor Image Wrapper changes +- Plugin binary changes +- Optimus binary changes ### Release dependencies as per current design -* `Executor Image release` -> `Executor Wrapper Image release` -> `Plugin binary release` -> `Server release` -* `Plugin binary release` -> `Server release` -### 1. Avoid Wrapping Executor Images : -* The `executor_boot_process` and `executor` are coupled: +- `Executor Image release` -> `Executor Wrapper Image release` -> `Plugin binary release` -> `Server release` +- `Plugin binary release` -> `Server release` + +### 1. Avoid Wrapping Executor Images : + +- The `executor_boot_process` and `executor` are coupled: + ``` -- Plugin repo structure /task/ @@ -35,14 +43,15 @@ Decouple the executor_boot_process and the executor as separate containers where ``` Executor Wrapper Image (Task Image) : + - It's a wrapper around the executor_image to facilitate boot mechanism for executor. - The optimus binary is downloaded during buildtime of this image. - During runtime, it does as follow : - - Fetch assets, secrets, env from optimus server. - - Load the env and launches the executor process. + - Fetch assets, secrets, env from optimus server. + - Load the env and launches the executor process. ``` -task_image +task_image | executor_image | optimus-bin | entrypoint.sh (load assets, env and launch executor) @@ -50,37 +59,44 @@ task_image The `optimus-bin` and `entrypoint.sh` are baked into the `task_image` and is being maintained by task/plugin developers. -### 2. Simplify Plugin Installation : -* Plugin binaries are manually installed (baked into optimus image in kubernetes setup). -* Any change in plugin code demands re-creation of optimus image with new plugin binary, inturn demanding redeployment of optimus server. (in kubernetes setup) -* At client side, plugin binaries require support for different platforms. +### 2. Simplify Plugin Installation : + +- Plugin binaries are manually installed (baked into optimus image in kubernetes setup). +- Any change in plugin code demands re-creation of optimus image with new plugin binary, inturn demanding redeployment of optimus server. (in kubernetes setup) +- At client side, plugin binaries require support for different platforms. ## Approach : + ### 1. Avoid Wrapping Executor Images : -* Decouple the lifecycle of the executor and the boot process as seperate containers/images. + +- Decouple the lifecycle of the executor and the boot process as seperate containers/images. Simplify Plugins Executor **Task Boot Sequence**: + 1. Airflow worker fetches env and secrets for the job and adds them to the executor pod as environment variables. 2. KubernetesPodOperator spawns init-container and executor-container, mounted with shared volume (type emptyDir) for assets. 3. `init-container` fetches assets, config, env files and writes onto the shared volume. 4. the default entrypoint in the executor-image starts the actual job. - ### 2. Simplify Plugin Installations : + #### A) Plugin Manager: -+ Currently the plugins are maintained as monorepo and versioned together. For any change in a single plugin, a new tar file containing all plugin binaries is created and released. -+ A plugin manager is required to support declarative installation of plugins so that plugins can be independently versioned, packaged and installed. -+ This plugin manager consumes a config (plugins_config) and downloads artifacts from a plugin repository. + +- Currently the plugins are maintained as monorepo and versioned together. For any change in a single plugin, a new tar file containing all plugin binaries is created and released. +- A plugin manager is required to support declarative installation of plugins so that plugins can be independently versioned, packaged and installed. +- This plugin manager consumes a config (plugins_config) and downloads artifacts from a plugin repository. + * Optimus support for plugin manager as below. - * `optimus plugin install -c config.yaml` -- at server + - `optimus plugin install -c config.yaml` -- at server * Support for different kinds of plugin repositories (like s3, gcs, url, local file system etc..) gives the added flexibility and options to distribute and install the plugin binaries in different ways. * Plugins are installed at container runtime and this decouples the building of optimus docker image from plugins installations. -* Example for the plugin_config: +* Example for the plugin_config: + ```yaml plugin: dir: .plugins @@ -88,25 +104,27 @@ plugin: # local filesystem for dev - ../transformers/dist/bq2bq_darwin_arm64/optimus-bq2bq_darwin_arm64 # any http uri - - https://github.com/odpf/optimus/releases/download/v0.2.5/optimus_0.2.5_linux_arm64.tar.gz - - ``` + - https://github.com/raystack/optimus/releases/download/v0.2.5/optimus_0.2.5_linux_arm64.tar.gz +``` + #### B) Yaml Plugin Interface: (for client side simplification) -+ Currently plugins are implemented and distributed as binaries and as clients needs to install them, it demands support for different host architectures. -+ Since CLI (client side) plugins just require details about plugin such as Version, Suevery Questions etc. the proposal here is to maintain CLI plugins as yaml files. -+ Implementation wise, the proposal here is to split the current plugin interface (which only supports interaction with binary plugins) to also accommodate yaml based plugins. -+ The above mentioned pluign manager, at server end, would be agnostic about the contents of plugin artifacts from the repository. -+ At client side, the CLI could sync the yaml files from the server to stay up-to-date with the server w.r.t plugins. -+ At this point, we have the scope to move away from binary plugins except for bq2bq plugin due to its depdendency on `ComplileAsset` and `ResolveDependency` functionalities which are required at server end (not at cli). -+ Handling Bq2Bq plugin: - + Move `CompileAsset` functionality as a part of Bq2bq executor. - + Move `ResolveDependency` functionality to optimus core which should support dependecy-resolution on standard-sql -+ Meanwhile the Bq2bq plugin is handled, the plugin interface can be maintanined in such a way that it also supports binary plugin in addition to yaml (as backward compaitbility feature). -+ The plugin discovery logic should be to load binary if present, else load yaml file; for a single plugin. -+ Now that we have yaml files at server, CLI can sync only the yaml files from the server. - * `optimus plugin sync -c optimus.yaml` - -* Example representation of the yaml plugin : + +- Currently plugins are implemented and distributed as binaries and as clients needs to install them, it demands support for different host architectures. +- Since CLI (client side) plugins just require details about plugin such as Version, Suevery Questions etc. the proposal here is to maintain CLI plugins as yaml files. +- Implementation wise, the proposal here is to split the current plugin interface (which only supports interaction with binary plugins) to also accommodate yaml based plugins. +- The above mentioned pluign manager, at server end, would be agnostic about the contents of plugin artifacts from the repository. +- At client side, the CLI could sync the yaml files from the server to stay up-to-date with the server w.r.t plugins. +- At this point, we have the scope to move away from binary plugins except for bq2bq plugin due to its depdendency on `ComplileAsset` and `ResolveDependency` functionalities which are required at server end (not at cli). +- Handling Bq2Bq plugin: + - Move `CompileAsset` functionality as a part of Bq2bq executor. + - Move `ResolveDependency` functionality to optimus core which should support dependecy-resolution on standard-sql +- Meanwhile the Bq2bq plugin is handled, the plugin interface can be maintanined in such a way that it also supports binary plugin in addition to yaml (as backward compaitbility feature). +- The plugin discovery logic should be to load binary if present, else load yaml file; for a single plugin. +- Now that we have yaml files at server, CLI can sync only the yaml files from the server. + - `optimus plugin sync -c optimus.yaml` + +* Example representation of the yaml plugin : + ```yaml name: bq2bq description: BigQuery to BigQuery transformation task @@ -116,7 +134,7 @@ pluginmods: - dependencyresolver pluginversion: 0.1.0-SNAPSHOT-27cb56f apiversion: [] -image: docker.io/odpf/optimus-task-bq2bq-executor:0.1.0-SNAPSHOT-27cb56f +image: docker.io/raystack/optimus-task-bq2bq-executor:0.1.0-SNAPSHOT-27cb56f secretpath: /tmp/auth.json dependson: [] hooktype: "" @@ -161,13 +179,12 @@ defaultassets: -- SQL query goes here Select * from "project.dataset.table"; - - ``` -## Result: -Simplify Plugins +``` -* Executor boot process is standardised and extracted away from plugin developers. Now any arbitrary image can be used for executors. -* At server side, for changes in plugin (dur to plugin release), update the plugin_manager_config and restart the optimus server pod. The plugin manager is expected to reinstall the plugins. -* Client side dependency on plugins is simplified with yaml based plugins. +## Result: +Simplify Plugins +- Executor boot process is standardised and extracted away from plugin developers. Now any arbitrary image can be used for executors. +- At server side, for changes in plugin (dur to plugin release), update the plugin_manager_config and restart the optimus server pod. The plugin manager is expected to reinstall the plugins. +- Client side dependency on plugins is simplified with yaml based plugins. diff --git a/docs/docs/roadmap.md b/docs/docs/roadmap.md deleted file mode 100644 index cf8b9f8b5b..0000000000 --- a/docs/docs/roadmap.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -id: roadmap -title: Roadmap -slug: /roadmap ---- - -This is a live document which gives an idea for all the users of Optimus on what are we upto. - -### Secret Management in Optimus -As optimus meant to deal with various warehouse systems & with the plugin support provides the capability to interact with other third party systems. -It brings a need for proper secret management to store & use securely for all users onboard. - -### Test Your Jobs -Giving a provision for users to test the jobs before deploying helps users with faster feedbacks. - -### Telemetry -With proper monitoring we can get many insights into Optimus, which helps in debugging any failures. May not be a direct end user feature but this is very important. - -### Add More Plugins -Once the data is analyzed in warehouse, there is always a need for getting the data out of the system for visualizations or for consumption. This is a constant effort to improve the ecosystem that optimus supports. -The plugins that we will be adding support is to pull data from BQ to Kafka, JDBC, FTP. - -### Task Versioning -Versioning of tasks comes to handy when there is a time significance associated to task. -On replay, an older version of task has to run which was active at that time and the newer version on the coming days. - -### Improved Window Support -The current windowing which is used by for automated dependency resoultion & the macros which are derived from it are being used for input data filtering is little confusing & limiting in nature. -This will be an effort to easy the same. - -### SLA Tracking -Giving a provision for defining the SLAs & providing a dashboard to visualize how the slas are met is a must. -With this users will be able to monitor any slas that are breached out of the box. - -### SQLite Support -With support of SQLlite database, just helps users to kick start Optimus fast & easy to try on without having a dependency on postgres. - -### Custom Macro Support -Custom Macros will unleash many capabilities, this will help users to template their queries to avoid any duplication. - -### Inbuilt Testing F/w -Currently Optimus relies on Predator for Quality Checks, instead of relying on predator which is not extensible & supports only BQ, providing a capability to test the job runs directly. - -### Inter Task/Hook Communication -As we scale, there are situations where tasks & hooks has to share information directly instead of relying on another system. This opens up many capabilities. diff --git a/docs/docs/server-guide/configuration.md b/docs/docs/server-guide/configuration.md new file mode 100644 index 0000000000..1be99d983d --- /dev/null +++ b/docs/docs/server-guide/configuration.md @@ -0,0 +1,20 @@ +# Server Configuration +See the server configuration example on config.sample.yaml. + +| Configuration | Description | +|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Log | Logging level & format configuration. | +| Serve | Represents any configuration needed to start Optimus, such as port, host, DB details, and application key (for secrets encryption). | +| Scheduler | Any scheduler-related configuration. Currently, Optimus only supports Airflow and has been set to default. | +| Telemetry | Can be used for tracking and debugging using Jaeger. | +| Plugin | Optimus will try to look for the plugin artifacts through this configuration. | +| Resource Manager | If your server has jobs that are dependent on other jobs in another server, you can add that external Optimus server host as a resource manager. | + +_Note:_ + +Application key can be randomly generated using: +```shell +head -c 50 /dev/random | base64 +``` +Just take the first 32 characters of the string. + diff --git a/docs/docs/server-guide/db-migrations.md b/docs/docs/server-guide/db-migrations.md new file mode 100644 index 0000000000..a3dd166970 --- /dev/null +++ b/docs/docs/server-guide/db-migrations.md @@ -0,0 +1,34 @@ +# DB Migrations + +## Migrate to Specific Version +Upgrade the DB to the specified migration version. +```shell +$ optimus migration to --version [version] +``` +_Note: To migrate to the latest one, running the Optimus’ serve command should be enough. It will migrate to the latest +automatically._ + +## Rollback +Revert the current active migration to several previous migration versions. +```shell +$ optimus migration rollback --count [n] +``` +[n] is the number of migrations to rollback. + +## Export & Upload +In some cases, due to differences in how Optimus is storing the job and resource specifications in DB in 1 version to +another version, you might want to export the jobs in the server to your local YAML files and redeploy it. + +The export is possible using the following command: +```shell +$ optimus job export –-dir job_result +``` + +This means, you will export all of the jobs from all of the projects in your Optimus server to the job_result directory. It is also possible to run this export command against a single project/namespace/job. + +For exporting resources, use the following command: +```shell +$ optimus resource export -dir resource_result +``` + +Similar to the job command, it is also possible to export resources only for a single project/namespace/resource. diff --git a/docs/docs/server-guide/installing-plugins.md b/docs/docs/server-guide/installing-plugins.md new file mode 100644 index 0000000000..2605d3b728 --- /dev/null +++ b/docs/docs/server-guide/installing-plugins.md @@ -0,0 +1,31 @@ +# Installing Plugins +Plugin needs to be installed in the Optimus server before it can be used. Optimus uses the following directories for +discovering plugin binaries + +``` +./.plugins +./ +/ +/.optimus/plugins +$HOME/.optimus/plugins +/usr/bin +/usr/local/bin +``` + +Even though the above list of directories is involved in plugin discovery, it is advised to use .plugins in the +current working directory of the project or Optimus binary. + +To simplify installation, you can add plugin artifacts in the server config: +```yaml +plugin: + artifacts: + - https://...path/to/optimus-plugin-neo.yaml # http + - http://.../plugins.zip # zip + - ../transformers/optimus-bq2bq_darwin_arm64 # relative paths + - ../transformers/optimus-plugin-neo.yaml +``` + +Run below command to auto-install the plugins in the `.plugins` directory. +```shell +$ optimus plugin install -c config.yaml # This will install plugins in the `.plugins` folder. +``` diff --git a/docs/docs/server-guide/starting-optimus-server.md b/docs/docs/server-guide/starting-optimus-server.md new file mode 100644 index 0000000000..10d4e65377 --- /dev/null +++ b/docs/docs/server-guide/starting-optimus-server.md @@ -0,0 +1,54 @@ +# Starting Optimus Server +Starting a server requires server configuration, which can be loaded from file (use --config flag), environment +variable `OPTIMUS_[CONFIGNAME]`, or config.yaml file in Optimus binary directory. + +**1. Using --config flag** + ```shell + $ optimus serve --config /path/to/config/file.yaml + ``` + +If you specify the configuration file using the --config flag, then any configs defined in the env variable and default +config.yaml from the Optimus binary directory will not be loaded. + +**2. Using environment variable** + +All the configs can be passed as environment variables using `OPTIMUS_[CONFIG_NAME]` convention. [CONFIG_NAME] is the +key name of config using `_` as the path delimiter to concatenate between keys. + +For example, to use the environment variable, assuming the following configuration layout: + +```yaml +version: 1 +serve: + port: 9100 + app_key: randomhash +``` + + +Here is the corresponding environment variable for the above + +| Configuration key | Environment variable | +|--------------------|-----------------------| +| version | OPTIMUS_VERSION | +| serve.port | OPTIMUS_PORT | +| serve.app_key | OPTIMUS_SERVE_APP_KEY | + + + +Set the env variable using export +```shell +$ export OPTIMUS_PORT=9100 +``` + + +Note: If you specify the env variable and you also have config.yaml in the Optimus binary directory, then any configs +from the env variable will override the configs defined in config.yaml in Optimus binary directory. + + +**3. Using default config.yaml from Optimus binary directory** +```shell +$ which optimus +/usr/local/bin/optimus +``` + +So the config.yaml file can be loaded on /usr/local/bin/config.yaml diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index da84181962..c0da5a35c8 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -5,13 +5,13 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula'); module.exports = { title: 'Optimus', tagline: 'Performant data workflow orchestrator', - url: 'https://odpf.github.io', + url: 'https://raystack.github.io', baseUrl: '/optimus/', onBrokenLinks: 'throw', // trailingSlash: true, onBrokenMarkdownLinks: 'warn', favicon: 'img/favicon.ico', - organizationName: 'odpf', + organizationName: 'raystack', projectName: 'optimus', themeConfig: { @@ -41,7 +41,7 @@ module.exports = { className: 'header-slack-link', }, { - href: 'https://github.com/odpf/optimus', + href: 'https://github.com/raystack/optimus', className: 'navbar-item-github', position: 'right', }, @@ -53,10 +53,10 @@ module.exports = { { title: 'Products', items: [ - { label: 'Meteor', href: 'https://github.com/odpf/meteor' }, - { label: 'Firehose', href: 'https://github.com/odpf/firehose' }, - { label: 'Raccoon', href: 'https://github.com/odpf/raccoon' }, - { label: 'Dagger', href: 'https://odpf.github.io/dagger/' }, + { label: 'Meteor', href: 'https://github.com/raystack/meteor' }, + { label: 'Firehose', href: 'https://github.com/raystack/firehose' }, + { label: 'Raccoon', href: 'https://github.com/raystack/raccoon' }, + { label: 'Dagger', href: 'https://raystack.github.io/dagger/' }, ], }, { @@ -71,11 +71,11 @@ module.exports = { title: 'Community', items: [ { label: 'Slack', href: 'https://bit.ly/2RzPbtn' }, - { label: 'GitHub', href: 'https://github.com/odpf/optimus' } + { label: 'GitHub', href: 'https://github.com/raystack/optimus' } ], }, ], - copyright: `Copyright © 2020-${new Date().getFullYear()} ODPF`, + copyright: `Copyright © 2020-${new Date().getFullYear()} raystack`, }, prism: { theme: lightCodeTheme, @@ -83,7 +83,7 @@ module.exports = { }, announcementBar: { id: 'star-repo', - content: '⭐️ If you like Optimus, give it a star on GitHub! ⭐', + content: '⭐️ If you like Optimus, give it a star on GitHub! ⭐', backgroundColor: '#222', textColor: '#eee', isCloseable: true, @@ -101,12 +101,12 @@ module.exports = { showLastUpdateAuthor: true, showLastUpdateTime: true, sidebarPath: require.resolve('./sidebars.js'), - editUrl: 'https://github.com/odpf/optimus/edit/master/docs/', + editUrl: 'https://github.com/raystack/optimus/edit/master/docs/', }, blog: { showReadingTime: true, editUrl: - 'https://github.com/odpf/optimus/edit/master/docs/blog/', + 'https://github.com/raystack/optimus/edit/master/docs/blog/', }, theme: { customCss: [ diff --git a/docs/sidebars.js b/docs/sidebars.js index f50cfd5ab1..7cbc46d04c 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -20,55 +20,82 @@ module.exports = { label: "Getting Started", items: [ "getting-started/installation", - "getting-started/configuration" + "getting-started/quick-start" ], collapsed: false, }, { type: "category", - label: "Guides", + label: "Concept", items: [ - "guides/create-job", - "guides/adding-hook", - "guides/create-bigquery-dataset", - "guides/create-bigquery-table", - "guides/create-bigquery-view", - "guides/create-bigquery-external-table", - "guides/organising-specifications", - "guides/optimus-serve", - "guides/task-bq2bq", - "guides/extension", - "guides/backup", - "guides/replay", - "guides/secret", - "guides/refresh-jobs", - "guides/alerts" + "concepts/architecture", + "concepts/project", + "concepts/namespace", + "concepts/resource", + "concepts/job", + "concepts/job-run", + "concepts/dependency", + "concepts/macros", + "concepts/intervals-and-windows", + "concepts/secret", + "concepts/plugin", + "concepts/replay-and-backup", ], }, { type: "category", - label: "Concepts", + label: "Server Guide", items: [ - "concepts/overview", - "concepts/architecture", - "concepts/intervals-and-windows", + "server-guide/configuration", + "server-guide/installing-plugins", + "server-guide/starting-optimus-server", + "server-guide/db-migrations", ], }, { type: "category", - label: "Development", - items: ["development/building-plugin"], + label: "Client Guide", + items: [ + "client-guide/configuration", + "client-guide/managing-project-namespace", + "client-guide/managing-secrets", + "client-guide/installing-plugin", + "client-guide/manage-bigquery-resource", + "client-guide/create-job-specifications", + "client-guide/setting-up-alert", + "client-guide/verifying-jobs", + "client-guide/applying-job-specifications", + "client-guide/uploading-jobs-to-scheduler", + "client-guide/organizing-specifications", + "client-guide/backup-bigquery-resource", + "client-guide/replay-a-job", + "client-guide/work-with-extension", + ], + }, + { + type: "category", + label: "Building a Plugin", + items: [ + "building-plugin/introduction", + "building-plugin/tutorial", + ], }, { type: "category", label: "Contribute", - items: ["contribute/contributing"], + items: [ + "contribute/contribution-process", + "contribute/developer-env-setup", + ], }, - 'roadmap', { type: "category", label: "Reference", - items: ["reference/api", "reference/faq", "reference/shell-autocompletion"], + items: [ + "reference/api", + "reference/metrics", + "reference/faq", + ], }, ], }; diff --git a/docs/src/pages/help.js b/docs/src/pages/help.js index b10a5f40e4..408970dcde 100644 --- a/docs/src/pages/help.js +++ b/docs/src/pages/help.js @@ -25,7 +25,7 @@ export default function Home() {
The Optimus team has an open source slack workspace to discuss development and support. Most of the Optimus discussions happen in #optimus channel. -
Join us on Slack +
Join us on Slack
) }, { @@ -33,7 +33,7 @@ export default function Home() { content: (
Have a general issue or bug that you've found? We'd love to hear about it in our GitHub issues. This can be feature requests too! -
Go to issues +
Go to issues
) }, @@ -42,7 +42,7 @@ export default function Home() { content: (
For help and questions about best practices, join our GitHub discussions. Browse and ask questions. -
Go to discussions +
Go to discussions
) } diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js index 8b687df46a..5013e7b769 100644 --- a/docs/src/pages/index.js +++ b/docs/src/pages/index.js @@ -20,7 +20,7 @@ const Hero = () => {
-
+
diff --git a/docs/static/img/banner-0.6.png b/docs/static/img/banner-0.6.png new file mode 100644 index 0000000000..316a581e78 Binary files /dev/null and b/docs/static/img/banner-0.6.png differ diff --git a/docs/static/img/docs/Concept_JobRun.png b/docs/static/img/docs/Concept_JobRun.png new file mode 100644 index 0000000000..df196c45d1 Binary files /dev/null and b/docs/static/img/docs/Concept_JobRun.png differ diff --git a/docs/static/img/docs/CreateJobSpecFlow.png b/docs/static/img/docs/CreateJobSpecFlow.png new file mode 100644 index 0000000000..3c552d77ec Binary files /dev/null and b/docs/static/img/docs/CreateJobSpecFlow.png differ diff --git a/docs/static/img/docs/OptimusArchitecture.png b/docs/static/img/docs/OptimusArchitecture.png new file mode 100644 index 0000000000..f671104358 Binary files /dev/null and b/docs/static/img/docs/OptimusArchitecture.png differ diff --git a/docs/static/img/docs/OptimusArchitecture_dark_07June2021.png b/docs/static/img/docs/OptimusArchitecture_dark_07June2021.png deleted file mode 100644 index c726ce62ec..0000000000 Binary files a/docs/static/img/docs/OptimusArchitecture_dark_07June2021.png and /dev/null differ diff --git a/docs/static/img/docs/OptimusIntro.png b/docs/static/img/docs/OptimusIntro.png new file mode 100644 index 0000000000..d5fd590b59 Binary files /dev/null and b/docs/static/img/docs/OptimusIntro.png differ diff --git a/docs/static/img/docs/ReplayParallel.png b/docs/static/img/docs/ReplayParallel.png new file mode 100644 index 0000000000..14a012ab4d Binary files /dev/null and b/docs/static/img/docs/ReplayParallel.png differ diff --git a/docs/static/img/docs/ReplaySequential.png b/docs/static/img/docs/ReplaySequential.png new file mode 100644 index 0000000000..9b9c663ac0 Binary files /dev/null and b/docs/static/img/docs/ReplaySequential.png differ diff --git a/ext/notify/notify.go b/ext/notify/notify.go index c45cd83865..47a8370c65 100644 --- a/ext/notify/notify.go +++ b/ext/notify/notify.go @@ -1,6 +1,6 @@ package notify import ( - _ "github.com/odpf/optimus/ext/notify/pagerduty" - _ "github.com/odpf/optimus/ext/notify/slack" + _ "github.com/raystack/optimus/ext/notify/pagerduty" + _ "github.com/raystack/optimus/ext/notify/slack" ) diff --git a/ext/notify/pagerduty/pagerdutynotifier.go b/ext/notify/pagerduty/pagerdutynotifier.go index 80dba260be..527b693aa2 100644 --- a/ext/notify/pagerduty/pagerdutynotifier.go +++ b/ext/notify/pagerduty/pagerdutynotifier.go @@ -10,7 +10,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/odpf/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler" ) const ( @@ -18,17 +18,18 @@ const ( ) var ( + notifierType = "pagerduty" pagerdutyQueueCounter = promauto.NewCounter(prometheus.CounterOpts{ - Name: "notify_pagerduty_queue", - Help: "Items queued in pagerduty notification channel", + Name: scheduler.MetricNotificationQueue, + ConstLabels: map[string]string{"type": notifierType}, }) pagerdutyWorkerBatchCounter = promauto.NewCounter(prometheus.CounterOpts{ - Name: "notify_pagerduty_worker_batch", - Help: "Worker execution count in pagerduty notification channel", + Name: scheduler.MetricNotificationWorkerBatch, + ConstLabels: map[string]string{"type": notifierType}, }) pagerdutyWorkerSendErrCounter = promauto.NewCounter(prometheus.CounterOpts{ - Name: "notify_pagerduty_worker_send_err", - Help: "Failure of messages in pagerduty notification channel worker", + Name: scheduler.MetricNotificationWorkerSendErr, + ConstLabels: map[string]string{"type": notifierType}, }) ) diff --git a/ext/notify/pagerduty/pagerdutynotifier_test.go b/ext/notify/pagerduty/pagerdutynotifier_test.go index 8f94e79851..2471456762 100644 --- a/ext/notify/pagerduty/pagerdutynotifier_test.go +++ b/ext/notify/pagerduty/pagerdutynotifier_test.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/notify/pagerduty" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/notify/pagerduty" ) type PagerDutyServiceImplMock struct { diff --git a/ext/notify/slack/slack.go b/ext/notify/slack/slack.go index 40e47cf5be..1379ff1e4d 100644 --- a/ext/notify/slack/slack.go +++ b/ext/notify/slack/slack.go @@ -12,7 +12,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" api "github.com/slack-go/slack" - "github.com/odpf/optimus/core/scheduler" + "github.com/raystack/optimus/core/scheduler" ) const ( @@ -21,17 +21,18 @@ const ( ) var ( + notifierType = "slack" slackQueueCounter = promauto.NewCounter(prometheus.CounterOpts{ - Name: "notify_slack_queue", - Help: "Items queued in slack notification channel", + Name: scheduler.MetricNotificationQueue, + ConstLabels: map[string]string{"type": notifierType}, }) slackWorkerBatchCounter = promauto.NewCounter(prometheus.CounterOpts{ - Name: "notify_slack_worker_batch", - Help: "Worker execution count in slack notification channel", + Name: scheduler.MetricNotificationWorkerBatch, + ConstLabels: map[string]string{"type": notifierType}, }) slackWorkerSendErrCounter = promauto.NewCounter(prometheus.CounterOpts{ - Name: "notify_slack_worker_send_err", - Help: "Failure of messages in slack notification channel worker", + Name: scheduler.MetricNotificationWorkerSendErr, + ConstLabels: map[string]string{"type": notifierType}, }) ) diff --git a/ext/notify/slack/slack_test.go b/ext/notify/slack/slack_test.go index 7b7d031f17..a2a4ebda7a 100644 --- a/ext/notify/slack/slack_test.go +++ b/ext/notify/slack/slack_test.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/structpb" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" ) func getTestUserProfile() api.UserProfile { diff --git a/ext/resourcemanager/model.go b/ext/resourcemanager/model.go index 35c87ff234..e18bd10ac1 100644 --- a/ext/resourcemanager/model.go +++ b/ext/resourcemanager/model.go @@ -18,7 +18,6 @@ type jobSpecification struct { EndDate string `json:"endDate"` Interval string `json:"interval"` DependsOnPast bool `json:"dependsOnPast"` - CatchUp bool `json:"catchUp"` TaskName string `json:"taskName"` Config []jobConfigItem `json:"config"` WindowSize string `json:"windowSize"` diff --git a/ext/resourcemanager/optimus.go b/ext/resourcemanager/optimus.go index a8e21bac1d..7352859289 100644 --- a/ext/resourcemanager/optimus.go +++ b/ext/resourcemanager/optimus.go @@ -10,9 +10,9 @@ import ( "github.com/mitchellh/mapstructure" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/tenant" ) // ResourceManager is repository for external job spec diff --git a/ext/resourcemanager/optimus_test.go b/ext/resourcemanager/optimus_test.go index 7197ec78cf..6541006695 100644 --- a/ext/resourcemanager/optimus_test.go +++ b/ext/resourcemanager/optimus_test.go @@ -9,10 +9,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/resourcemanager" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/resourcemanager" ) type OptimusResourceManager struct { diff --git a/ext/scheduler/airflow/__lib.py b/ext/scheduler/airflow/__lib.py index 3dbc547e09..d0b637de62 100644 --- a/ext/scheduler/airflow/__lib.py +++ b/ext/scheduler/airflow/__lib.py @@ -8,10 +8,12 @@ import requests from airflow.configuration import conf from airflow.hooks.base import BaseHook -from airflow.models import (XCOM_RETURN_KEY, Variable, XCom) +from airflow.models import (XCOM_RETURN_KEY, Variable, XCom, TaskReschedule ) from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import KubernetesPodOperator from airflow.providers.slack.operators.slack import SlackAPIPostOperator from airflow.sensors.base import BaseSensorOperator +from airflow.utils.state import TaskInstanceState +from airflow.exceptions import AirflowFailException from croniter import croniter from kubernetes.client import models as k8s @@ -26,15 +28,6 @@ SCHEDULER_ERR_MSG = "scheduler_error" -JOB_START_EVENT_NAME = "job_start_event" -JOB_END_EVENT_NAME = "job_end_event" - -EVENT_NAMES = { - "SENSOR_START_EVENT": "TYPE_SENSOR_START", - "TASK_START_EVENT": "TYPE_TASK_START" -} - - def lookup_non_standard_cron_expression(expr: str) -> str: expr_mapping = { '@yearly': '0 0 1 1 *', @@ -263,7 +256,7 @@ def _are_all_job_runs_successful(self, schedule_time_window_start, schedule_time self.log.info("job_run api response :: {}".format(api_response)) except Exception as e: self.log.warning("error while fetching job runs :: {}".format(e)) - return False + raise AirflowFailException(e) for job_run in api_response['jobRuns']: if job_run['state'] != 'success': self.log.info("failed for run :: {}".format(job_run)) @@ -307,9 +300,19 @@ def _xcom_value_has_error(_xcom) -> bool: if SCHEDULER_ERR_MSG in event_meta.keys(): failure_message = failure_message + ", " + event_meta[SCHEDULER_ERR_MSG] - print("failures: {}".format(failure_message)) + if len(failure_message)>0: + log.info(f'failures: {failure_message}') task_instance = context.get('task_instance') + + if event_meta["event_type"] == "TYPE_FAILURE" : + dag_run = context['dag_run'] + tis = dag_run.get_task_instances() + for ti in tis: + if ti.state == TaskInstanceState.FAILED: + task_instance = ti + break + message = { "log_url": task_instance.log_url, "task_id": task_instance.task_id, @@ -329,7 +332,7 @@ def _xcom_value_has_error(_xcom) -> bool: # post event log.info(event) resp = optimus_client.notify_event(params["project_name"], params["namespace"], params["job_name"], event) - print("posted event ", params, event, resp) + log.info(f'posted event {params}, {event}, {resp} ') return def get_run_type(context): @@ -394,9 +397,6 @@ def operator_start_event(context): def operator_success_event(context): try: run_type = get_run_type(context) - if run_type == "SENSOR": - print("clearing sensor xcom") - cleanup_xcom(context) meta = { "event_type": "TYPE_{}_SUCCESS".format(run_type), "status": "success" @@ -409,9 +409,6 @@ def operator_success_event(context): def operator_retry_event(context): try: run_type = get_run_type(context) - if run_type == "SENSOR": - print("clearing sensor xcom") - cleanup_xcom(context) meta = { "event_type": "TYPE_{}_RETRY".format(run_type), "status": "retried" @@ -424,9 +421,6 @@ def operator_retry_event(context): def operator_failure_event(context): try: run_type = get_run_type(context) - if run_type == "SENSOR": - print("clearing sensor xcom") - cleanup_xcom(context) meta = { "event_type": "TYPE_{}_FAIL".format(run_type), "status": "failed" @@ -453,7 +447,8 @@ def optimus_sla_miss_notify(dag, task_list, blocking_task_list, slas, blocking_t sla_list.append({ 'task_id': sla.task_id, 'dag_id': sla.dag_id, - 'scheduled_at': sla.execution_date.strftime(TIMESTAMP_FORMAT), + 'scheduled_at' : dag.following_schedule(sla.execution_date).strftime(TIMESTAMP_FORMAT), + 'airflow_execution_time': sla.execution_date.strftime(TIMESTAMP_FORMAT), 'timestamp': sla.timestamp.strftime(TIMESTAMP_FORMAT) }) @@ -470,23 +465,19 @@ def optimus_sla_miss_notify(dag, task_list, blocking_task_list, slas, blocking_t } # post event resp = optimus_client.notify_event(params["project_name"], params["namespace"], params["job_name"], event) - print("posted event ", params, event, resp) + log.info(f'posted event {params}, {event}, {resp}') return except Exception as e: print(e) def shouldSendSensorStartEvent(ctx): try: - ti = ctx.get('task_instance') - key = "sensorEvt/{}/{}/{}".format(ti.task_id , ctx.get('next_execution_date').strftime(TIMESTAMP_FORMAT) , ti.try_number) - - result = ti.xcom_pull(key=key) - if not result: - print("sending NEW sensor start event for attempt number ", ti.try_number) - ti.xcom_push(key=key, value=True) + ti=ctx['ti'] + task_reschedules = TaskReschedule.find_for_task_instance(ti) + if len(task_reschedules) == 0 : + log.info(f'sending NEW sensor start event for attempt number-> {ti.try_number}') return True - print("ignoring sending sensor start event as its already sent") - return False + log.info("ignoring sending sensor start event as its not first poke") except Exception as e: print(e) @@ -495,23 +486,13 @@ def get_result_for_monitoring_from_xcom(ctx): ti = ctx.get('task_instance') return_value = ti.xcom_pull(key='return_value') except Exception as e: - print(f'error getting result for monitoring: {e}') + log.info(f'error getting result for monitoring: {e}') if type(return_value) is dict: if 'monitoring' in return_value: return return_value['monitoring'] return None -def cleanup_xcom(ctx): - try: - from airflow import settings - session = settings.Session() - ti = ctx.get('task_instance') - key = "sensorEvt/{}/{}/{}".format(ti.task_id , ctx.get('next_execution_date').strftime(TIMESTAMP_FORMAT) , ti.try_number) - session.query(XCom).filter(XCom.key == key).delete() - except Exception as e: - print(e) - # everything below this is here for legacy reasons, should be cleaned up in future def alert_failed_to_slack(context): @@ -554,7 +535,8 @@ def _xcom_value_has_error(_xcom) -> bool: if _xcom_value_has_error(xcom): failure_messages.append(xcom.value['error']) failure_message = ", ".join(failure_messages) - print("failures: {}".format(failure_message)) + if failure_message != "": + log.info(f'failures: {failure_message}') message_body = "\n".join([ "• *DAG*: {}".format(current_dag_id), diff --git a/ext/scheduler/airflow/airflow.go b/ext/scheduler/airflow/airflow.go index d70af4273d..9ae542820f 100644 --- a/ext/scheduler/airflow/airflow.go +++ b/ext/scheduler/airflow/airflow.go @@ -13,14 +13,16 @@ import ( "time" "github.com/kushsharma/parallel" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "gocloud.dev/blob" "gocloud.dev/gcerrors" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/lib/cron" + "github.com/raystack/optimus/internal/telemetry" ) //go:embed __lib.py @@ -30,7 +32,9 @@ const ( EntityAirflow = "Airflow" dagStatusBatchURL = "api/v1/dags/~/dagRuns/list" + dagURL = "api/v1/dags/%s" dagRunClearURL = "api/v1/dags/%s/clearTaskInstances" + dagRunCreateURL = "api/v1/dags/%s/dagRuns" airflowDateFormat = "2006-01-02T15:04:05+00:00" schedulerHostKey = "SCHEDULER_HOST" @@ -39,13 +43,17 @@ const ( jobsDir = "dags" jobsExtension = ".py" - concurrentTicketPerSec = 40 - concurrentLimit = 600 + concurrentTicketPerSec = 50 + concurrentLimit = 100 + + metricJobUpload = "job_upload_total" + metricJobRemoval = "job_removal_total" + metricJobStateSuccess = "success" + metricJobStateFailed = "failed" ) type Bucket interface { WriteAll(ctx context.Context, key string, p []byte, opts *blob.WriterOptions) error - // ReadAll(ctx context.Context, key string) ([]byte, error) List(opts *blob.ListOptions) *blob.ListIterator Delete(ctx context.Context, key string) error Close() error @@ -106,10 +114,20 @@ func (s *Scheduler) DeployJobs(ctx context.Context, tenant tenant.Tenant, jobs [ }(job)) } + countDeploySucceed := 0 + countDeployFailed := 0 for _, result := range runner.Run() { - multiError.Append(result.Err) + if result.Err != nil { + countDeployFailed++ + multiError.Append(result.Err) + continue + } + countDeploySucceed++ } - return errors.MultiToError(multiError) + raiseSchedulerMetric(tenant, metricJobUpload, metricJobStateSuccess, countDeploySucceed) + raiseSchedulerMetric(tenant, metricJobUpload, metricJobStateFailed, countDeployFailed) + + return multiError.ToErr() } // TODO list jobs should not refer from the scheduler, rather should list from db and it has nothing to do with scheduler. @@ -151,33 +169,41 @@ func (s *Scheduler) DeleteJobs(ctx context.Context, t tenant.Tenant, jobNames [] if err != nil { return err } - multiError := errors.NewMultiError("ErrorsInDeleteJobs") + me := errors.NewMultiError("ErrorsInDeleteJobs") + countDeleteJobsSucceed := 0 + countDeleteJobsFailed := 0 for _, jobName := range jobNames { if strings.TrimSpace(jobName) == "" { - multiError.Append(errors.InvalidArgument(EntityAirflow, "job name cannot be an empty string")) + me.Append(errors.InvalidArgument(EntityAirflow, "job name cannot be an empty string")) continue } blobKey := pathFromJobName(jobsDir, t.NamespaceName().String(), jobName, jobsExtension) if err := bucket.Delete(spanCtx, blobKey); err != nil { // ignore missing files if gcerrors.Code(err) != gcerrors.NotFound { - multiError.Append(err) + countDeleteJobsFailed++ + me.Append(err) } + continue } + countDeleteJobsSucceed++ } + raiseSchedulerMetric(t, metricJobRemoval, metricJobStateSuccess, countDeleteJobsSucceed) + raiseSchedulerMetric(t, metricJobRemoval, metricJobStateFailed, countDeleteJobsFailed) + err = deleteDirectoryIfEmpty(ctx, t.NamespaceName().String(), bucket) if err != nil { if gcerrors.Code(err) != gcerrors.NotFound { - multiError.Append(err) + me.Append(err) } } - return errors.MultiToError(multiError) + return me.ToErr() } // deleteDirectoryIfEmpty remove jobs Folder if it exists func deleteDirectoryIfEmpty(ctx context.Context, nsDirectoryIdentifier string, bucket Bucket) error { spanCtx, span := startChildSpan(ctx, "deleteDirectoryIfEmpty") - span.End() + defer span.End() jobsDir := pathForJobDirectory(jobsDir, nsDirectoryIdentifier) @@ -235,11 +261,11 @@ func (s *Scheduler) GetJobRuns(ctx context.Context, tnnt tenant.Tenant, jobQuery dagRunRequest := getDagRunRequest(jobQuery, jobCron) reqBody, err := json.Marshal(dagRunRequest) if err != nil { - return nil, err + return nil, errors.Wrap(EntityAirflow, "unable to marshal dag run request", err) } req := airflowRequest{ - URL: dagStatusBatchURL, + path: dagStatusBatchURL, method: http.MethodPost, body: reqBody, } @@ -251,17 +277,58 @@ func (s *Scheduler) GetJobRuns(ctx context.Context, tnnt tenant.Tenant, jobQuery resp, err := s.client.Invoke(spanCtx, req, schdAuth) if err != nil { - return nil, fmt.Errorf("failure reason for fetching airflow dag runs: %w", err) + return nil, errors.Wrap(EntityAirflow, "failure while fetching airflow dag runs", err) } var dagRunList DagRunListResponse if err := json.Unmarshal(resp, &dagRunList); err != nil { - return nil, fmt.Errorf("json error on parsing airflow dag runs: %s: %w", string(resp), err) + return nil, errors.Wrap(EntityAirflow, fmt.Sprintf("json error on parsing airflow dag runs: %s", string(resp)), err) } return getJobRuns(dagRunList, jobCron) } +// UpdateJobState set the state of jobs as enabled / disabled on scheduler +func (s *Scheduler) UpdateJobState(ctx context.Context, tnnt tenant.Tenant, jobNames []job.Name, state string) error { + spanCtx, span := startChildSpan(ctx, "UpdateJobState") + defer span.End() + + var data []byte + switch state { + case "enabled": + data = []byte(`{"is_paused": false}`) + case "disabled": + data = []byte(`{"is_paused": true}`) + } + + schdAuth, err := s.getSchedulerAuth(ctx, tnnt) + if err != nil { + return err + } + ch := make(chan error, len(jobNames)) + for _, jobName := range jobNames { + go func(jobName job.Name) { + req := airflowRequest{ + path: fmt.Sprintf(dagURL, jobName), + method: http.MethodPatch, + body: data, + } + _, err := s.client.Invoke(spanCtx, req, schdAuth) + ch <- err + }(jobName) + } + me := errors.NewMultiError("update job state on scheduler") + for i := 0; i < len(jobNames); i++ { + me.Append(<-ch) + } + + if len(me.Errors) > 0 { + return errors.Wrap(EntityAirflow, "failure while updating dag status", me.ToErr()) + } + + return nil +} + func getDagRunRequest(jobQuery *scheduler.JobRunsCriteria, jobCron *cron.ScheduleSpec) DagRunRequest { if jobQuery.OnlyLastRun { return DagRunRequest{ @@ -318,9 +385,32 @@ func (s *Scheduler) ClearBatch(ctx context.Context, tnnt tenant.Tenant, jobName startExecutionTime.UTC().Format(airflowDateFormat), endExecutionTime.UTC().Format(airflowDateFormat))) req := airflowRequest{ - URL: dagRunClearURL, + path: fmt.Sprintf(dagRunClearURL, jobName.String()), + method: http.MethodPost, + body: data, + } + schdAuth, err := s.getSchedulerAuth(ctx, tnnt) + if err != nil { + return err + } + _, err = s.client.Invoke(spanCtx, req, schdAuth) + if err != nil { + return errors.Wrap(EntityAirflow, "failure while clearing airflow dag runs", err) + } + return nil +} + +func (s *Scheduler) CreateRun(ctx context.Context, tnnt tenant.Tenant, jobName scheduler.JobName, executionTime time.Time, dagRunIDPrefix string) error { + spanCtx, span := startChildSpan(ctx, "CreateRun") + defer span.End() + + data := []byte(fmt.Sprintf(`{"dag_run_id": %q, "execution_date": %q}`, + fmt.Sprintf("%s__%s", dagRunIDPrefix, executionTime.UTC().Format(airflowDateFormat)), + executionTime.UTC().Format(airflowDateFormat)), + ) + req := airflowRequest{ + path: fmt.Sprintf(dagRunCreateURL, jobName.String()), method: http.MethodPost, - param: jobName.String(), body: data, } schdAuth, err := s.getSchedulerAuth(ctx, tnnt) @@ -329,7 +419,7 @@ func (s *Scheduler) ClearBatch(ctx context.Context, tnnt tenant.Tenant, jobName } _, err = s.client.Invoke(spanCtx, req, schdAuth) if err != nil { - return fmt.Errorf("failure reason for clearing airflow dag runs: %w", err) + return errors.Wrap(EntityAirflow, "failure while creating airflow dag run", err) } return nil } @@ -344,3 +434,11 @@ func NewScheduler(l log.Logger, bucketFac BucketFactory, client Client, compiler secretGetter: secretGetter, } } + +func raiseSchedulerMetric(jobTenant tenant.Tenant, metricName, status string, metricValue int) { + telemetry.NewCounter(metricName, map[string]string{ + "project": jobTenant.ProjectName().String(), + "namespace": jobTenant.NamespaceName().String(), + "status": status, + }).Add(float64(metricValue)) +} diff --git a/ext/scheduler/airflow/bucket/factory.go b/ext/scheduler/airflow/bucket/factory.go index eb2ffbce23..17715524f9 100644 --- a/ext/scheduler/airflow/bucket/factory.go +++ b/ext/scheduler/airflow/bucket/factory.go @@ -7,9 +7,9 @@ import ( "gocloud.dev/blob/fileblob" "gocloud.dev/blob/memblob" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/scheduler/airflow" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/scheduler/airflow" + "github.com/raystack/optimus/internal/errors" ) const ( diff --git a/ext/scheduler/airflow/bucket/gcs.go b/ext/scheduler/airflow/bucket/gcs.go index 607a44efae..29b6d154b3 100644 --- a/ext/scheduler/airflow/bucket/gcs.go +++ b/ext/scheduler/airflow/bucket/gcs.go @@ -12,8 +12,8 @@ import ( "gocloud.dev/gcp" "golang.org/x/oauth2/google" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/scheduler/airflow" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/scheduler/airflow" ) const ( diff --git a/ext/scheduler/airflow/client.go b/ext/scheduler/airflow/client.go index 6ec58402cb..b98b34f0d6 100644 --- a/ext/scheduler/airflow/client.go +++ b/ext/scheduler/airflow/client.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "encoding/base64" - "errors" "fmt" "io" "net/http" @@ -15,20 +14,19 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/lib/cron" ) const ( - pageLimit = 99999 - dagStatusURL = "api/v1/dags/%s/dagRuns" + pageLimit = 99999 ) type airflowRequest struct { - URL string + path string method string body []byte - param string } type DagRunListResponse struct { @@ -67,20 +65,21 @@ func NewAirflowClient() *ClientAirflow { func (ac ClientAirflow) Invoke(ctx context.Context, r airflowRequest, auth SchedulerAuth) ([]byte, error) { var resp []byte - request, err := http.NewRequestWithContext(ctx, r.method, buildEndPoint(auth.host, r.URL, r.param), bytes.NewBuffer(r.body)) + endpoint := buildEndPoint(auth.host, r.path) + request, err := http.NewRequestWithContext(ctx, r.method, endpoint, bytes.NewBuffer(r.body)) if err != nil { - return resp, fmt.Errorf("failed to build http request for %s due to %w", r.URL, err) + return resp, fmt.Errorf("failed to build http request for %s due to %w", endpoint, err) } request.Header.Set("Content-Type", "application/json") request.Header.Set("Authorization", fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(auth.token)))) httpResp, respErr := ac.client.Do(request) if respErr != nil { - return resp, fmt.Errorf("failed to call airflow %s due to %w", r.URL, respErr) + return resp, fmt.Errorf("failed to call airflow %s due to %w", endpoint, respErr) } if httpResp.StatusCode != http.StatusOK { httpResp.Body.Close() - return resp, fmt.Errorf("status code received %d on calling %s", httpResp.StatusCode, r.URL) + return resp, fmt.Errorf("status code received %d on calling %s", httpResp.StatusCode, endpoint) } return parseResponse(httpResp) } @@ -90,26 +89,17 @@ func parseResponse(resp *http.Response) ([]byte, error) { body, err := io.ReadAll(resp.Body) resp.Body.Close() if err != nil { - return body, fmt.Errorf("failed to read airflow response: %w", err) + return body, errors.Wrap(EntityAirflow, "failed to read airflow response", err) } return body, nil } -func buildEndPoint(host, reqURL, pathParam string) string { +func buildEndPoint(host, path string) string { host = strings.Trim(host, "/") u := &url.URL{ Scheme: "http", Host: host, - } - if pathParam != "" { - u.Path = "/" + strings.ReplaceAll(reqURL, "%s", pathParam) - } else { - u.Path = "/" + reqURL - } - if reqURL == dagStatusURL { - params := url.Values{} - params.Add("limit", "99999") - u.RawQuery = params.Encode() + Path: path, } return u.String() } @@ -117,7 +107,7 @@ func buildEndPoint(host, reqURL, pathParam string) string { func getJobRuns(res DagRunListResponse, spec *cron.ScheduleSpec) ([]*scheduler.JobRunStatus, error) { var jobRunList []*scheduler.JobRunStatus if res.TotalEntries > pageLimit { - return jobRunList, errors.New("total number of entries exceed page limit") + return jobRunList, errors.InternalError(EntityAirflow, "total number of entries exceed page limit", nil) } for _, dag := range res.DagRuns { if !dag.ExternalTrigger { // only include scheduled runs diff --git a/ext/scheduler/airflow/dag/compiler.go b/ext/scheduler/airflow/dag/compiler.go index e852aa0146..7637cb2984 100644 --- a/ext/scheduler/airflow/dag/compiler.go +++ b/ext/scheduler/airflow/dag/compiler.go @@ -3,12 +3,13 @@ package dag import ( "bytes" _ "embed" + "fmt" "text/template" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/sdk/plugin" ) //go:embed dag.py.tmpl @@ -62,7 +63,8 @@ func (c *Compiler) Compile(jobDetails *scheduler.JobWithDetails) ([]byte, error) var buf bytes.Buffer if err = c.template.Execute(&buf, templateContext); err != nil { - return nil, errors.InternalError(EntitySchedulerAirflow, "unable to compile template for job "+jobDetails.Name.String(), err) + msg := fmt.Sprintf("unable to compile template for job %s, %s", jobDetails.Name.String(), err.Error()) + return nil, errors.InvalidArgument(EntitySchedulerAirflow, msg) } return buf.Bytes(), nil diff --git a/ext/scheduler/airflow/dag/compiler_test.go b/ext/scheduler/airflow/dag/compiler_test.go index 54d68740dd..20fc18b68e 100644 --- a/ext/scheduler/airflow/dag/compiler_test.go +++ b/ext/scheduler/airflow/dag/compiler_test.go @@ -8,12 +8,13 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/scheduler/airflow/dag" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/sdk/plugin" - "github.com/odpf/optimus/sdk/plugin/mock" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/scheduler/airflow/dag" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/sdk/plugin" + "github.com/raystack/optimus/sdk/plugin/mock" ) //go:embed expected_dag.py @@ -23,15 +24,52 @@ func TestDagCompiler(t *testing.T) { t.Run("Compile", func(t *testing.T) { repo := setupPluginRepo() tnnt, err := tenant.NewTenant("example-proj", "billing") - assert.Nil(t, err) + assert.NoError(t, err) - t.Run("should compile basic template without any error", func(t *testing.T) { + t.Run("returns error when cannot find task", func(t *testing.T) { + emptyRepo := mockPluginRepo{plugins: []*plugin.Plugin{}} + com, err := dag.NewDagCompiler("http://optimus.example.com", emptyRepo) + assert.NoError(t, err) + + job := setupJobDetails(tnnt) + _, err = com.Compile(job) + assert.True(t, errors.IsErrorType(err, errors.ErrNotFound)) + assert.ErrorContains(t, err, "plugin not found for bq-bq") + }) + t.Run("returns error when cannot find hook", func(t *testing.T) { + com, err := dag.NewDagCompiler("http://optimus.example.com", repo) + assert.NoError(t, err) + + job := setupJobDetails(tnnt) + job.Job.Hooks = append(job.Job.Hooks, &scheduler.Hook{Name: "invalid"}) + _, err = com.Compile(job) + assert.True(t, errors.IsErrorType(err, errors.ErrNotFound)) + assert.ErrorContains(t, err, "hook not found for name invalid") + }) + + t.Run("returns error when sla duration is invalid", func(t *testing.T) { + com, err := dag.NewDagCompiler("http://optimus.example.com", repo) + assert.NoError(t, err) + + job := setupJobDetails(tnnt) + job.Alerts = append(job.Alerts, scheduler.Alert{ + On: scheduler.EventCategorySLAMiss, + }, + scheduler.Alert{ + On: scheduler.EventCategorySLAMiss, + Config: map[string]string{"duration": "2"}, + }) + _, err = com.Compile(job) + assert.ErrorContains(t, err, "failed to parse sla_miss duration 2") + }) + + t.Run("compiles basic template without any error", func(t *testing.T) { com, err := dag.NewDagCompiler("http://optimus.example.com", repo) - assert.Nil(t, err) + assert.NoError(t, err) job := setupJobDetails(tnnt) compiledDag, err := com.Compile(job) - assert.Nil(t, err) + assert.NoError(t, err) assert.Equal(t, string(compiledTemplate), string(compiledDag)) }) }) @@ -47,8 +85,7 @@ func setupJobDetails(tnnt tenant.Tenant) *scheduler.JobWithDetails { StartDate: time.Date(2022, 11, 10, 5, 2, 0, 0, time.UTC), EndDate: &end, Interval: "0 2 * * 0", - DependsOnPast: false, - CatchUp: true, + DependsOnPast: true, } retry := scheduler.Retry{ @@ -94,7 +131,6 @@ func setupJobDetails(tnnt tenant.Tenant) *scheduler.JobWithDetails { Memory: "2G", }, }, - Scheduler: map[string]string{"pool": "billing"}, } tnnt1, _ := tenant.NewTenant("project", "namespace") diff --git a/ext/scheduler/airflow/dag/dag.py.tmpl b/ext/scheduler/airflow/dag/dag.py.tmpl index b922e84406..6bb46e6156 100644 --- a/ext/scheduler/airflow/dag/dag.py.tmpl +++ b/ext/scheduler/airflow/dag/dag.py.tmpl @@ -1,12 +1,12 @@ -{{- /*gotype: github.com/odpf/optimus/ext/scheduler/airflow/dag.TemplateContext */ -}} +{{- /*gotype: github.com/raystack/optimus/ext/scheduler/airflow/dag.TemplateContext */ -}} # Code generated by optimus {{.Version}}. DO NOT EDIT. from datetime import datetime, timedelta -# imoprt Dag level callbacks +# import Dag level callbacks from __lib import job_success_event, job_failure_event -# imoprt operator level callbacks +# import operator level callbacks from __lib import operator_start_event, operator_success_event, operator_retry_event, operator_failure_event from __lib import optimus_sla_miss_notify, SuperKubernetesPodOperator, SuperExternalTaskSensor @@ -22,6 +22,10 @@ SENSOR_DEFAULT_TIMEOUT_IN_SECS = int(Variable.get("sensor_timeout_in_secs", defa DAG_RETRIES = int(Variable.get("dag_retries", default_var=3)) DAG_RETRY_DELAY = int(Variable.get("dag_retry_delay_in_secs", default_var=5 * 60)) DAGRUN_TIMEOUT_IN_SECS = int(Variable.get("dagrun_timeout_in_secs", default_var=3 * 24 * 60 * 60)) +STARTUP_TIMEOUT_IN_SECS = int(Variable.get("startup_timeout_in_secs", default_var=2 * 60)) +POOL_SENSOR = Variable.get("sensor_pool", default_var="default_pool") +POOL_TASK = Variable.get("task_pool", default_var="default_pool") +POOL_HOOK = Variable.get("hook_pool", default_var="default_pool") default_args = { "params": { @@ -30,16 +34,14 @@ default_args = { "job_name": {{.JobDetails.Name.String | quote}}, "optimus_hostname": {{.Hostname | quote}} }, - {{- if ne .RuntimeConfig.Airflow.Pool "" }} - "pool": "{{ .RuntimeConfig.Airflow.Pool }}", - {{- end }} {{- if ne .RuntimeConfig.Airflow.Queue "" }} "queue": "{{ .RuntimeConfig.Airflow.Queue }}", {{- end }} "owner": {{.JobDetails.JobMetadata.Owner | quote}}, - "depends_on_past": False, + "depends_on_past": {{ if .JobDetails.Schedule.DependsOnPast }}True{{- else -}}False{{- end -}}, "retries": {{ if gt .JobDetails.Retry.Count 0 -}} {{.JobDetails.Retry.Count}} {{- else -}} DAG_RETRIES {{- end}}, "retry_delay": {{ if gt .JobDetails.Retry.Delay 0 -}} timedelta(seconds={{.JobDetails.Retry.Delay}}) {{- else -}} timedelta(seconds=DAG_RETRY_DELAY) {{- end}}, + "startup_timeout_seconds": STARTUP_TIMEOUT_IN_SECS, "retry_exponential_backoff": {{if .JobDetails.Retry.ExponentialBackoff -}}True{{- else -}}False{{- end -}}, "priority_weight": {{.Priority}}, "start_date": datetime.strptime({{ .JobDetails.Schedule.StartDate.Format "2006-01-02T15:04:05" | quote }}, "%Y-%m-%dT%H:%M:%S"), @@ -47,6 +49,9 @@ default_args = { "end_date": datetime.strptime({{ .JobDetails.Schedule.EndDate.Format "2006-01-02T15:04:05" | quote}}, "%Y-%m-%dT%H:%M:%S"), {{- end}} "weight_rule": WeightRule.ABSOLUTE, + {{- if gt .SLAMissDuration 0 }} + "sla": timedelta(seconds={{ .SLAMissDuration }}), + {{- end }} "on_execute_callback": operator_start_event, "on_success_callback": operator_success_event, "on_retry_callback" : operator_retry_event, @@ -60,10 +65,10 @@ dag = DAG( dag_id={{.JobDetails.Name.String | quote}}, default_args=default_args, schedule_interval={{ if eq .JobDetails.Schedule.Interval "" }}None{{- else -}} {{ .JobDetails.Schedule.Interval | quote}}{{end}}, - catchup={{ if .JobDetails.Schedule.CatchUp -}}True{{- else -}}False{{- end }}, + catchup=False, dagrun_timeout=timedelta(seconds=DAGRUN_TIMEOUT_IN_SECS), tags=[ - {{- range $key, $value := $.JobDetails.JobMetadata.Labels}} + {{- range $i, $value := $.JobDetails.GetUniqueLabelValues}} "{{ $value }}", {{- end}} ], @@ -99,7 +104,7 @@ resources = k8s.V1ResourceRequirements( JOB_DIR = "/data" IMAGE_PULL_POLICY = "IfNotPresent" -INIT_CONTAINER_IMAGE = "odpf/optimus:{{.Version}}" +INIT_CONTAINER_IMAGE = "raystack/optimus:{{.Version}}" INIT_CONTAINER_ENTRYPOINT = "/opt/entrypoint_init_container.sh" def get_entrypoint_cmd(plugin_entrypoint_script): @@ -161,9 +166,6 @@ init_container = k8s.V1Container( is_delete_operator_pod=True, do_xcom_push=False, env_vars=executor_env_vars, - {{- if gt .SLAMissDuration 0 }} - sla=timedelta(seconds={{ .SLAMissDuration }}), - {{- end }} {{- if .RuntimeConfig.Resource }} resources=resources, {{- end }} @@ -171,6 +173,7 @@ init_container = k8s.V1Container( volume_mounts=asset_volume_mounts, volumes=[volume], init_containers=[init_container], + pool={{ if eq .RuntimeConfig.Airflow.Pool "" }}POOL_TASK{{- else -}} {{ .RuntimeConfig.Airflow.Pool | quote}}{{end}} ) # hooks loop start @@ -200,6 +203,7 @@ hook_{{$hookName}} = SuperKubernetesPodOperator( get_logs=True, dag=dag, in_cluster=True, + depends_on_past=False, is_delete_operator_pod=True, do_xcom_push=False, env_vars=executor_env_vars, @@ -213,6 +217,7 @@ hook_{{$hookName}} = SuperKubernetesPodOperator( volume_mounts=asset_volume_mounts, volumes=[volume], init_containers=[init_container_{{$hookName}}], + pool={{ if eq $.RuntimeConfig.Airflow.Pool "" }}POOL_HOOK{{- else -}} {{ $.RuntimeConfig.Airflow.Pool | quote}}{{end}} ) {{- end }} # hooks loop ends @@ -232,8 +237,10 @@ wait_{{ $dependencyName }} = SuperExternalTaskSensor( window_version=int("{{ $baseWindow.GetVersion }}"), poke_interval=SENSOR_DEFAULT_POKE_INTERVAL_IN_SECS, timeout=SENSOR_DEFAULT_TIMEOUT_IN_SECS, - task_id="wait_{{$upstream.JobName | trunc 200}}-{{$upstream.TaskName}}", - dag=dag + task_id="wait_{{$upstream.JobName}}-{{$upstream.TaskName}}", + depends_on_past=False, + dag=dag, + pool={{ if eq $.RuntimeConfig.Airflow.Pool "" }}POOL_SENSOR{{- else -}} {{ $.RuntimeConfig.Airflow.Pool | quote}}{{end}} ) {{ end}} @@ -247,8 +254,10 @@ wait_{{$httpUpstream.Name}} = ExternalHttpSensor( request_params=request_params_dict_{{$httpUpstream.Name}}, poke_interval=SENSOR_DEFAULT_POKE_INTERVAL_IN_SECS, timeout=SENSOR_DEFAULT_TIMEOUT_IN_SECS, - task_id='wait_{{$httpUpstream.Name | trunc 200}}', - dag=dag + task_id='wait_{{$httpUpstream.Name}}', + depends_on_past=False, + dag=dag, + pool={{ if eq $.RuntimeConfig.Airflow.Pool "" }}POOL_SENSOR{{- else -}} {{ $.RuntimeConfig.Airflow.Pool | quote}}{{end}} ) {{- end -}} diff --git a/ext/scheduler/airflow/dag/expected_dag.py b/ext/scheduler/airflow/dag/expected_dag.py index c54ca5f96e..87a61094ab 100644 --- a/ext/scheduler/airflow/dag/expected_dag.py +++ b/ext/scheduler/airflow/dag/expected_dag.py @@ -2,10 +2,10 @@ from datetime import datetime, timedelta -# imoprt Dag level callbacks +# import Dag level callbacks from __lib import job_success_event, job_failure_event -# imoprt operator level callbacks +# import operator level callbacks from __lib import operator_start_event, operator_success_event, operator_retry_event, operator_failure_event from __lib import optimus_sla_miss_notify, SuperKubernetesPodOperator, SuperExternalTaskSensor @@ -21,6 +21,10 @@ DAG_RETRIES = int(Variable.get("dag_retries", default_var=3)) DAG_RETRY_DELAY = int(Variable.get("dag_retry_delay_in_secs", default_var=5 * 60)) DAGRUN_TIMEOUT_IN_SECS = int(Variable.get("dagrun_timeout_in_secs", default_var=3 * 24 * 60 * 60)) +STARTUP_TIMEOUT_IN_SECS = int(Variable.get("startup_timeout_in_secs", default_var=2 * 60)) +POOL_SENSOR = Variable.get("sensor_pool", default_var="default_pool") +POOL_TASK = Variable.get("task_pool", default_var="default_pool") +POOL_HOOK = Variable.get("hook_pool", default_var="default_pool") default_args = { "params": { @@ -29,16 +33,17 @@ "job_name": "infra.billing.weekly-status-reports", "optimus_hostname": "http://optimus.example.com" }, - "pool": "billing", "owner": "infra-team@example.com", - "depends_on_past": False, + "depends_on_past": True, "retries": 2, "retry_delay": timedelta(seconds=100), + "startup_timeout_seconds": STARTUP_TIMEOUT_IN_SECS, "retry_exponential_backoff": True, "priority_weight": 2000, "start_date": datetime.strptime("2022-11-10T05:02:00", "%Y-%m-%dT%H:%M:%S"), "end_date": datetime.strptime("2022-11-10T10:02:00", "%Y-%m-%dT%H:%M:%S"), "weight_rule": WeightRule.ABSOLUTE, + "sla": timedelta(seconds=7200), "on_execute_callback": operator_start_event, "on_success_callback": operator_success_event, "on_retry_callback" : operator_retry_event, @@ -50,7 +55,7 @@ dag_id="infra.billing.weekly-status-reports", default_args=default_args, schedule_interval="0 2 * * 0", - catchup=True, + catchup=False, dagrun_timeout=timedelta(seconds=DAGRUN_TIMEOUT_IN_SECS), tags=[ "optimus", @@ -69,7 +74,7 @@ JOB_DIR = "/data" IMAGE_PULL_POLICY = "IfNotPresent" -INIT_CONTAINER_IMAGE = "odpf/optimus:dev" +INIT_CONTAINER_IMAGE = "raystack/optimus:dev" INIT_CONTAINER_ENTRYPOINT = "/opt/entrypoint_init_container.sh" def get_entrypoint_cmd(plugin_entrypoint_script): @@ -125,17 +130,17 @@ def get_entrypoint_cmd(plugin_entrypoint_script): task_id="bq-bq", get_logs=True, dag=dag, - depends_on_past=False, + depends_on_past=True, in_cluster=True, is_delete_operator_pod=True, do_xcom_push=False, env_vars=executor_env_vars, - sla=timedelta(seconds=7200), resources=resources, reattach_on_restart=True, volume_mounts=asset_volume_mounts, volumes=[volume], init_containers=[init_container], + pool=POOL_TASK ) # hooks loop start @@ -163,6 +168,7 @@ def get_entrypoint_cmd(plugin_entrypoint_script): get_logs=True, dag=dag, in_cluster=True, + depends_on_past=False, is_delete_operator_pod=True, do_xcom_push=False, env_vars=executor_env_vars, @@ -171,6 +177,7 @@ def get_entrypoint_cmd(plugin_entrypoint_script): volume_mounts=asset_volume_mounts, volumes=[volume], init_containers=[init_container_transporter], + pool=POOL_HOOK ) init_container_predator = k8s.V1Container( name="init-container", @@ -196,6 +203,7 @@ def get_entrypoint_cmd(plugin_entrypoint_script): get_logs=True, dag=dag, in_cluster=True, + depends_on_past=False, is_delete_operator_pod=True, do_xcom_push=False, env_vars=executor_env_vars, @@ -204,6 +212,7 @@ def get_entrypoint_cmd(plugin_entrypoint_script): volume_mounts=asset_volume_mounts, volumes=[volume], init_containers=[init_container_predator], + pool=POOL_HOOK ) init_container_failureHook = k8s.V1Container( name="init-container", @@ -229,6 +238,7 @@ def get_entrypoint_cmd(plugin_entrypoint_script): get_logs=True, dag=dag, in_cluster=True, + depends_on_past=False, is_delete_operator_pod=True, do_xcom_push=False, env_vars=executor_env_vars, @@ -238,6 +248,7 @@ def get_entrypoint_cmd(plugin_entrypoint_script): volume_mounts=asset_volume_mounts, volumes=[volume], init_containers=[init_container_failureHook], + pool=POOL_HOOK ) # hooks loop ends @@ -254,7 +265,9 @@ def get_entrypoint_cmd(plugin_entrypoint_script): poke_interval=SENSOR_DEFAULT_POKE_INTERVAL_IN_SECS, timeout=SENSOR_DEFAULT_TIMEOUT_IN_SECS, task_id="wait_foo-intra-dep-job-bq", - dag=dag + depends_on_past=False, + dag=dag, + pool=POOL_SENSOR ) wait_foo__dash__inter__dash__dep__dash__job = SuperExternalTaskSensor( @@ -268,7 +281,9 @@ def get_entrypoint_cmd(plugin_entrypoint_script): poke_interval=SENSOR_DEFAULT_POKE_INTERVAL_IN_SECS, timeout=SENSOR_DEFAULT_TIMEOUT_IN_SECS, task_id="wait_foo-inter-dep-job-bq-bq", - dag=dag + depends_on_past=False, + dag=dag, + pool=POOL_SENSOR ) wait_foo__dash__external__dash__optimus__dash__dep__dash__job = SuperExternalTaskSensor( @@ -282,7 +297,9 @@ def get_entrypoint_cmd(plugin_entrypoint_script): poke_interval=SENSOR_DEFAULT_POKE_INTERVAL_IN_SECS, timeout=SENSOR_DEFAULT_TIMEOUT_IN_SECS, task_id="wait_foo-external-optimus-dep-job-bq-bq", - dag=dag + depends_on_past=False, + dag=dag, + pool=POOL_SENSOR ) # arrange inter task dependencies #################################### diff --git a/ext/scheduler/airflow/dag/models.go b/ext/scheduler/airflow/dag/models.go index f692810ed1..75fc1ac7c7 100644 --- a/ext/scheduler/airflow/dag/models.go +++ b/ext/scheduler/airflow/dag/models.go @@ -3,10 +3,10 @@ package dag import ( "time" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/sdk/plugin" ) const ( diff --git a/ext/scheduler/airflow/dag/template_func_test.go b/ext/scheduler/airflow/dag/template_func_test.go index d580280b25..a4f6a2614c 100644 --- a/ext/scheduler/airflow/dag/template_func_test.go +++ b/ext/scheduler/airflow/dag/template_func_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/ext/scheduler/airflow/dag" + "github.com/raystack/optimus/ext/scheduler/airflow/dag" ) func TestTemplateFuncMap(t *testing.T) { diff --git a/ext/scheduler/airflow/dag/upstream.go b/ext/scheduler/airflow/dag/upstream.go index 517dc0cd92..82bd2c1dbd 100644 --- a/ext/scheduler/airflow/dag/upstream.go +++ b/ext/scheduler/airflow/dag/upstream.go @@ -1,8 +1,8 @@ package dag import ( - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" ) type Upstreams struct { diff --git a/ext/store/bigquery/backup.go b/ext/store/bigquery/backup.go index fcd02602a3..25bd2f0f5f 100644 --- a/ext/store/bigquery/backup.go +++ b/ext/store/bigquery/backup.go @@ -5,9 +5,9 @@ import ( "fmt" "time" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( diff --git a/ext/store/bigquery/backup_test.go b/ext/store/bigquery/backup_test.go index 7c2a468080..0b5e5713f5 100644 --- a/ext/store/bigquery/backup_test.go +++ b/ext/store/bigquery/backup_test.go @@ -8,10 +8,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/store/bigquery" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/store/bigquery" + "github.com/raystack/optimus/internal/errors" ) func TestBigqueryBackup(t *testing.T) { diff --git a/ext/store/bigquery/batch.go b/ext/store/bigquery/batch.go index 346ff6f9f9..730c36e4a0 100644 --- a/ext/store/bigquery/batch.go +++ b/ext/store/bigquery/batch.go @@ -5,9 +5,9 @@ import ( "github.com/kushsharma/parallel" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) type Batch struct { @@ -183,5 +183,5 @@ func BatchesFrom(resources []*resource.Resource, provider ClientProvider) (map[s mapping[dataset.FullName()] = batch } - return mapping, errors.MultiToError(me) + return mapping, me.ToErr() } diff --git a/ext/store/bigquery/batch_test.go b/ext/store/bigquery/batch_test.go index bccc1bec8b..4631509cdb 100644 --- a/ext/store/bigquery/batch_test.go +++ b/ext/store/bigquery/batch_test.go @@ -8,10 +8,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/store/bigquery" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/store/bigquery" + "github.com/raystack/optimus/internal/errors" ) func TestBatches(t *testing.T) { diff --git a/ext/store/bigquery/bigquery.go b/ext/store/bigquery/bigquery.go index c470930772..f3fc3dd621 100644 --- a/ext/store/bigquery/bigquery.go +++ b/ext/store/bigquery/bigquery.go @@ -9,9 +9,9 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( @@ -180,7 +180,7 @@ func (s Store) BatchUpdate(ctx context.Context, resources []*resource.Resource) me.Append(state.Err) } - return errors.MultiToError(me) + return me.ToErr() } func (Store) Validate(r *resource.Resource) error { diff --git a/ext/store/bigquery/bigquery_test.go b/ext/store/bigquery/bigquery_test.go index fb99bc3a8e..199b946942 100644 --- a/ext/store/bigquery/bigquery_test.go +++ b/ext/store/bigquery/bigquery_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestBigqueryStore(t *testing.T) { diff --git a/ext/store/bigquery/client.go b/ext/store/bigquery/client.go index 4076cc8298..154f8c2b97 100644 --- a/ext/store/bigquery/client.go +++ b/ext/store/bigquery/client.go @@ -7,7 +7,7 @@ import ( "golang.org/x/oauth2/google" "google.golang.org/api/option" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/internal/errors" ) type BqClientProvider struct{} diff --git a/ext/store/bigquery/client_test.go b/ext/store/bigquery/client_test.go index bce1a1afc4..f5d7badb8c 100644 --- a/ext/store/bigquery/client_test.go +++ b/ext/store/bigquery/client_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestBqClient(t *testing.T) { @@ -118,7 +118,7 @@ func TestClientProvider(t *testing.T) { _, err := provider.Get(ctx, "") assert.NotNil(t, err) - assert.EqualError(t, err, "internal error for entity BigqueryStore: failed to read account") + assert.ErrorContains(t, err, "internal error for entity BigqueryStore: failed to read account") }) t.Run("creates a new client with json", func(t *testing.T) { diff --git a/ext/store/bigquery/copier.go b/ext/store/bigquery/copier.go index 08e6b1150a..0f53c187ca 100644 --- a/ext/store/bigquery/copier.go +++ b/ext/store/bigquery/copier.go @@ -5,7 +5,7 @@ import ( "cloud.google.com/go/bigquery" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/internal/errors" ) type BQCopier interface { diff --git a/ext/store/bigquery/copier_test.go b/ext/store/bigquery/copier_test.go index 86f22faf20..5b997875ae 100644 --- a/ext/store/bigquery/copier_test.go +++ b/ext/store/bigquery/copier_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestTableCopier(t *testing.T) { @@ -25,7 +25,7 @@ func TestTableCopier(t *testing.T) { _, err := copierHandle.Run(ctx) assert.Error(t, err) - assert.EqualError(t, err, "internal error for entity BigqueryStore: not able to create copy job") + assert.ErrorContains(t, err, "internal error for entity BigqueryStore: not able to create copy job") }) t.Run("return copy job when successful", func(t *testing.T) { bqCopier := new(mockBQCopier) diff --git a/ext/store/bigquery/dataset.go b/ext/store/bigquery/dataset.go index 3d8bbac285..4f55dc89e8 100644 --- a/ext/store/bigquery/dataset.go +++ b/ext/store/bigquery/dataset.go @@ -9,8 +9,8 @@ import ( "cloud.google.com/go/bigquery" "google.golang.org/api/googleapi" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" ) const ( diff --git a/ext/store/bigquery/dataset_spec.go b/ext/store/bigquery/dataset_spec.go index 81c15a1241..eec2a082a6 100644 --- a/ext/store/bigquery/dataset_spec.go +++ b/ext/store/bigquery/dataset_spec.go @@ -6,8 +6,8 @@ import ( "github.com/mitchellh/mapstructure" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" ) const ( diff --git a/ext/store/bigquery/dataset_spec_test.go b/ext/store/bigquery/dataset_spec_test.go index 4ba5499a81..9d156e783e 100644 --- a/ext/store/bigquery/dataset_spec_test.go +++ b/ext/store/bigquery/dataset_spec_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestDatasetDetails(t *testing.T) { diff --git a/ext/store/bigquery/dataset_test.go b/ext/store/bigquery/dataset_test.go index 495f55b5d8..1741c86d35 100644 --- a/ext/store/bigquery/dataset_test.go +++ b/ext/store/bigquery/dataset_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/mock" "google.golang.org/api/googleapi" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestDatasetHandle(t *testing.T) { diff --git a/ext/store/bigquery/external_table.go b/ext/store/bigquery/external_table.go index a0de750e04..4cbf47e986 100644 --- a/ext/store/bigquery/external_table.go +++ b/ext/store/bigquery/external_table.go @@ -8,12 +8,15 @@ import ( "cloud.google.com/go/bigquery" "google.golang.org/api/googleapi" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" ) const ( expirationTimeKey = "expiration_time" + + skipLeadingRowsKey = "skip_leading_rows" + rangeKey = "range" ) type ExternalTableHandle struct { @@ -120,18 +123,14 @@ func bqExternalDataConfigTo(es *ExternalSource, schema Schema) (*bigquery.Extern func bqGoogleSheetsOptionsTo(m map[string]any) *bigquery.GoogleSheetsOptions { var skipLeadingRows int64 - var sheetRange string - if val, ok := m["skip_leading_rows"]; ok { - if rows, ok := val.(int); ok { - skipLeadingRows = int64(rows) - } - } - if val, ok := m["range"]; ok { - if ran, ok := val.(string); ok { - sheetRange = ran - } + // grpc structpb.Struct cast numbers to float64 + rows := ConfigAs[float64](m, skipLeadingRowsKey) + if rows > 0 { + skipLeadingRows = int64(rows) } + + sheetRange := ConfigAs[string](m, rangeKey) return &bigquery.GoogleSheetsOptions{ SkipLeadingRows: skipLeadingRows, Range: sheetRange, diff --git a/ext/store/bigquery/external_table_spec.go b/ext/store/bigquery/external_table_spec.go index fef774d6cb..7ceac4a0f7 100644 --- a/ext/store/bigquery/external_table_spec.go +++ b/ext/store/bigquery/external_table_spec.go @@ -1,8 +1,8 @@ package bigquery import ( - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" ) const ( diff --git a/ext/store/bigquery/external_table_spec_test.go b/ext/store/bigquery/external_table_spec_test.go index 6fb750e0ff..bcef6489c6 100644 --- a/ext/store/bigquery/external_table_spec_test.go +++ b/ext/store/bigquery/external_table_spec_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestRelationalExternalTable(t *testing.T) { diff --git a/ext/store/bigquery/external_table_test.go b/ext/store/bigquery/external_table_test.go index 206e1348bf..db12b1ee95 100644 --- a/ext/store/bigquery/external_table_test.go +++ b/ext/store/bigquery/external_table_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/mock" "google.golang.org/api/googleapi" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/store/bigquery" ) var emptyUpdateOptions []bq.TableUpdateOption @@ -147,7 +147,7 @@ func TestExternalTableHandle(t *testing.T) { "uris": []string{"https://docs.google.com/sheet"}, "config": map[string]any{ "range": "kyc", - "skip_leading_rows": 2, + "skip_leading_rows": float64(2), }, }, } diff --git a/ext/store/bigquery/job.go b/ext/store/bigquery/job.go index e1710b9afe..cde1e43270 100644 --- a/ext/store/bigquery/job.go +++ b/ext/store/bigquery/job.go @@ -5,7 +5,7 @@ import ( "cloud.google.com/go/bigquery" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/internal/errors" ) type BQJob interface { diff --git a/ext/store/bigquery/job_test.go b/ext/store/bigquery/job_test.go index 2ca81216e5..b817e8307c 100644 --- a/ext/store/bigquery/job_test.go +++ b/ext/store/bigquery/job_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestJob(t *testing.T) { @@ -24,7 +24,7 @@ func TestJob(t *testing.T) { err := copyJob.Wait(ctx) assert.Error(t, err) - assert.EqualError(t, err, "internal error for entity BigqueryStore: error while wait for bq job") + assert.ErrorContains(t, err, "internal error for entity BigqueryStore: error while wait for bq job") }) t.Run("return no error when successful", func(t *testing.T) { bqJob := new(mockBQJob) diff --git a/ext/store/bigquery/schema.go b/ext/store/bigquery/schema.go index c8ec9c6ead..10c47b84c6 100644 --- a/ext/store/bigquery/schema.go +++ b/ext/store/bigquery/schema.go @@ -3,7 +3,7 @@ package bigquery import ( "strings" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/internal/errors" ) const ( diff --git a/ext/store/bigquery/schema_test.go b/ext/store/bigquery/schema_test.go index f392aa64ec..31372947d8 100644 --- a/ext/store/bigquery/schema_test.go +++ b/ext/store/bigquery/schema_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestFieldValidate(t *testing.T) { diff --git a/ext/store/bigquery/table.go b/ext/store/bigquery/table.go index 30fdf47c02..c1135f8735 100644 --- a/ext/store/bigquery/table.go +++ b/ext/store/bigquery/table.go @@ -9,8 +9,8 @@ import ( "cloud.google.com/go/bigquery" "google.golang.org/api/googleapi" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" ) type BqTable interface { diff --git a/ext/store/bigquery/table_spec.go b/ext/store/bigquery/table_spec.go index 0e455378d1..581588dc2a 100644 --- a/ext/store/bigquery/table_spec.go +++ b/ext/store/bigquery/table_spec.go @@ -3,8 +3,8 @@ package bigquery import ( "strings" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" ) const ( diff --git a/ext/store/bigquery/table_spec_test.go b/ext/store/bigquery/table_spec_test.go index 185b797924..5afa52f17f 100644 --- a/ext/store/bigquery/table_spec_test.go +++ b/ext/store/bigquery/table_spec_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestRelationalTable(t *testing.T) { diff --git a/ext/store/bigquery/table_test.go b/ext/store/bigquery/table_test.go index 530ef72d86..ae5486d4ed 100644 --- a/ext/store/bigquery/table_test.go +++ b/ext/store/bigquery/table_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/mock" "google.golang.org/api/googleapi" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestTableHandle(t *testing.T) { diff --git a/ext/store/bigquery/view.go b/ext/store/bigquery/view.go index 7eb02f83f9..56a3575059 100644 --- a/ext/store/bigquery/view.go +++ b/ext/store/bigquery/view.go @@ -9,8 +9,8 @@ import ( "cloud.google.com/go/bigquery" "google.golang.org/api/googleapi" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" ) type ViewHandle struct { diff --git a/ext/store/bigquery/view_spec.go b/ext/store/bigquery/view_spec.go index 079cdc12cd..d32e219630 100644 --- a/ext/store/bigquery/view_spec.go +++ b/ext/store/bigquery/view_spec.go @@ -1,8 +1,8 @@ package bigquery import ( - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/internal/errors" ) const ( diff --git a/ext/store/bigquery/view_spec_test.go b/ext/store/bigquery/view_spec_test.go index 20937ee8f2..ba743ff2d1 100644 --- a/ext/store/bigquery/view_spec_test.go +++ b/ext/store/bigquery/view_spec_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestRelationalView(t *testing.T) { diff --git a/ext/store/bigquery/view_test.go b/ext/store/bigquery/view_test.go index 71a3d4b451..229a453c7d 100644 --- a/ext/store/bigquery/view_test.go +++ b/ext/store/bigquery/view_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/mock" "google.golang.org/api/googleapi" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/store/bigquery" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/store/bigquery" ) func TestViewHandle(t *testing.T) { diff --git a/ext/transport/kafka/writer.go b/ext/transport/kafka/writer.go new file mode 100644 index 0000000000..ce47148656 --- /dev/null +++ b/ext/transport/kafka/writer.go @@ -0,0 +1,60 @@ +package kafka + +import ( + "context" + "time" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/raystack/salt/log" + "github.com/segmentio/kafka-go" +) + +const ( + writeTimeout = time.Second * 3 +) + +var kafkaQueueCounter = promauto.NewCounter(prometheus.CounterOpts{ + Name: "publisher_kafka_events_queued_total", + Help: "Number of events queued to be published to kafka topic", +}) + +type Writer struct { + kafkaWriter *kafka.Writer +} + +func NewWriter(kafkaBrokerUrls []string, topic string, logger log.Logger) *Writer { + writer := &kafka.Writer{ + Addr: kafka.TCP(kafkaBrokerUrls...), + Topic: topic, + AllowAutoTopicCreation: true, + Balancer: &kafka.LeastBytes{}, + RequiredAcks: kafka.RequireOne, + MaxAttempts: 1, + WriteTimeout: writeTimeout, + Logger: kafka.LoggerFunc(logger.Info), + ErrorLogger: kafka.LoggerFunc(logger.Error), + } + + return &Writer{kafkaWriter: writer} +} + +func (w *Writer) Close() error { + return w.kafkaWriter.Close() +} + +func (w *Writer) Write(messages [][]byte) error { + kafkaMessages := make([]kafka.Message, len(messages)) + for i, m := range messages { + kafkaMessages[i] = kafka.Message{ + Value: m, + } + } + + err := w.kafkaWriter.WriteMessages(context.Background(), kafkaMessages...) + if err == nil { + kafkaQueueCounter.Add(float64(len(messages))) + return nil + } + return err +} diff --git a/go.mod b/go.mod index c243883246..221131bbd0 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ -module github.com/odpf/optimus +module github.com/raystack/optimus go 1.19 -replace github.com/odpf/optimus/sdk => ./sdk +replace github.com/raystack/optimus/sdk => ./sdk require ( cloud.google.com/go/bigquery v1.44.0 @@ -13,14 +13,13 @@ require ( github.com/charmbracelet/bubbles v0.13.0 github.com/charmbracelet/bubbletea v0.22.1 github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0 - github.com/emirpasic/gods v1.12.0 github.com/fatih/color v1.7.0 github.com/go-ozzo/ozzo-validation/v4 v4.3.0 github.com/golang-migrate/migrate/v4 v4.15.2 github.com/google/uuid v1.3.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.6.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69 github.com/hashicorp/go-getter v1.6.2 github.com/hashicorp/go-hclog v0.14.1 @@ -30,19 +29,21 @@ require ( github.com/lib/pq v1.10.4 github.com/mattn/go-isatty v0.0.16 github.com/mitchellh/mapstructure v1.4.3 - github.com/odpf/optimus/sdk v0.0.0-20230104081553-fa05355b2dda - github.com/odpf/salt v0.0.0-20220614042821-c5613a78b4d6 github.com/olekukonko/tablewriter v0.0.5 github.com/prometheus/client_golang v1.11.0 + github.com/raystack/optimus/sdk v0.0.0-20230313071811-2d68a9c815bf + github.com/raystack/salt v0.3.2 github.com/robfig/cron/v3 v3.0.1 github.com/schollz/progressbar/v3 v3.8.5 + github.com/segmentio/kafka-go v0.4.39 github.com/sirupsen/logrus v1.8.1 github.com/slack-go/slack v0.9.1 - github.com/spf13/afero v1.8.2 + github.com/spf13/afero v1.9.2 github.com/spf13/cobra v1.2.1 github.com/spf13/viper v1.8.1 github.com/stretchr/testify v1.8.1 github.com/xlab/treeprint v1.1.0 + github.com/zalando/go-keyring v0.2.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 go.opentelemetry.io/otel v1.7.0 @@ -68,6 +69,7 @@ require ( cloud.google.com/go/iam v0.7.0 // indirect cloud.google.com/go/storage v1.27.0 // indirect github.com/alecthomas/chroma v0.8.2 // indirect + github.com/alessio/shellescape v1.4.1 // indirect github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect github.com/atotto/clipboard v0.1.4 // indirect github.com/aws/aws-sdk-go v1.43.31 // indirect @@ -77,7 +79,10 @@ require ( github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/charmbracelet/glamour v0.3.0 // indirect github.com/charmbracelet/lipgloss v0.5.0 // indirect + github.com/cli/safeexec v1.0.0 // indirect github.com/containerd/console v1.0.3 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect + github.com/danieljoos/wincred v1.2.0 // indirect github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dlclark/regexp2 v1.2.0 // indirect @@ -85,10 +90,12 @@ require ( github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/wire v0.5.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect github.com/googleapis/gax-go/v2 v2.7.0 // indirect @@ -109,7 +116,7 @@ require ( github.com/jhump/protoreflect v1.9.1-0.20210817181203-db1a327a393e // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/compress v1.15.1 // indirect + github.com/klauspost/compress v1.15.9 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/magiconair/properties v1.8.5 // indirect github.com/mattn/go-colorable v0.1.6 // indirect @@ -126,8 +133,9 @@ require ( github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/reflow v0.3.0 // indirect github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 // indirect - github.com/oklog/run v1.0.0 // indirect + github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml v1.9.3 // indirect + github.com/pierrec/lz4/v4 v4.1.15 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect @@ -135,13 +143,15 @@ require ( github.com/prometheus/procfs v0.7.3 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/ulikunitz/xz v0.5.8 // indirect - github.com/yuin/goldmark v1.4.1 // indirect + github.com/yuin/goldmark v1.4.13 // indirect github.com/yuin/goldmark-emoji v1.0.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/otel/metric v0.30.0 // indirect @@ -151,7 +161,7 @@ require ( go.uber.org/zap v1.21.0 // indirect golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.4.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/go.sum b/go.sum index 3904cd5e1f..4b9d556d92 100644 --- a/go.sum +++ b/go.sum @@ -34,6 +34,7 @@ cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0c cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -48,6 +49,9 @@ cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTB cloud.google.com/go/compute v1.2.0/go.mod h1:xlogom/6gr8RJGBe7nT2eGsQYAFUbbv8dbC29qE3Xmw= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= @@ -81,6 +85,7 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.21.0/go.mod h1:XmRlxkgPjlBONznT2dDUU/5XlpU2OjMnKuqnZI01LAA= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= cloud.google.com/go/trace v1.0.0/go.mod h1:4iErSByzxkyHWzzlAj63/Gmjz0NH1ASqhJguHpGcr6A= @@ -91,6 +96,7 @@ contrib.go.opencensus.io/integrations/ocsql v0.1.7/go.mod h1:8DsSdjz3F+APR+0z0Wk dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= +github.com/AlecAivazis/survey/v2 v2.3.5/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI= github.com/AlecAivazis/survey/v2 v2.3.6 h1:NvTuVHISgTHEHeBFqt6BHOe4Ny/NwGZr7w+F8S9ziyw= github.com/AlecAivazis/survey/v2 v2.3.6/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI= github.com/Azure/azure-amqp-common-go/v3 v3.2.1/go.mod h1:O6X1iYHP7s2x7NjUKsXVhkwWrQhxrd+d8/3rRadj4CI= @@ -137,7 +143,6 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= -github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/GoogleCloudPlatform/cloudsql-proxy v1.29.0/go.mod h1:spvB9eLJH9dutlbPSRmHvSXXHOwGRyeXh1jVdquA2G8= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= @@ -170,6 +175,7 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0 github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s= github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PagerDuty/go-pagerduty v1.5.1 h1:zpMQ8WwWlUahipB2q+ERVIA9D0/ti8kvsQUSagCK86g= github.com/PagerDuty/go-pagerduty v1.5.1/go.mod h1:txr8VbObXdk2RkqF+C2an4qWssdGY99fK26XYUDjh+4= @@ -193,6 +199,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= +github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 h1:MzBOUgng9orim59UnfUTLRjMpd09C5uEVQ6RPGeCaVI= @@ -209,6 +217,9 @@ github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06 github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= +github.com/authzed/authzed-go v0.7.0/go.mod h1:bmjzzIQ34M0+z8NO9SLjf4oA0A9Ka9gUWVzeSbD0E7c= +github.com/authzed/grpcutil v0.0.0-20210913124023-cad23ae5a9e8/go.mod h1:HwO/KbRU3fWXEYHE96kvXnwxzi97tkXD1hfi5UaZ71Y= +github.com/authzed/grpcutil v0.0.0-20220104222419-f813f77722e5/go.mod h1:rqjY3zyK/YP7NID9+B2BdIRRkvnK+cdf9/qya/zaFZE= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= @@ -314,10 +325,12 @@ github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0Bsq github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -345,6 +358,8 @@ github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= +github.com/cli/safeexec v1.0.0 h1:0VngyaIyqACHdcMNWfo6+KdUYnqEr2Sg+bSP1pdF+dI= +github.com/cli/safeexec v1.0.0/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -411,6 +426,7 @@ github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= @@ -480,6 +496,7 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -493,12 +510,13 @@ github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1S github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= +github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= +github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= @@ -515,12 +533,14 @@ github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55k github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v20.10.14+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.13+incompatible h1:5s7uxnKZG+b8hYWlPYUi6x1Sjpq2MSt96d15eLZeHyw= github.com/docker/docker v20.10.13+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= @@ -543,8 +563,6 @@ github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -557,6 +575,7 @@ github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPO github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= @@ -675,6 +694,8 @@ github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6 github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= +github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= @@ -753,6 +774,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= @@ -792,6 +814,8 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -801,6 +825,7 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0 h1:y8Yozv7SZtlU//QXbezB6QkpuE6jMD2/gfzk4AftXjs= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -808,11 +833,14 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -841,8 +869,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.6.0 h1:rgxjzoDmDXw5q8HONgyHhBas4to0/XWRo/gPpJhsUNQ= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.6.0/go.mod h1:qrJPVzv9YlhsrxJc3P/Q85nr0w1lIRikTl4JlhdDH5w= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69 h1:7xsUJsB2NrdcttQPa7JLEaGzvdbk7KvfrjgHZXOQRo0= github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69/go.mod h1:YLEMZOtU+AZ7dhN9T/IpGhXVGly2bvkJQ+zxj3WeVQo= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= @@ -916,7 +944,6 @@ github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsU github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk= github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.7.0/go.mod h1:sF/lPpNEMEOp+IYhyQGdAvrG20gWf6A1tKlr0v7JMeA= github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= @@ -934,7 +961,6 @@ github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.5/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.7/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= @@ -948,7 +974,6 @@ github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrU github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po= github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= -github.com/jackc/pgtype v1.5.0/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= github.com/jackc/pgtype v1.6.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= github.com/jackc/pgtype v1.10.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= @@ -958,7 +983,6 @@ github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQ github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA= github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o= github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= -github.com/jackc/pgx/v4 v4.9.0/go.mod h1:MNGWmViCgqbZck9ujOOBN63gK9XVGILXWCvKLGKmnms= github.com/jackc/pgx/v4 v4.10.1/go.mod h1:QlrWebbs3kqEZPHCTGyxecvzG6tvIsYu+A5b1raylkA= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= github.com/jackc/pgx/v4 v4.15.0/go.mod h1:D/zyOyXiaM1TmVWnOM18p0xdDtdakRBa0RsVGI3U3bw= @@ -968,7 +992,6 @@ github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.2/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle/v2 v2.1.2 h1:0f7vaaXINONKTsxYDn4otOAiJanX/BMeAtY//BXqzlg= @@ -989,6 +1012,7 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= +github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -1009,6 +1033,7 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jzelinskie/stringz v0.0.0-20210414224931-d6a8ce844a70/go.mod h1:hHYbgxJuNLRw91CmpuFsYEOyQqpDVFg8pvEh23vy4P0= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= github.com/k0kubun/pp v2.3.0+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= @@ -1029,8 +1054,9 @@ github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdY github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A= github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1052,6 +1078,7 @@ github.com/kushsharma/parallel v0.2.1/go.mod h1:6JCy2+DRCUfZ0VFBUg6HG8IdDTDKuVL0 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -1065,6 +1092,8 @@ github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= @@ -1111,7 +1140,6 @@ github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vq github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -1155,6 +1183,7 @@ github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= @@ -1195,10 +1224,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/odpf/salt v0.0.0-20220614042821-c5613a78b4d6 h1:ZPATgfcee1Vn2h9Ea6A0MsqgoUCKvN3AwYOaudi6X/s= -github.com/odpf/salt v0.0.0-20220614042821-c5613a78b4d6/go.mod h1:ZY9yXIHZYlYbQGKV5WSGmyYnw+NtQEzl6z0Tj0dto8M= -github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= @@ -1242,6 +1270,7 @@ github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rm github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= +github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -1254,6 +1283,7 @@ github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3 github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= @@ -1265,6 +1295,8 @@ github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2 github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= @@ -1317,6 +1349,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/raystack/salt v0.3.2 h1:0kEuaHefwyL+uTC8r+jVoDW9C3jRTl6/ezZwynlc8oE= +github.com/raystack/salt v0.3.2/go.mod h1:MZUZG25Si+aU8QkqGt9FZrHA7zm5gQGnzRk5HRq9jaE= github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -1334,6 +1368,7 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -1348,11 +1383,14 @@ github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= +github.com/segmentio/kafka-go v0.4.39 h1:75smaomhvkYRwtuOwqLsdhgCG30B82NsbdkdDfFbvrw= +github.com/segmentio/kafka-go v0.4.39/go.mod h1:T0MLgygYvmqmBvC+s8aCcbVNfJN4znVne5j0Pzowp/Q= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= @@ -1379,8 +1417,8 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -1457,9 +1495,14 @@ github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVT github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg/scram v1.0.5 h1:TuS0RFmt5Is5qm9Tm2SoD89OPqe4IRiFtyFY4iwWXsw= +github.com/xdg/scram v1.0.5/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v1.0.3 h1:cmL5Enob4W83ti/ZHuZLuKD/xqJfus4fVPwE+/BDm+4= +github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= @@ -1471,17 +1514,17 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.3/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark-emoji v1.0.1 h1:ctuWEyzGBwiucEqxzwe0SOYDXPAucOrE9NQC18Wa1os= github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= +github.com/zalando/go-keyring v0.2.3 h1:v9CUu9phlABObO4LPWycf+zwMG7nlbb3t/B5wa97yms= +github.com/zalando/go-keyring v0.2.3/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE= -go.buf.build/odpf/gw/grpc-ecosystem/grpc-gateway v1.1.35/go.mod h1:/LuddrGPi0fwj7ay6Orutt8oFfPz8Y3c8qdBkacJq1A= -go.buf.build/odpf/gw/odpf/proton v1.1.9/go.mod h1:I9E8CF7w/690vRNWqBU6qDcUbi3Pi2THdn1yycBVTDQ= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= @@ -1608,6 +1651,7 @@ golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1657,6 +1701,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1731,6 +1776,14 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220401154927-543a649e0bdd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220706163947-c90051bbdb60/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20220919232410-f2f64ebce3c1/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1756,6 +1809,10 @@ golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 h1:nt+Q6cXKz4MosCSpnbMtqiQ8Oz0pxTef2B4Vca2lvfk= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1770,6 +1827,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1906,10 +1965,20 @@ golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220818161305-2296e01440c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -2021,12 +2090,16 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= @@ -2080,6 +2153,10 @@ google.golang.org/api v0.69.0/go.mod h1:boanBiw+h5c3s+tBPgEzLDRHfFLWV0qXxRHz3ws7 google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/api v0.103.0 h1:9yuVqlu2JCvcLg9p8S3fcFLZij8EPSyvODIY1rkMizQ= google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= google.golang.org/appengine v1.0.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -2141,6 +2218,7 @@ google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210429181445-86c259c2b4ab/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= @@ -2188,6 +2266,17 @@ google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220401170504-314d38edb7de/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029 h1:zS8DNtiDX68/osEpazR86KM1vnDELdnRgpK6/fwlQTs= google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -2226,9 +2315,14 @@ google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ5 google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -2287,22 +2381,14 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/datatypes v1.0.0/go.mod h1:aKpJ+RNhLXWeF5OAdxfzBwT1UPw1wseSchF0AY3/lSw= -gorm.io/driver/mysql v1.0.3/go.mod h1:twGxftLBlFgNVNakL7F+P/x9oYqoymG3YYT8cAfI9oI= -gorm.io/driver/postgres v1.0.5/go.mod h1:qrD92UurYzNctBMVCJ8C3VQEjffEuphycXtxOudXNCA= gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg= -gorm.io/driver/sqlite v1.1.3/go.mod h1:AKDgRWk8lcSQSw+9kxCJnX/yySj8G3rdwYlU57cB45c= -gorm.io/driver/sqlserver v1.0.5/go.mod h1:WI/bfZ+s9TigYXe3hb3XjNaUP0TqmTdXl11pECyLATs= -gorm.io/gorm v1.20.1/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.20.2/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.20.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.20.5/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.21.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= +gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/compiler/engine.go b/internal/compiler/engine.go index 7774028758..900f2ea28a 100644 --- a/internal/compiler/engine.go +++ b/internal/compiler/engine.go @@ -2,11 +2,12 @@ package compiler import ( "bytes" + "fmt" "strings" "text/template" "time" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/internal/errors" ) const ( @@ -39,13 +40,15 @@ func (e *Engine) Compile(templateMap map[string]string, context map[string]any) for name, content := range templateMap { tmpl, err := e.baseTemplate.New(name).Parse(content) if err != nil { - return nil, errors.AddErrContext(err, EntityCompiler, "unable to parse content for "+name) + msg := fmt.Sprintf("unable to parse content for %s: %s", name, err.Error()) + return nil, errors.InvalidArgument(EntityCompiler, msg) } var buf bytes.Buffer err = tmpl.Execute(&buf, context) if err != nil { - return nil, errors.AddErrContext(err, EntityCompiler, "unable to render content for "+name) + msg := fmt.Sprintf("unable to render content for %s: %s", name, err.Error()) + return nil, errors.InvalidArgument(EntityCompiler, msg) } rendered[name] = strings.TrimSpace(buf.String()) } diff --git a/internal/compiler/engine_test.go b/internal/compiler/engine_test.go index b2c54679e0..8587262228 100644 --- a/internal/compiler/engine_test.go +++ b/internal/compiler/engine_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/compiler" + "github.com/raystack/optimus/internal/compiler" ) func TestEngine(t *testing.T) { @@ -99,7 +99,8 @@ func TestEngine(t *testing.T) { _, err := comp.Compile(map[string]string{"query": input}, context) assert.NotNil(t, err) - assert.EqualError(t, err, "internal error for entity compiler: unable to parse content for query") + assert.EqualError(t, err, "invalid argument for entity compiler: unable to parse content for query:"+ + " template: query:1: bad character U+0022 '\"'") }) t.Run("returns error when rendering fails", func(t *testing.T) { input := `event_timestamp > "{{.DSTART | Date }}"` @@ -111,7 +112,9 @@ func TestEngine(t *testing.T) { _, err := comp.Compile(map[string]string{"query": input}, context) assert.NotNil(t, err) - assert.EqualError(t, err, "internal error for entity compiler: unable to render content for query") + assert.EqualError(t, err, "invalid argument for entity compiler: unable to render content for query:"+ + " template: query:1:31: executing \"query\" at : error calling Date: parsing time \"\" as "+ + "\"2006-01-02T15:04:05Z07:00\": cannot parse \"\" as \"2006\"") }) t.Run("returns rendered string with values of macros for template map", func(t *testing.T) { testCases := []struct { diff --git a/internal/compiler/template_context.go b/internal/compiler/template_context.go index ce0ed378c7..22755da1e6 100644 --- a/internal/compiler/template_context.go +++ b/internal/compiler/template_context.go @@ -3,7 +3,7 @@ package compiler import ( "fmt" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/utils" ) type ContextOpts struct { diff --git a/internal/compiler/template_context_test.go b/internal/compiler/template_context_test.go index 4234b1fa2f..8aa573be9f 100644 --- a/internal/compiler/template_context_test.go +++ b/internal/compiler/template_context_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/compiler" + "github.com/raystack/optimus/internal/compiler" ) func TestContextBuilder(t *testing.T) { diff --git a/internal/compiler/template_func_test.go b/internal/compiler/template_func_test.go index d9febddc9e..5f0b3d0984 100644 --- a/internal/compiler/template_func_test.go +++ b/internal/compiler/template_func_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/compiler" + "github.com/raystack/optimus/internal/compiler" ) func TestTemplateFunctions(t *testing.T) { diff --git a/internal/errors/errors.go b/internal/errors/errors.go index 34d286001a..1372a1e87a 100644 --- a/internal/errors/errors.go +++ b/internal/errors/errors.go @@ -125,12 +125,12 @@ func As(err error, target any) bool { } func (e *DomainError) Error() string { - subError := "" - if errors.Is(e.WrappedErr, &DomainError{}) { - subError = ": " + e.WrappedErr.Error() + if e.WrappedErr != nil { + return fmt.Sprintf("%v for entity %v: %v: %s", + e.ErrorType.String(), e.Entity, e.Message, e.WrappedErr.Error()) } - return fmt.Sprintf("%v for entity %v: %v%s", - e.ErrorType.String(), e.Entity, e.Message, subError) + return fmt.Sprintf("%v for entity %v: %v", + e.ErrorType.String(), e.Entity, e.Message) } func (e *DomainError) Unwrap() error { diff --git a/internal/errors/errors_test.go b/internal/errors/errors_test.go index f543c85fe6..711dde9969 100644 --- a/internal/errors/errors_test.go +++ b/internal/errors/errors_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/internal/errors" ) func TestErrors(t *testing.T) { diff --git a/internal/errors/multi_test.go b/internal/errors/multi_test.go index 7c1b96ef24..859d540bce 100644 --- a/internal/errors/multi_test.go +++ b/internal/errors/multi_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/internal/errors" ) func TestMultiError(t *testing.T) { @@ -14,13 +14,13 @@ func TestMultiError(t *testing.T) { me := errors.NewMultiError("multi") me.Append(nil) - assert.Nil(t, errors.MultiToError(me)) + assert.Nil(t, me.ToErr()) }) t.Run("adds other type of error", func(t *testing.T) { me := errors.NewMultiError("multi") me.Append(errors.NotFound("dummy", "not found")) - assert.NotNil(t, errors.MultiToError(me)) + assert.NotNil(t, me.ToErr()) assert.EqualError(t, me, "multi:\n not found for entity dummy: not found") }) t.Run("adds errors in multi error to list", func(t *testing.T) { @@ -30,7 +30,7 @@ func TestMultiError(t *testing.T) { me := errors.NewMultiError("top level error") me.Append(me1) - assert.NotNil(t, errors.MultiToError(me)) + assert.NotNil(t, me.ToErr()) assert.EqualError(t, me, "top level error:\n not found for entity dummy: not found") }) }) diff --git a/internal/lib/cron/cron_test.go b/internal/lib/cron/cron_test.go index 4305547f03..21cb6354e3 100644 --- a/internal/lib/cron/cron_test.go +++ b/internal/lib/cron/cron_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/lib/cron" + "github.com/raystack/optimus/internal/lib/cron" ) func TestScheduleSpec(t *testing.T) { diff --git a/internal/lib/progress/progress.go b/internal/lib/progress/progress.go deleted file mode 100644 index 3b8d8da2ca..0000000000 --- a/internal/lib/progress/progress.go +++ /dev/null @@ -1,32 +0,0 @@ -package progress - -import "fmt" - -// Event an event published by certain services -// that notify that a certain progress has been made -type Event interface { - fmt.Stringer -} - -// Observer is an entity that wishes to -// receive progress events -type Observer interface { - Notify(evt Event) -} - -// ObserverChain iterate on all the observers for notify -type ObserverChain struct { - obs []Observer -} - -// Notify each observer -func (chain *ObserverChain) Notify(evt Event) { - for _, ob := range chain.obs { - ob.Notify(evt) - } -} - -// Join will add observer to listen for notify events -func (chain *ObserverChain) Join(obs Observer) { - chain.obs = append(chain.obs, obs) -} diff --git a/internal/lib/set/set.go b/internal/lib/set/set.go deleted file mode 100644 index f5120c9bcb..0000000000 --- a/internal/lib/set/set.go +++ /dev/null @@ -1,59 +0,0 @@ -package set - -import ( - "time" - - "github.com/emirpasic/gods/sets/hashset" - "github.com/emirpasic/gods/sets/treeset" -) - -// Set is a data structure implementation of ordered or unordered -// collection of unique elements that should insert/delete in O(1) if unordered -// and insert/delete in O(logn) if ordered -type Set interface { - Add(items ...interface{}) - Remove(items ...interface{}) - Values() []interface{} - String() string - Clear() - Size() int - Empty() bool - Contains(items ...interface{}) bool -} - -// Comparator will make type assertion (see IntComparator for example), -// which will panic if a or b are not of the asserted type. -// -// Should return a number: -// -// negative , if a < b -// zero , if a == b -// positive , if a > b -type Comparator func(a, b interface{}) int - -// NewHashSet instantiates a new empty set of unordered elements -func NewHashSet() *hashset.Set { - return hashset.New() -} - -// NewTreeSetWithTimeComparator instantiates a new empty set of ordered elements that contain time.Time -func NewTreeSetWithTimeComparator() *treeset.Set { - return treeset.NewWith(timeComparator) -} - -func NewTreeSetWith(comp func(a, b interface{}) int) *treeset.Set { - return treeset.NewWith(comp) -} - -func timeComparator(a, b interface{}) int { - aAsserted := a.(time.Time) - bAsserted := b.(time.Time) - switch { - case aAsserted.After(bAsserted): - return 1 - case aAsserted.Before(bAsserted): - return -1 - default: - return 0 - } -} diff --git a/internal/lib/tree/multi_root_tree_test.go b/internal/lib/tree/multi_root_tree_test.go index fa93f60088..8c48d400cf 100644 --- a/internal/lib/tree/multi_root_tree_test.go +++ b/internal/lib/tree/multi_root_tree_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - tree2 "github.com/odpf/optimus/internal/lib/tree" + tree2 "github.com/raystack/optimus/internal/lib/tree" ) func TestMultiRootDagTree(t *testing.T) { diff --git a/internal/lib/tree/tree_node.go b/internal/lib/tree/tree_node.go index 4eb4b69b8c..a17479d227 100644 --- a/internal/lib/tree/tree_node.go +++ b/internal/lib/tree/tree_node.go @@ -1,9 +1,5 @@ package tree -import ( - "github.com/odpf/optimus/internal/lib/set" -) - type TreeData interface { GetName() string } @@ -12,7 +8,6 @@ type TreeData interface { type TreeNode struct { Data TreeData Dependents []*TreeNode - Runs set.Set } // GetAllNodes returns level order traversal of tree starting from current node @@ -43,6 +38,5 @@ func NewTreeNode(data TreeData) *TreeNode { return &TreeNode{ Data: data, Dependents: []*TreeNode{}, - Runs: set.NewTreeSetWithTimeComparator(), } } diff --git a/internal/lib/tree/tree_node_test.go b/internal/lib/tree/tree_node_test.go index e918d48f2c..949c5f5314 100644 --- a/internal/lib/tree/tree_node_test.go +++ b/internal/lib/tree/tree_node_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/lib/tree" + "github.com/raystack/optimus/internal/lib/tree" ) type testNode struct { diff --git a/internal/models/plugin.go b/internal/models/plugin.go index 011f74153a..fbc2ad22e6 100644 --- a/internal/models/plugin.go +++ b/internal/models/plugin.go @@ -6,7 +6,7 @@ import ( "fmt" "sort" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/sdk/plugin" ) var ErrUnsupportedPlugin = errors.New("unsupported plugin requested, make sure its correctly installed") diff --git a/internal/models/plugin_test.go b/internal/models/plugin_test.go index c05ce97602..a48fb2c4e0 100644 --- a/internal/models/plugin_test.go +++ b/internal/models/plugin_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/sdk/plugin" - mockPlugin "github.com/odpf/optimus/sdk/plugin/mock" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/sdk/plugin" + mockPlugin "github.com/raystack/optimus/sdk/plugin/mock" ) func TestPluginModels(t *testing.T) { diff --git a/internal/models/window_test.go b/internal/models/window_test.go index 09249e0a4f..e4963c89f1 100644 --- a/internal/models/window_test.go +++ b/internal/models/window_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/internal/models" ) func TestNewWindow(t *testing.T) { diff --git a/internal/models/window_v1_test.go b/internal/models/window_v1_test.go index 5a9bfe2f83..d3e6c89745 100644 --- a/internal/models/window_v1_test.go +++ b/internal/models/window_v1_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/internal/models" ) func TestWindowV1(t *testing.T) { diff --git a/internal/models/window_v2.go b/internal/models/window_v2.go index e4369815c2..6276bc4cd3 100644 --- a/internal/models/window_v2.go +++ b/internal/models/window_v2.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/utils" ) type windowV2 struct { diff --git a/internal/models/window_v2_test.go b/internal/models/window_v2_test.go index dedb98f330..58d699a45d 100644 --- a/internal/models/window_v2_test.go +++ b/internal/models/window_v2_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/internal/models" ) func TestWindowV2(t *testing.T) { diff --git a/internal/store/postgres/job/adapter.go b/internal/store/postgres/job/adapter.go index 0beee867e1..f4d575b4b6 100644 --- a/internal/store/postgres/job/adapter.go +++ b/internal/store/postgres/job/adapter.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgx/v5" "github.com/lib/pq" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/models" ) const jobDatetimeLayout = "2006-01-02" @@ -57,7 +57,6 @@ type Schedule struct { EndDate *time.Time `json:",omitempty"` Interval string DependsOnPast bool - CatchUp bool Retry *Retry } @@ -266,7 +265,6 @@ func toStorageSchedule(scheduleSpec *job.Schedule) ([]byte, error) { StartDate: startDate, Interval: scheduleSpec.Interval(), DependsOnPast: scheduleSpec.DependsOnPast(), - CatchUp: scheduleSpec.CatchUp(), Retry: retry, } if scheduleSpec.EndDate() != "" { @@ -462,7 +460,6 @@ func fromStorageSchedule(raw []byte) (*job.Schedule, error) { return nil, err } scheduleBuilder := job.NewScheduleBuilder(startDate). - WithCatchUp(storageSchedule.CatchUp). WithDependsOnPast(storageSchedule.DependsOnPast). WithInterval(storageSchedule.Interval) diff --git a/internal/store/postgres/job/job_repository.go b/internal/store/postgres/job/job_repository.go index c273a6fe9b..c6a9d2a6f9 100644 --- a/internal/store/postgres/job/job_repository.go +++ b/internal/store/postgres/job/job_repository.go @@ -4,15 +4,16 @@ import ( "context" "database/sql" "fmt" + "strings" "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5/pgxpool" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( @@ -40,7 +41,7 @@ func (j JobRepository) Add(ctx context.Context, jobs []*job.Job) ([]*job.Job, er } storedJobs = append(storedJobs, jobEntity) } - return storedJobs, errors.MultiToError(me) + return storedJobs, me.ToErr() } func (j JobRepository) insertJobSpec(ctx context.Context, jobEntity *job.Job) error { @@ -101,7 +102,125 @@ func (j JobRepository) Update(ctx context.Context, jobs []*job.Job) ([]*job.Job, } storedJobs = append(storedJobs, jobEntity) } - return storedJobs, errors.MultiToError(me) + return storedJobs, me.ToErr() +} + +func (j JobRepository) UpdateState(ctx context.Context, jobTenant tenant.Tenant, jobNames []job.Name, jobState job.State, remark string) error { + updateJobStateQuery := ` +UPDATE job SET state = $1, remark = $2, updated_at = NOW() +WHERE project_name = $4 AND namespace_name = $5 AND name = any ($3);` + + tag, err := j.db.Exec(ctx, updateJobStateQuery, jobState, remark, jobNames, jobTenant.ProjectName(), jobTenant.NamespaceName()) + if err != nil { + return errors.Wrap(job.EntityJob, "error during job state update", err) + } + if tag.RowsAffected() != int64(len(jobNames)) { + return errors.NewError(errors.ErrNotFound, job.EntityJob, "failed to update state of all of the selected job in DB") + } + return nil +} + +func (j JobRepository) SyncState(ctx context.Context, jobTenant tenant.Tenant, disabledJobNames, enabledJobNames []job.Name) error { + tx, err := j.db.Begin(ctx) + if err != nil { + return err + } + updateJobStateQuery := ` +UPDATE job SET state = $1 +WHERE project_name = $2 AND namespace_name = $3 AND name = any ($4);` + + _, err = tx.Exec(ctx, updateJobStateQuery, job.ENABLED, jobTenant.ProjectName(), jobTenant.NamespaceName(), enabledJobNames) + if err != nil { + tx.Rollback(ctx) + return errors.Wrap(job.EntityJob, "error during job state enable sync", err) + } + + _, err = j.db.Exec(ctx, updateJobStateQuery, job.DISABLED, jobTenant.ProjectName(), jobTenant.NamespaceName(), disabledJobNames) + if err != nil { + tx.Rollback(ctx) + return errors.Wrap(job.EntityJob, "error during job state disable sync", err) + } + + tx.Commit(ctx) + return nil +} + +func (j JobRepository) ChangeJobNamespace(ctx context.Context, jobName job.Name, tenant, newTenant tenant.Tenant) error { + tx, err := j.db.Begin(ctx) + if err != nil { + return errors.InternalError(job.EntityJob, "unable to begin transaction", err) + } + + if err = changeJobNamespace(ctx, tx, jobName, tenant, newTenant); err != nil { + tx.Rollback(ctx) + return err + } + if err = changeJobUpstreamNamespace(ctx, tx, jobName, tenant, newTenant); err != nil { + tx.Rollback(ctx) + return err + } + if err = changeJobRunNamespace(ctx, tx, jobName, tenant, newTenant); err != nil { + tx.Rollback(ctx) + return err + } + tx.Commit(ctx) + return nil +} + +func changeJobNamespace(ctx context.Context, tx pgx.Tx, jobName job.Name, tenant, newTenant tenant.Tenant) error { + changeJobNamespaceQuery := ` +UPDATE job SET + namespace_name = $1, + updated_at = NOW(), deleted_at = null +WHERE + name = $2 AND + project_name = $3 AND + namespace_name = $4 +;` + tag, err := tx.Exec(ctx, changeJobNamespaceQuery, newTenant.NamespaceName(), jobName, + tenant.ProjectName(), tenant.NamespaceName()) + if err != nil { + return errors.Wrap(job.EntityJob, err.Error(), err) + } + + if tag.RowsAffected() == 0 { + return errors.NotFound(job.EntityJob, "job not found with the given namespace: "+tenant.NamespaceName().String()) + } + return nil +} + +func changeJobUpstreamNamespace(ctx context.Context, tx pgx.Tx, jobName job.Name, tenant, newTenant tenant.Tenant) error { + changeJobUpstreamsQuery := ` +UPDATE job_upstream SET + upstream_namespace_name = $1 +WHERE + upstream_job_name = $2 AND + upstream_project_name = $3 AND + upstream_namespace_name = $4 +;` + _, err := tx.Exec(ctx, changeJobUpstreamsQuery, newTenant.NamespaceName(), jobName, + tenant.ProjectName(), tenant.NamespaceName()) + if err != nil { + return errors.Wrap(job.EntityJob, err.Error(), err) + } + return nil +} + +func changeJobRunNamespace(ctx context.Context, tx pgx.Tx, jobName job.Name, tenant, newTenant tenant.Tenant) error { + changeJobRunNamespaceQuery := ` +UPDATE job_run SET + namespace_name = $1 +WHERE + job_name = $2 AND + project_name = $3 AND + namespace_name = $4 +;` + _, err := tx.Exec(ctx, changeJobRunNamespaceQuery, newTenant.NamespaceName(), jobName, + tenant.ProjectName(), tenant.NamespaceName()) + if err != nil { + return errors.Wrap(job.EntityJob, err.Error(), err) + } + return nil } func (j JobRepository) preCheckUpdate(ctx context.Context, jobEntity *job.Job) error { @@ -273,7 +392,7 @@ func (j JobRepository) toJobNameWithUpstreams(storeJobsWithUpstreams []*JobWithU jobNameWithUpstreams[name] = upstreams } - if err := errors.MultiToError(me); err != nil { + if err := me.ToErr(); err != nil { return nil, err } return jobNameWithUpstreams, nil @@ -477,10 +596,10 @@ func (j *JobWithUpstream) getJobFullName() string { } func (j JobRepository) ReplaceUpstreams(ctx context.Context, jobsWithUpstreams []*job.WithUpstream) error { - var storageJobUpstreams []*JobWithUpstream + var jobUpstreams []*JobWithUpstream for _, jobWithUpstreams := range jobsWithUpstreams { - upstream := toJobUpstream(jobWithUpstreams) - storageJobUpstreams = append(storageJobUpstreams, upstream...) + singleJobUpstreams := toJobUpstream(jobWithUpstreams) + jobUpstreams = append(jobUpstreams, singleJobUpstreams...) } tx, err := j.db.Begin(ctx) @@ -489,15 +608,15 @@ func (j JobRepository) ReplaceUpstreams(ctx context.Context, jobsWithUpstreams [ } var jobFullName []string - for _, upstream := range storageJobUpstreams { - jobFullName = append(jobFullName, upstream.getJobFullName()) + for _, jobWithUpstream := range jobsWithUpstreams { + jobFullName = append(jobFullName, jobWithUpstream.Job().FullName()) } - if err = j.deleteUpstreams(ctx, tx, jobFullName); err != nil { + if err = j.deleteUpstreamsByJobNames(ctx, tx, jobFullName); err != nil { tx.Rollback(ctx) return err } - if err = j.insertUpstreams(ctx, tx, storageJobUpstreams); err != nil { + if err = j.insertUpstreams(ctx, tx, jobUpstreams); err != nil { tx.Rollback(ctx) return err } @@ -568,7 +687,7 @@ VALUES ( return nil } -func (JobRepository) deleteUpstreams(ctx context.Context, tx pgx.Tx, jobUpstreams []string) error { +func (JobRepository) deleteUpstreamsByJobNames(ctx context.Context, tx pgx.Tx, jobUpstreams []string) error { deleteForProjectScope := `DELETE FROM job_upstream WHERE project_name || '/' || job_name = any ($1);` @@ -693,7 +812,7 @@ func (j JobRepository) GetAllByTenant(ctx context.Context, jobTenant tenant.Tena jobs = append(jobs, jobSpec) } - return jobs, errors.MultiToError(me) + return jobs, me.ToErr() } func (j JobRepository) GetUpstreams(ctx context.Context, projectName tenant.ProjectName, jobName job.Name) ([]*job.Upstream, error) { @@ -810,5 +929,49 @@ func fromStoreDownstream(storeDownstreamList []Downstream) ([]*job.Downstream, e } downstreamList = append(downstreamList, job.NewDownstream(downstreamJobName, downstreamProjectName, downstreamNamespaceName, downstreamTaskName)) } - return downstreamList, errors.MultiToError(me) + return downstreamList, me.ToErr() +} + +func (j JobRepository) GetDownstreamBySources(ctx context.Context, sources []job.ResourceURN) ([]*job.Downstream, error) { + if len(sources) == 0 { + return nil, nil + } + + var sourceWhereStatements []string + for _, r := range sources { + statement := "'" + r.String() + "' = any(sources)" + sourceWhereStatements = append(sourceWhereStatements, statement) + } + sourceStatement := "(" + strings.Join(sourceWhereStatements, " or \n") + ")" + + queryBuilder := new(strings.Builder) + queryBuilder.WriteString(` +SELECT + name as job_name, project_name, namespace_name, task_name +FROM job +WHERE +deleted_at IS NULL and +`) + queryBuilder.WriteString(sourceStatement) + queryBuilder.WriteString(";\n") + + query := queryBuilder.String() + + rows, err := j.db.Query(ctx, query) + if err != nil { + return nil, errors.Wrap(job.EntityJob, "error while getting job downstream", err) + } + defer rows.Close() + + var storeDownstream []Downstream + for rows.Next() { + var downstream Downstream + err := rows.Scan(&downstream.JobName, &downstream.ProjectName, &downstream.NamespaceName, &downstream.TaskName) + if err != nil { + return nil, errors.Wrap(job.EntityJob, "error while getting downstream by destination", err) + } + storeDownstream = append(storeDownstream, downstream) + } + + return fromStoreDownstream(storeDownstream) } diff --git a/internal/store/postgres/job/job_repository_test.go b/internal/store/postgres/job/job_repository_test.go index 971435156e..5642b7792b 100644 --- a/internal/store/postgres/job/job_repository_test.go +++ b/internal/store/postgres/job/job_repository_test.go @@ -9,12 +9,12 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/models" - postgres "github.com/odpf/optimus/internal/store/postgres/job" - tenantPostgres "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/models" + postgres "github.com/raystack/optimus/internal/store/postgres/job" + tenantPostgres "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func TestPostgresJobRepository(t *testing.T) { @@ -707,6 +707,29 @@ func TestPostgresJobRepository(t *testing.T) { assert.NoError(t, err) assert.EqualValues(t, []*job.Upstream{upstreamC}, upstreamsOfJobA) }) + t.Run("deletes existing job upstream without inserts if no longer upstream found", func(t *testing.T) { + db := dbSetup() + + upstreamB := job.NewUpstreamResolved("jobB", host, "resource-B", sampleTenant, upstreamType, taskName, false) + + jobUpstreamRepo := postgres.NewJobRepository(db) + _, err = jobUpstreamRepo.Add(ctx, []*job.Job{jobA, jobB, jobC}) + assert.NoError(t, err) + + jobAWithUpstream := job.NewWithUpstream(jobA, []*job.Upstream{upstreamB}) + assert.NoError(t, jobUpstreamRepo.ReplaceUpstreams(ctx, []*job.WithUpstream{jobAWithUpstream})) + + upstreamsOfJobA, err := jobUpstreamRepo.GetUpstreams(ctx, proj.Name(), jobA.Spec().Name()) + assert.NoError(t, err) + assert.EqualValues(t, []*job.Upstream{upstreamB}, upstreamsOfJobA) + + jobAWithNoUpstream := job.NewWithUpstream(jobA, []*job.Upstream{}) + assert.NoError(t, jobUpstreamRepo.ReplaceUpstreams(ctx, []*job.WithUpstream{jobAWithNoUpstream})) + + upstreamsOfJobA, err = jobUpstreamRepo.GetUpstreams(ctx, proj.Name(), jobA.Spec().Name()) + assert.NoError(t, err) + assert.Empty(t, upstreamsOfJobA) + }) t.Run("inserts job upstreams with exact name across projects exists", func(t *testing.T) { db := dbSetup() @@ -730,6 +753,49 @@ func TestPostgresJobRepository(t *testing.T) { assert.Nil(t, jobUpstreamRepo.ReplaceUpstreams(ctx, []*job.WithUpstream{jobWithUpstream})) }) }) + t.Run("ChangeJobNamespace", func(t *testing.T) { + newTenant, _ := tenant.NewTenant(otherNamespace.ProjectName().String(), otherNamespace.Name().String()) + jobSpecA, err := job.NewSpecBuilder(jobVersion, "sample-job-A", jobOwner, jobSchedule, jobWindow, jobTask).WithDescription(jobDescription).Build() + assert.NoError(t, err) + jobA := job.NewJob(sampleTenant, jobSpecA, "dev.resource.sample_a", []job.ResourceURN{"dev.resource.sample_c"}) + + jobSpecB, err := job.NewSpecBuilder(jobVersion, "sample-job-B", jobOwner, jobSchedule, jobWindow, jobTask).WithDescription(jobDescription).Build() + assert.NoError(t, err) + jobB := job.NewJob(sampleTenant, jobSpecB, "dev.resource.sample_b", []job.ResourceURN{"dev.resource.sample_a"}) + + t.Run("Change Job namespace successfully", func(t *testing.T) { + db := dbSetup() + + jobRepo := postgres.NewJobRepository(db) + addedJob, err := jobRepo.Add(ctx, []*job.Job{jobA, jobB}) + assert.NoError(t, err) + assert.NotNil(t, addedJob) + + upstreamAInferred := job.NewUpstreamResolved("sample-job-A", "host-1", "dev.resource.sample_a", sampleTenant, "inferred", taskName, false) + jobBWithUpstream := job.NewWithUpstream(jobB, []*job.Upstream{upstreamAInferred}) + err = jobRepo.ReplaceUpstreams(ctx, []*job.WithUpstream{jobBWithUpstream}) + assert.NoError(t, err) + + // update failure with proper log message shows job has been soft deleted + err = jobRepo.ChangeJobNamespace(ctx, jobSpecA.Name(), sampleTenant, newTenant) + assert.Nil(t, err) + + jobA, err = jobRepo.GetByJobName(ctx, proj.Name(), jobSpecA.Name()) + assert.Nil(t, err) + assert.Equal(t, jobA.Tenant().NamespaceName(), newTenant.NamespaceName()) + + jobBUpstreams, err := jobRepo.GetUpstreams(ctx, proj.Name(), jobSpecB.Name()) + assert.Nil(t, err) + jobAIsUpstream := false + for _, upstream := range jobBUpstreams { + if upstream.Name() == jobSpecA.Name() { + jobAIsUpstream = true + assert.Equal(t, upstream.NamespaceName(), newTenant.NamespaceName()) + } + } + assert.True(t, jobAIsUpstream) + }) + }) t.Run("Delete", func(t *testing.T) { t.Run("soft delete a job if not asked to do clean delete", func(t *testing.T) { @@ -1059,4 +1125,75 @@ func TestPostgresJobRepository(t *testing.T) { assert.EqualValues(t, expectedDownstream, result) }) }) + + t.Run("GetDownstreamBySources", func(t *testing.T) { + t.Run("returns empty downstream if resource urns are empty", func(t *testing.T) { + db := dbSetup() + jobRepo := postgres.NewJobRepository(db) + + var sources []job.ResourceURN + + result, err := jobRepo.GetDownstreamBySources(ctx, sources) + assert.NoError(t, err) + assert.Empty(t, result) + }) + + t.Run("returns downstream given resource urns", func(t *testing.T) { + db := dbSetup() + + jobAName, _ := job.NameFrom("sample-job-A") + jobSpecA, err := job.NewSpecBuilder(jobVersion, jobAName, jobOwner, jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + jobA := job.NewJob(sampleTenant, jobSpecA, "dev.resource.sample_a", []job.ResourceURN{"dev.resource.sample_b", "dev.resource.sample_c"}) + + jobBName, _ := job.NameFrom("sample-job-b") + jobSpecB, err := job.NewSpecBuilder(jobVersion, jobBName, jobOwner, jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + jobB := job.NewJob(sampleTenant, jobSpecB, "dev.resource.sample_d", []job.ResourceURN{"dev.resource.sample_e"}) + + jobCName, _ := job.NameFrom("sample-job-c") + jobSpecC, err := job.NewSpecBuilder(jobVersion, jobCName, jobOwner, jobSchedule, jobWindow, jobTask).Build() + assert.NoError(t, err) + jobC := job.NewJob(sampleTenant, jobSpecC, "dev.resource.sample_f", nil) + + jobRepo := postgres.NewJobRepository(db) + _, err = jobRepo.Add(ctx, []*job.Job{jobA, jobB, jobC}) + assert.NoError(t, err) + + jobAAsDownstream := job.NewDownstream(jobAName, sampleTenant.ProjectName(), sampleTenant.NamespaceName(), jobTask.Name()) + jobBAsDownstream := job.NewDownstream(jobBName, sampleTenant.ProjectName(), sampleTenant.NamespaceName(), jobTask.Name()) + + testCases := []struct { + sources []job.ResourceURN + expectedDownstreams []*job.Downstream + }{ + { + sources: []job.ResourceURN{"dev.resource.sample_b"}, + expectedDownstreams: []*job.Downstream{jobAAsDownstream}, + }, + { + sources: []job.ResourceURN{"dev.resource.sample_b", "dev.resource.sample_e"}, + expectedDownstreams: []*job.Downstream{jobAAsDownstream, jobBAsDownstream}, + }, + { + sources: []job.ResourceURN{"dev.resource.sample_b", "dev.resource.sample_c"}, + expectedDownstreams: []*job.Downstream{jobAAsDownstream}, + }, + { + sources: []job.ResourceURN{"dev.resource.sample_e", "dev.resource.sample_f"}, + expectedDownstreams: []*job.Downstream{jobBAsDownstream}, + }, + { + sources: []job.ResourceURN{"dev.resource.sample_f", "dev.resource.sample_g"}, + expectedDownstreams: nil, + }, + } + + for _, test := range testCases { + result, err := jobRepo.GetDownstreamBySources(ctx, test.sources) + assert.NoError(t, err) + assert.EqualValues(t, test.expectedDownstreams, result) + } + }) + }) } diff --git a/internal/store/postgres/migrations/000053_cleanup_old_data.down.sql b/internal/store/postgres/migrations/000053_cleanup_old_data.down.sql new file mode 100644 index 0000000000..110a67606c --- /dev/null +++ b/internal/store/postgres/migrations/000053_cleanup_old_data.down.sql @@ -0,0 +1,170 @@ +ALTER TABLE hook_run DROP CONSTRAINT IF EXISTS hook_run_job_id_fkey; +ALTER TABLE hook_run ADD CONSTRAINT hook_run_job_id_fkey +FOREIGN KEY (job_run_id) REFERENCES job_run(id) ON DELETE CASCADE; + +ALTER TABLE sensor_run DROP CONSTRAINT IF EXISTS sensor_run_job_id_fkey; +ALTER TABLE sensor_run ADD CONSTRAINT sensor_run_job_id_fkey +FOREIGN KEY (job_run_id) REFERENCES job_run(id) ON DELETE CASCADE; + +ALTER TABLE task_run DROP CONSTRAINT IF EXISTS task_run_job_id_fkey; +ALTER TABLE task_run ADD CONSTRAINT task_run_job_id_fkey +FOREIGN KEY (job_run_id) REFERENCES job_run(id) ON DELETE CASCADE; + +CREATE TABLE project_old ( + id uuid DEFAULT uuid_generate_v4() NOT NULL, + name character varying(100) NOT NULL, + config jsonb, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + deleted_at timestamp with time zone +); +ALTER TABLE ONLY project_old + ADD CONSTRAINT project_name_key UNIQUE (name); +ALTER TABLE ONLY project_old + ADD CONSTRAINT project_pkey PRIMARY KEY (id); + + +CREATE TABLE namespace_old ( + id uuid DEFAULT uuid_generate_v4() NOT NULL, + project_id uuid NOT NULL, + name character varying(100) NOT NULL, + config jsonb, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + deleted_at timestamp with time zone +); +ALTER TABLE ONLY namespace_old + ADD CONSTRAINT namespace_pkey PRIMARY KEY (id); +ALTER TABLE ONLY namespace_old + ADD CONSTRAINT namespace_project_id_name_key UNIQUE (project_id, name); +ALTER TABLE ONLY namespace_old + ADD CONSTRAINT namespace_project_id_fkey FOREIGN KEY (project_id) REFERENCES project_old(id); + +CREATE TABLE secret_old ( + id uuid DEFAULT uuid_generate_v4() NOT NULL, + project_id uuid NOT NULL, + name character varying(100) NOT NULL, + value text, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + deleted_at timestamp with time zone, + namespace_id uuid, + type character varying(15) +); +ALTER TABLE ONLY secret_old + ADD CONSTRAINT secret_pkey PRIMARY KEY (id); +ALTER TABLE ONLY secret_old + ADD CONSTRAINT secret_project_id_name_key UNIQUE (project_id, name); +CREATE INDEX secret_name_idx ON secret_old USING btree (name); +CREATE INDEX secret_namespace_id_idx ON secret_old USING btree (namespace_id); +CREATE INDEX secret_project_id_idx ON secret_old USING btree (project_id); +CREATE INDEX secret_type_idx ON secret_old USING btree (type); +ALTER TABLE ONLY secret_old + ADD CONSTRAINT secret_namespace_id_fkey FOREIGN KEY (namespace_id) REFERENCES namespace_old(id); +ALTER TABLE ONLY secret_old + ADD CONSTRAINT secret_project_id_fkey FOREIGN KEY (project_id) REFERENCES project_old(id); + + +CREATE TABLE resource_old ( + id uuid DEFAULT uuid_generate_v4() NOT NULL, + project_id uuid NOT NULL, + datastore character varying(100) NOT NULL, + version integer, + name character varying(250) NOT NULL, + type character varying(100) NOT NULL, + spec bytea, + assets jsonb, + labels jsonb, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + deleted_at timestamp with time zone, + namespace_id uuid NOT NULL, + urn character varying(300) +); +ALTER TABLE ONLY resource_old + ADD CONSTRAINT resource_pkey PRIMARY KEY (id); +ALTER TABLE ONLY resource_old + ADD CONSTRAINT resource_project_id_datastore_name_key UNIQUE (project_id, datastore, name); +CREATE INDEX resource_name_idx ON resource_old USING btree (name); +CREATE INDEX resource_namespace_id_idx ON resource_old USING btree (namespace_id); +CREATE INDEX resource_project_id_idx ON resource_old USING btree (project_id); +CREATE INDEX resource_urn_idx ON resource_old USING btree (urn); +ALTER TABLE ONLY resource_old + ADD CONSTRAINT resource_namespace_id_fkey FOREIGN KEY (namespace_id) REFERENCES namespace_old(id); +ALTER TABLE ONLY resource_old + ADD CONSTRAINT resource_project_id_fkey FOREIGN KEY (project_id) REFERENCES project_old(id); + +CREATE TABLE backup_old ( + id uuid NOT NULL, + resource_id uuid NOT NULL, + spec jsonb, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); +ALTER TABLE ONLY backup_old + ADD CONSTRAINT backup_pkey PRIMARY KEY (id); +ALTER TABLE ONLY backup_old + ADD CONSTRAINT backup_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES resource_old(id) ON DELETE CASCADE; + +CREATE TABLE replay_old ( + id uuid NOT NULL, + job_id uuid NOT NULL, + start_date timestamp with time zone NOT NULL, + end_date timestamp with time zone NOT NULL, + status character varying(30) NOT NULL, + message jsonb, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + execution_tree jsonb, + config jsonb +); +ALTER TABLE ONLY replay_old + ADD CONSTRAINT replay_pkey PRIMARY KEY (id); + +CREATE TABLE job_old ( + id uuid DEFAULT uuid_generate_v4() NOT NULL, + project_id uuid NOT NULL, + version integer, + name character varying(220) NOT NULL, + owner character varying(100), + start_date timestamp without time zone NOT NULL, + end_date timestamp without time zone, + "interval" character varying(50), + dependencies jsonb, + task_name character varying(200), + task_config jsonb, + old_window_size bigint, + old_window_offset bigint, + window_truncate_to character varying(10), + assets jsonb, + hooks jsonb, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + deleted_at timestamp with time zone, + destination character varying(300), + description text, + labels jsonb, + namespace_id uuid NOT NULL, + behavior jsonb, + metadata jsonb, + external_dependencies jsonb, + window_size character varying(10), + window_offset character varying(10) +); +ALTER TABLE ONLY job_old + ADD CONSTRAINT job_pkey PRIMARY KEY (id); +ALTER TABLE ONLY job_old + ADD CONSTRAINT job_project_id_name_key UNIQUE (project_id, name); +CREATE INDEX job_old_destination_idx ON job_old USING btree (destination); +CREATE INDEX job_old_name_idx ON job_old USING btree (name); +CREATE INDEX job_old_namespace_id_idx ON job_old USING btree (namespace_id); +CREATE INDEX job_old_project_id_idx ON job_old USING btree (project_id); +ALTER TABLE ONLY job_old + ADD CONSTRAINT job_namespace_id_fkey FOREIGN KEY (namespace_id) REFERENCES namespace_old(id); +ALTER TABLE ONLY job_old + ADD CONSTRAINT job_project_id_fkey FOREIGN KEY (project_id) REFERENCES project_old(id); + +DROP INDEX IF EXISTS idx_job_run_start_time; +DROP INDEX IF EXISTS idx_sensor_run_start_time; +DROP INDEX IF EXISTS idx_hook_run_start_time; +DROP INDEX IF EXISTS idx_task_run_start_time; \ No newline at end of file diff --git a/internal/store/postgres/migrations/000053_cleanup_old_data.up.sql b/internal/store/postgres/migrations/000053_cleanup_old_data.up.sql new file mode 100644 index 0000000000..0dad144f96 --- /dev/null +++ b/internal/store/postgres/migrations/000053_cleanup_old_data.up.sql @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS JOB_OLD; +DROP TABLE IF EXISTS JOB_DEPLOYMENT, MIGRATION_STEPS; +DROP TABLE IF EXISTS BACKUP_OLD, REPLAY_OLD, SECRET_OLD, RESOURCE_OLD; +DROP TABLE IF EXISTS NAMESPACE_OLD, PROJECT_OLD; + +ALTER TABLE sensor_run DROP CONSTRAINT IF EXISTS sensor_run_job_id_fkey; +ALTER TABLE task_run DROP CONSTRAINT IF EXISTS task_run_job_id_fkey; +ALTER TABLE hook_run DROP CONSTRAINT IF EXISTS hook_run_job_id_fkey; + +CREATE INDEX IF NOT EXISTS idx_job_run_start_time ON job_run (start_time); +CREATE INDEX IF NOT EXISTS idx_sensor_run_start_time ON sensor_run (start_time); +CREATE INDEX IF NOT EXISTS idx_hook_run_start_time ON hook_run (start_time); +CREATE INDEX IF NOT EXISTS idx_task_run_start_time ON task_run (start_time); diff --git a/internal/store/postgres/migrations/000054_job_run_constraint.down.sql b/internal/store/postgres/migrations/000054_job_run_constraint.down.sql new file mode 100644 index 0000000000..6557fa895a --- /dev/null +++ b/internal/store/postgres/migrations/000054_job_run_constraint.down.sql @@ -0,0 +1 @@ +ALTER TABLE JOB_RUN DROP CONSTRAINT pk_constraint_job_name_scheduled_at; \ No newline at end of file diff --git a/internal/store/postgres/migrations/000054_job_run_constraint.up.sql b/internal/store/postgres/migrations/000054_job_run_constraint.up.sql new file mode 100644 index 0000000000..6e8a58a24b --- /dev/null +++ b/internal/store/postgres/migrations/000054_job_run_constraint.up.sql @@ -0,0 +1,10 @@ +DELETE FROM JOB_RUN +WHERE (JOB_NAME, SCHEDULED_AT) IN ( + SELECT JOB_NAME, SCHEDULED_AT + FROM JOB_RUN + GROUP BY JOB_NAME, SCHEDULED_AT + HAVING COUNT(*) > 1 +); + +ALTER TABLE JOB_RUN +ADD CONSTRAINT pk_constraint_job_name_scheduled_at UNIQUE (JOB_NAME, SCHEDULED_AT); \ No newline at end of file diff --git a/internal/store/postgres/migrations/000055_job_enable_status.down.sql b/internal/store/postgres/migrations/000055_job_enable_status.down.sql new file mode 100644 index 0000000000..ba08bbfe61 --- /dev/null +++ b/internal/store/postgres/migrations/000055_job_enable_status.down.sql @@ -0,0 +1,3 @@ +ALTER TABLE JOB DROP COLUMN IF EXISTS STATE, DROP COLUMN IF EXISTS REMARK; + +DROP TYPE IF EXISTS VALID_JOB_STATE ; \ No newline at end of file diff --git a/internal/store/postgres/migrations/000055_job_enable_status.up.sql b/internal/store/postgres/migrations/000055_job_enable_status.up.sql new file mode 100644 index 0000000000..11481b0714 --- /dev/null +++ b/internal/store/postgres/migrations/000055_job_enable_status.up.sql @@ -0,0 +1,7 @@ +DO $$ BEGIN + CREATE TYPE VALID_JOB_STATE AS ENUM ('enabled', 'disabled'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; + +ALTER TABLE JOB ADD COLUMN IF NOT EXISTS STATE VALID_JOB_STATE DEFAULT 'enabled', ADD COLUMN IF NOT EXISTS REMARK TEXT; \ No newline at end of file diff --git a/internal/store/postgres/pgx.go b/internal/store/postgres/pgx.go index 936f05cd40..e748f9739e 100644 --- a/internal/store/postgres/pgx.go +++ b/internal/store/postgres/pgx.go @@ -6,7 +6,7 @@ import ( "github.com/jackc/pgx/v5/pgxpool" - "github.com/odpf/optimus/config" + "github.com/raystack/optimus/config" ) // Open will connect to the DB with custom configuration diff --git a/internal/store/postgres/resource/backup_repository.go b/internal/store/postgres/resource/backup_repository.go index 3a75be6f1e..836fcdaa92 100644 --- a/internal/store/postgres/resource/backup_repository.go +++ b/internal/store/postgres/resource/backup_repository.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/lib/pq" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( diff --git a/internal/store/postgres/resource/backup_repository_test.go b/internal/store/postgres/resource/backup_repository_test.go index 24ecdb7c11..118a674c55 100644 --- a/internal/store/postgres/resource/backup_repository_test.go +++ b/internal/store/postgres/resource/backup_repository_test.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - postgres "github.com/odpf/optimus/internal/store/postgres/resource" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + postgres "github.com/raystack/optimus/internal/store/postgres/resource" ) func TestPostgresBackupRepository(t *testing.T) { diff --git a/internal/store/postgres/resource/repository.go b/internal/store/postgres/resource/repository.go index 9c5ffe83d9..eb0f8c41cc 100644 --- a/internal/store/postgres/resource/repository.go +++ b/internal/store/postgres/resource/repository.go @@ -2,13 +2,14 @@ package resource import ( "context" + "fmt" "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgxpool" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( @@ -52,6 +53,22 @@ func (r Repository) Update(ctx context.Context, resourceModel *resource.Resource return nil } +func (r Repository) ChangeNamespace(ctx context.Context, res *resource.Resource, newTenant tenant.Tenant) error { + updateResource := `UPDATE resource SET namespace_name=$1, updated_at=now() + WHERE full_name=$2 AND store=$3 AND project_name = $4 And namespace_name = $5` + tag, err := r.db.Exec(ctx, updateResource, + newTenant.NamespaceName(), res.FullName(), res.Store(), + res.Tenant().ProjectName(), res.Tenant().NamespaceName()) + if err != nil { + return errors.Wrap(resource.EntityResource, "error changing tenant for resource:"+res.FullName(), err) + } + + if tag.RowsAffected() == 0 { + return errors.NotFound(resource.EntityResource, "no resource to changing tenant for ") + } + return nil +} + func (r Repository) ReadByFullName(ctx context.Context, tnnt tenant.Tenant, store resource.Store, fullName string) (*resource.Resource, error) { var res Resource getResource := `SELECT ` + resourceColumns + ` FROM resource WHERE full_name = $1 AND store = $2 AND @@ -61,10 +78,10 @@ func (r Repository) ReadByFullName(ctx context.Context, tnnt tenant.Tenant, stor &res.ProjectName, &res.NamespaceName, &res.Metadata, &res.Spec, &res.CreatedAt, &res.UpdatedAt) if err != nil { if errors.Is(err, pgx.ErrNoRows) { - return nil, errors.NotFound(resource.EntityResource, "no resource found for "+res.FullName) + return nil, errors.NotFound(resource.EntityResource, fmt.Sprintf("no resource: '%s' found for project:%s, namespace:%s ", fullName, tnnt.ProjectName(), tnnt.NamespaceName())) } - return nil, errors.Wrap(resource.EntityResource, "error reading the resource "+res.FullName, err) + return nil, errors.Wrap(resource.EntityResource, fmt.Sprintf("error reading resource: '%s' found for project:%s, namespace:%s ", fullName, tnnt.ProjectName(), tnnt.NamespaceName()), err) } return FromModelToResource(&res) @@ -144,5 +161,5 @@ func (r Repository) UpdateStatus(ctx context.Context, resources ...*resource.Res } } - return errors.MultiToError(multiErr) + return multiErr.ToErr() } diff --git a/internal/store/postgres/resource/repository_test.go b/internal/store/postgres/resource/repository_test.go index 8244b74f1b..92bb76c917 100644 --- a/internal/store/postgres/resource/repository_test.go +++ b/internal/store/postgres/resource/repository_test.go @@ -9,11 +9,11 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - serviceResource "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - repoResource "github.com/odpf/optimus/internal/store/postgres/resource" - tenantPostgres "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + serviceResource "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + repoResource "github.com/raystack/optimus/internal/store/postgres/resource" + tenantPostgres "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func TestPostgresResourceRepository(t *testing.T) { @@ -101,6 +101,46 @@ func TestPostgresResourceRepository(t *testing.T) { }) }) + t.Run("ChangeNamespace", func(t *testing.T) { + newNamespaceName := "n-optimus-2" + newTenant, err := tenant.NewTenant("t-optimus-1", newNamespaceName) + assert.Nil(t, err) + t.Run("returns error if resource does not exist", func(t *testing.T) { + pool := dbSetup() + repository := repoResource.NewRepository(pool) + + resourceToUpdate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + assert.NoError(t, err) + resourceToUpdate.UpdateURN("bigquery://project:dataset") + + actualError := repository.ChangeNamespace(ctx, resourceToUpdate, newTenant) + assert.ErrorContains(t, actualError, "not found for entity resource") + }) + + t.Run("updates resource and returns nil if no error is encountered", func(t *testing.T) { + pool := dbSetup() + repository := repoResource.NewRepository(pool) + + resourceToCreate, err := serviceResource.NewResource("project.dataset", kindDataset, store, tnnt, meta, spec) + assert.NoError(t, err) + resourceToCreate.UpdateURN("bigquery://project:dataset") + + err = repository.Create(ctx, resourceToCreate) + assert.NoError(t, err) + + resourceToUpdate := serviceResource.FromExisting(resourceToCreate, serviceResource.ReplaceStatus(serviceResource.StatusSuccess)) + actualError := repository.ChangeNamespace(ctx, resourceToUpdate, newTenant) + assert.NoError(t, actualError) + + storedResources, err := repository.GetResources(ctx, tnnt, store, []string{resourceToUpdate.FullName()}) + assert.NoError(t, err) + assert.Len(t, storedResources, 0) + storedNewResources, err := repository.GetResources(ctx, newTenant, store, []string{resourceToUpdate.FullName()}) + assert.NoError(t, err) + assert.Len(t, storedNewResources, 1) + }) + }) + t.Run("ReadByFullName", func(t *testing.T) { t.Run("returns nil and error if resource does not exist", func(t *testing.T) { pool := dbSetup() @@ -271,6 +311,7 @@ func dbSetup() *pgxpool.Pool { } namespaceRepo := tenantPostgres.NewNamespaceRepository(pool) + ns, _ := tenant.NewNamespace("n-optimus-1", proj.Name(), map[string]string{ "bucket": "gs://ns_bucket", @@ -280,5 +321,14 @@ func dbSetup() *pgxpool.Pool { panic(err) } + ns2, _ := tenant.NewNamespace("n-optimus-2", proj.Name(), + map[string]string{ + "bucket": "gs://ns_bucket", + }) + err = namespaceRepo.Save(ctx, ns2) + if err != nil { + panic(err) + } + return pool } diff --git a/internal/store/postgres/resource/resource.go b/internal/store/postgres/resource/resource.go index fbc0c296be..eac170c5ce 100644 --- a/internal/store/postgres/resource/resource.go +++ b/internal/store/postgres/resource/resource.go @@ -6,9 +6,9 @@ import ( "github.com/google/uuid" - "github.com/odpf/optimus/core/resource" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/resource" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) type Resource struct { diff --git a/internal/store/postgres/scheduler/job_operator_repository.go b/internal/store/postgres/scheduler/job_operator_repository.go index 40c6ec8091..ab301c6c07 100644 --- a/internal/store/postgres/scheduler/job_operator_repository.go +++ b/internal/store/postgres/scheduler/job_operator_repository.go @@ -9,8 +9,8 @@ import ( "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgxpool" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/internal/errors" ) const ( @@ -23,7 +23,6 @@ const ( ) type OperatorRunRepository struct { - // TODO: Add test db *pgxpool.Pool } diff --git a/internal/store/postgres/scheduler/job_operator_repository_test.go b/internal/store/postgres/scheduler/job_operator_repository_test.go index 9635f8033d..8b8787bc5b 100644 --- a/internal/store/postgres/scheduler/job_operator_repository_test.go +++ b/internal/store/postgres/scheduler/job_operator_repository_test.go @@ -9,10 +9,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - postgres "github.com/odpf/optimus/internal/store/postgres/scheduler" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + postgres "github.com/raystack/optimus/internal/store/postgres/scheduler" ) func TestPostgresJobOperatorRepository(t *testing.T) { diff --git a/internal/store/postgres/scheduler/job_repository.go b/internal/store/postgres/scheduler/job_repository.go index 2e98df6fd3..b16dce6052 100644 --- a/internal/store/postgres/scheduler/job_repository.go +++ b/internal/store/postgres/scheduler/job_repository.go @@ -13,12 +13,12 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/lib/pq" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/internal/utils" ) const ( @@ -37,14 +37,13 @@ type Schedule struct { StartDate time.Time EndDate *time.Time Interval string - DependsOnPast bool `json:"depends_on_past"` - CatchUp bool `json:"catch_up"` + DependsOnPast bool Retry *Retry } type Retry struct { Count int `json:"count"` Delay int32 `json:"delay"` - ExponentialBackoff bool `json:"exponential_backoff"` + ExponentialBackoff bool } type JobUpstreams struct { @@ -139,6 +138,56 @@ func fromStorageWindow(raw []byte, jobVersion int) (models.Window, error) { ) } +type Metadata struct { + Resource *MetadataResource + Scheduler map[string]string +} + +type MetadataResource struct { + Request *MetadataResourceConfig + Limit *MetadataResourceConfig +} + +type MetadataResourceConfig struct { + CPU string + Memory string +} + +func fromStorageMetadata(metadata json.RawMessage) (scheduler.RuntimeConfig, error) { + if metadata == nil { + return scheduler.RuntimeConfig{}, nil + } + var storeMetadata Metadata + if err := json.Unmarshal(metadata, &storeMetadata); err != nil { + return scheduler.RuntimeConfig{}, err + } + var runtimeConfig scheduler.RuntimeConfig + if storeMetadata.Resource != nil { + var resourceRequest *scheduler.ResourceConfig + if storeMetadata.Resource.Request != nil { + resourceRequest = &scheduler.ResourceConfig{ + CPU: storeMetadata.Resource.Request.CPU, + Memory: storeMetadata.Resource.Request.Memory, + } + } + var resourceLimit *scheduler.ResourceConfig + if storeMetadata.Resource.Limit != nil { + resourceLimit = &scheduler.ResourceConfig{ + CPU: storeMetadata.Resource.Limit.CPU, + Memory: storeMetadata.Resource.Limit.Memory, + } + } + runtimeConfig.Resource = &scheduler.Resource{ + Request: resourceRequest, + Limit: resourceLimit, + } + } + if storeMetadata.Scheduler != nil { + runtimeConfig.Scheduler = storeMetadata.Scheduler + } + return runtimeConfig, nil +} + func (j *Job) toJob() (*scheduler.Job, error) { t, err := tenant.NewTenant(j.ProjectName, j.NamespaceName) if err != nil { @@ -184,6 +233,11 @@ func (j *Job) toJobWithDetails() (*scheduler.JobWithDetails, error) { return nil, err } + runtimeConfig, err := fromStorageMetadata(j.Metadata) + if err != nil { + return nil, err + } + schedulerJobWithDetails := &scheduler.JobWithDetails{ Name: job.Name, Job: job, @@ -195,10 +249,10 @@ func (j *Job) toJobWithDetails() (*scheduler.JobWithDetails, error) { }, Schedule: &scheduler.Schedule{ DependsOnPast: storageSchedule.DependsOnPast, - CatchUp: storageSchedule.CatchUp, StartDate: storageSchedule.StartDate, Interval: storageSchedule.Interval, }, + RuntimeConfig: runtimeConfig, } if !(storageSchedule.EndDate == nil || storageSchedule.EndDate.IsZero()) { schedulerJobWithDetails.Schedule.EndDate = storageSchedule.EndDate @@ -344,6 +398,48 @@ func (j *JobRepository) GetAll(ctx context.Context, projectName tenant.ProjectNa jobsMap[jobName].Upstreams.UpstreamJobs = upstreamList } + return utils.MapToList[*scheduler.JobWithDetails](jobsMap), multiError.ToErr() +} + +func (j *JobRepository) GetJobs(ctx context.Context, projectName tenant.ProjectName, jobs []string) ([]*scheduler.JobWithDetails, error) { + getJobByNames := `SELECT ` + jobColumns + ` FROM job WHERE project_name = $1 AND name = any ($2) AND deleted_at IS NULL` + rows, err := j.db.Query(ctx, getJobByNames, projectName, jobs) + if err != nil { + return nil, errors.Wrap(job.EntityJob, "error while getting selected jobs", err) + } + defer rows.Close() + + jobsMap := map[string]*scheduler.JobWithDetails{} + var jobNameList []string + multiError := errors.NewMultiError("errorInGetJobs") + for rows.Next() { + spec, err := FromRow(rows) + if err != nil { + multiError.Append(errors.Wrap(scheduler.EntityJobRun, "error parsing job:"+spec.Name, err)) + continue + } + + job, err := spec.toJobWithDetails() + if err != nil { + multiError.Append(errors.Wrap(scheduler.EntityJobRun, "error parsing job:"+spec.Name, err)) + continue + } + jobNameList = append(jobNameList, job.GetName()) + jobsMap[job.GetName()] = job + } + for _, jobName := range jobs { + if _, ok := jobsMap[jobName]; !ok { + multiError.Append(errors.NotFound(scheduler.EntityJobRun, "unable to find job "+jobName)) + } + } + + jobUpstreamGroupedByName, err := j.getJobsUpstreams(ctx, projectName, jobNameList) + multiError.Append(err) + + for jobName, upstreamList := range jobUpstreamGroupedByName { + jobsMap[jobName].Upstreams.UpstreamJobs = upstreamList + } + return utils.MapToList[*scheduler.JobWithDetails](jobsMap), errors.MultiToError(multiError) } diff --git a/internal/store/postgres/scheduler/job_repository_test.go b/internal/store/postgres/scheduler/job_repository_test.go index 572833633b..e579427668 100644 --- a/internal/store/postgres/scheduler/job_repository_test.go +++ b/internal/store/postgres/scheduler/job_repository_test.go @@ -4,20 +4,21 @@ package scheduler_test import ( "context" + "reflect" "testing" "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/models" - jobRepo "github.com/odpf/optimus/internal/store/postgres/job" - postgres "github.com/odpf/optimus/internal/store/postgres/scheduler" - tenantPostgres "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/models" + jobRepo "github.com/raystack/optimus/internal/store/postgres/job" + postgres "github.com/raystack/optimus/internal/store/postgres/scheduler" + tenantPostgres "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) const ( @@ -108,6 +109,38 @@ func TestPostgresJobRepository(t *testing.T) { assert.Nil(t, jobObject) }) }) + t.Run("GetJobs", func(t *testing.T) { + t.Run("returns multiple job", func(t *testing.T) { + db := dbSetup() + jobs := addJobs(ctx, t, db) + jobProviderRepo := postgres.NewJobProviderRepository(db) + + jobObjects, err := jobProviderRepo.GetJobs(ctx, tnnt.ProjectName(), []string{jobAName, jobBName}) + assert.Nil(t, err) + assert.Equal(t, 2, len(jobObjects)) + for _, jobObject := range jobObjects { + compareEqualJobWithDetails(jobs[jobObject.Name.String()], jobObject) + } + }) + t.Run("returns not found error when jobs are not found", func(t *testing.T) { + db := dbSetup() + jobProviderRepo := postgres.NewJobProviderRepository(db) + jobObject, err := jobProviderRepo.GetJobs(ctx, tnnt.ProjectName(), []string{"some-other-job"}) + assert.ErrorContains(t, err, "unable to find job") + assert.Nil(t, jobObject) + }) + t.Run("returns the found job when some other job is not found", func(t *testing.T) { + db := dbSetup() + jobs := addJobs(ctx, t, db) + jobProviderRepo := postgres.NewJobProviderRepository(db) + jobObjects, err := jobProviderRepo.GetJobs(ctx, tnnt.ProjectName(), []string{jobAName, "some-other-job"}) + assert.ErrorContains(t, err, "unable to find job") + assert.Equal(t, 1, len(jobObjects)) + for _, jobObject := range jobObjects { + compareEqualJobWithDetails(jobs[jobObject.Name.String()], jobObject) + } + }) + }) } func dbSetup() *pgxpool.Pool { @@ -121,10 +154,10 @@ func addJobs(ctx context.Context, t *testing.T, pool *pgxpool.Pool) map[string]* jobVersion := 1 jobOwner := "dev_test" jobDescription := "sample job" - jobRetry := job.NewRetry(5, 0, false) + jobRetry := job.NewRetry(5, 0, true) startDate, err := job.ScheduleDateFrom("2022-10-01") assert.NoError(t, err) - jobSchedule, err := job.NewScheduleBuilder(startDate).WithRetry(jobRetry).Build() + jobSchedule, err := job.NewScheduleBuilder(startDate).WithRetry(jobRetry).WithDependsOnPast(true).Build() assert.NoError(t, err) jobWindow, err := models.NewWindow(jobVersion, "d", "24h", "24h") assert.NoError(t, err) @@ -236,5 +269,8 @@ func compareEqualJobWithDetails(j *job.Job, s *scheduler.JobWithDetails) bool { j.GetName() == s.Name.String() && j.Spec().Version() == s.JobMetadata.Version && j.Spec().Owner() == s.JobMetadata.Owner && - j.Spec().Schedule().Interval() == s.Schedule.Interval + j.Spec().Schedule().Interval() == s.Schedule.Interval && + j.Spec().Schedule().DependsOnPast() == s.Schedule.DependsOnPast && + j.Spec().Schedule().Retry().ExponentialBackoff() == s.Retry.ExponentialBackoff && + reflect.DeepEqual(j.Spec().Metadata().Scheduler(), s.RuntimeConfig.Scheduler) } diff --git a/internal/store/postgres/scheduler/job_run_repository.go b/internal/store/postgres/scheduler/job_run_repository.go index 62d2879c5a..e772f8541a 100644 --- a/internal/store/postgres/scheduler/job_run_repository.go +++ b/internal/store/postgres/scheduler/job_run_repository.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgxpool" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( @@ -61,14 +61,15 @@ func (j *jobRun) toJobRun() (*scheduler.JobRun, error) { } } return &scheduler.JobRun{ - ID: j.ID, - JobName: scheduler.JobName(j.JobName), - Tenant: t, - State: state, - StartTime: j.StartTime, - SLAAlert: j.SLAAlert, - EndTime: j.EndTime, - Monitoring: monitoring, + ID: j.ID, + JobName: scheduler.JobName(j.JobName), + Tenant: t, + State: state, + ScheduledAt: j.ScheduledAt, + StartTime: j.StartTime, + SLAAlert: j.SLAAlert, + EndTime: j.EndTime, + Monitoring: monitoring, }, nil } @@ -79,7 +80,10 @@ func (j *JobRunRepository) GetByID(ctx context.Context, id scheduler.JobRunID) ( Scan(&jr.ID, &jr.JobName, &jr.NamespaceName, &jr.ProjectName, &jr.ScheduledAt, &jr.StartTime, &jr.EndTime, &jr.Status, &jr.SLADefinition, &jr.SLAAlert, &jr.Monitoring) if err != nil { - return nil, err + if errors.Is(err, pgx.ErrNoRows) { + return nil, errors.NotFound(scheduler.EntityJobRun, "no record for job run id "+id.UUID().String()) + } + return nil, errors.Wrap(scheduler.EntityJobRun, "error while getting job run", err) } return jr.toJobRun() } @@ -99,6 +103,12 @@ func (j *JobRunRepository) GetByScheduledAt(ctx context.Context, t tenant.Tenant return jr.toJobRun() } +func (j *JobRunRepository) UpdateState(ctx context.Context, jobRunID uuid.UUID, status scheduler.State) error { + updateJobRun := "update job_run set status = $1, updated_at = NOW() where id = $2" + _, err := j.db.Exec(ctx, updateJobRun, status, jobRunID) + return errors.WrapIfErr(scheduler.EntityJobRun, "unable to update job run", err) +} + func (j *JobRunRepository) Update(ctx context.Context, jobRunID uuid.UUID, endTime time.Time, status scheduler.State) error { updateJobRun := "update job_run set status = $1, end_time = $2, updated_at = NOW() where id = $3" _, err := j.db.Exec(ctx, updateJobRun, status, endTime, jobRunID) @@ -130,7 +140,7 @@ func (j *JobRunRepository) UpdateMonitoring(ctx context.Context, jobRunID uuid.U } func (j *JobRunRepository) Create(ctx context.Context, t tenant.Tenant, jobName scheduler.JobName, scheduledAt time.Time, slaDefinitionInSec int64) error { - insertJobRun := `INSERT INTO job_run (` + columnsToStore + `, created_at, updated_at) values ($1, $2, $3, $4, NOW(), TIMESTAMP '3000-01-01 00:00:00', $5, $6, FALSE, NOW(), NOW())` + insertJobRun := `INSERT INTO job_run (` + columnsToStore + `, created_at, updated_at) values ($1, $2, $3, $4, NOW(), TIMESTAMP '3000-01-01 00:00:00', $5, $6, FALSE, NOW(), NOW()) ON CONFLICT DO NOTHING` _, err := j.db.Exec(ctx, insertJobRun, jobName, t.NamespaceName(), t.ProjectName(), scheduledAt, scheduler.StateRunning, slaDefinitionInSec) return errors.WrapIfErr(scheduler.EntityJobRun, "unable to create job run", err) } diff --git a/internal/store/postgres/scheduler/job_run_repository_test.go b/internal/store/postgres/scheduler/job_run_repository_test.go index e9d5621c7c..c21b119247 100644 --- a/internal/store/postgres/scheduler/job_run_repository_test.go +++ b/internal/store/postgres/scheduler/job_run_repository_test.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - postgres "github.com/odpf/optimus/internal/store/postgres/scheduler" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + postgres "github.com/raystack/optimus/internal/store/postgres/scheduler" ) func TestPostgresJobRunRepository(t *testing.T) { diff --git a/internal/store/postgres/scheduler/replay_repository.go b/internal/store/postgres/scheduler/replay_repository.go index 764e7fba5e..7ca3ec1d8b 100644 --- a/internal/store/postgres/scheduler/replay_repository.go +++ b/internal/store/postgres/scheduler/replay_repository.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "golang.org/x/net/context" - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) const ( @@ -205,6 +205,71 @@ func (r ReplayRepository) GetReplayRequestsByStatus(ctx context.Context, statusL return replayReqs, nil } +func (r ReplayRepository) GetReplaysByProject(ctx context.Context, projectName tenant.ProjectName, dayLimits int) ([]*scheduler.Replay, error) { + getReplayRequest := `SELECT ` + replayColumns + ` FROM replay_request WHERE project_name=$1 LIMIT $2` + rows, err := r.db.Query(ctx, getReplayRequest, projectName, dayLimits) + if err != nil { + return nil, errors.Wrap(job.EntityJob, "unable to get replay list", err) + } + defer rows.Close() + + var replayReqs []*scheduler.Replay + for rows.Next() { + var rr replayRequest + if err := rows.Scan(&rr.ID, &rr.JobName, &rr.NamespaceName, &rr.ProjectName, &rr.StartTime, &rr.EndTime, &rr.Description, &rr.Parallel, &rr.JobConfig, + &rr.Status, &rr.Message, &rr.CreatedAt); err != nil { + return nil, errors.Wrap(scheduler.EntityJobRun, "unable to get the stored replay", err) + } + schedulerReplayReq, err := rr.toSchedulerReplayRequest() + if err != nil { + return nil, err + } + replayReqs = append(replayReqs, schedulerReplayReq) + } + return replayReqs, nil +} + +func (r ReplayRepository) GetReplayByID(ctx context.Context, replayID uuid.UUID) (*scheduler.ReplayWithRun, error) { + rr, err := r.getReplayRequestByID(ctx, replayID) + if err != nil { + if !errors.Is(err, pgx.ErrNoRows) { + return nil, err + } + return nil, errors.NotFound(job.EntityJob, fmt.Sprintf("no replay found for replay ID %s", replayID.String())) + } + + runs, err := r.getReplayRuns(ctx, replayID) + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + return nil, err + } + + replayTenant, err := tenant.NewTenant(rr.ProjectName, rr.NamespaceName) + if err != nil { + return nil, err + } + replayConfig := scheduler.ReplayConfig{ + StartTime: rr.StartTime, + EndTime: rr.EndTime, + JobConfig: rr.JobConfig, + Parallel: rr.Parallel, + Description: rr.Description, + } + replay := scheduler.NewReplay(rr.ID, scheduler.JobName(rr.JobName), replayTenant, &replayConfig, scheduler.ReplayState(rr.Status), rr.CreatedAt) + replayRuns := make([]*scheduler.JobRunStatus, len(runs)) + for i := range runs { + replayRun := &scheduler.JobRunStatus{ + ScheduledAt: runs[i].ScheduledTime, + State: scheduler.State(runs[i].RunStatus), + } + replayRuns[i] = replayRun + } + + return &scheduler.ReplayWithRun{ + Replay: replay, + Runs: replayRuns, + }, nil +} + func toReplay(replayRuns []*replayRun) (*scheduler.ReplayWithRun, error) { var storedReplay *scheduler.ReplayWithRun for _, run := range replayRuns { @@ -323,6 +388,35 @@ func (ReplayRepository) getReplayRequest(ctx context.Context, tx pgx.Tx, replay return rr, nil } +func (r ReplayRepository) getReplayRequestByID(ctx context.Context, replayID uuid.UUID) (replayRequest, error) { + var rr replayRequest + getReplayRequest := `SELECT ` + replayColumns + ` FROM replay_request WHERE id=$1` + err := r.db.QueryRow(ctx, getReplayRequest, replayID).Scan(&rr.ID, &rr.JobName, &rr.NamespaceName, &rr.ProjectName, &rr.StartTime, &rr.EndTime, &rr.Description, &rr.Parallel, &rr.JobConfig, + &rr.Status, &rr.Message, &rr.CreatedAt) + if err != nil { + return rr, err + } + return rr, nil +} + +func (r ReplayRepository) getReplayRuns(ctx context.Context, replayID uuid.UUID) ([]replayRun, error) { + var runs []replayRun + getRuns := `SELECT ` + replayRunColumns + ` FROM replay_run WHERE replay_id=$1` + rows, err := r.db.Query(ctx, getRuns, replayID) + if err != nil { + return nil, err + } + for rows.Next() { + var run replayRun + err = rows.Scan(&run.ID, &run.ScheduledTime, &run.RunStatus) + if err != nil { + return nil, err + } + runs = append(runs, run) + } + return runs, nil +} + func (ReplayRepository) getExecutableReplayRuns(ctx context.Context, tx pgx.Tx) ([]*replayRun, error) { getReplayRequest := ` WITH request AS ( diff --git a/internal/store/postgres/scheduler/replay_repository_test.go b/internal/store/postgres/scheduler/replay_repository_test.go index d65ccc1fe5..f9c897f0eb 100644 --- a/internal/store/postgres/scheduler/replay_repository_test.go +++ b/internal/store/postgres/scheduler/replay_repository_test.go @@ -7,11 +7,13 @@ import ( "testing" "time" + "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/scheduler" - "github.com/odpf/optimus/core/tenant" - postgres "github.com/odpf/optimus/internal/store/postgres/scheduler" + "github.com/raystack/optimus/core/scheduler" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" + postgres "github.com/raystack/optimus/internal/store/postgres/scheduler" ) func TestPostgresSchedulerRepository(t *testing.T) { @@ -140,6 +142,47 @@ func TestPostgresSchedulerRepository(t *testing.T) { }) }) + t.Run("GetReplaysByProject", func(t *testing.T) { + t.Run("return replay list for corresponding project name", func(t *testing.T) { + db := dbSetup() + replayRepo := postgres.NewReplayRepository(db) + tnnt, _ := tenant.NewTenant("test-project1", "ns-1") + tnntOther, _ := tenant.NewTenant("test-project2", "ns-1") + + replayConfig := scheduler.NewReplayConfig(startTime, endTime, true, replayJobConfig, description) + replayReq1 := scheduler.NewReplayRequest(jobAName, tnnt, replayConfig, scheduler.ReplayStateInProgress) + replayReq2 := scheduler.NewReplayRequest(jobBName, tnnt, replayConfig, scheduler.ReplayStateCreated) + replayReq3 := scheduler.NewReplayRequest("sample-job-C", tnntOther, replayConfig, scheduler.ReplayStateFailed) + + replayID1, err := replayRepo.RegisterReplay(ctx, replayReq1, jobRunsAllPending) + assert.Nil(t, err) + assert.NotNil(t, replayID1) + + replayID2, err := replayRepo.RegisterReplay(ctx, replayReq2, jobRunsAllPending) + assert.Nil(t, err) + assert.NotNil(t, replayID2) + + replayID3, err := replayRepo.RegisterReplay(ctx, replayReq3, jobRunsAllPending) + assert.Nil(t, err) + assert.NotNil(t, replayID3) + + replayReqs, err := replayRepo.GetReplaysByProject(ctx, tnnt.ProjectName(), 3) + assert.Nil(t, err) + assert.Len(t, replayReqs, 2) + + replayReqs, err = replayRepo.GetReplaysByProject(ctx, tnntOther.ProjectName(), 3) + assert.Nil(t, err) + assert.Len(t, replayReqs, 1) + }) + t.Run("return empty list when replay is not existed on given project", func(t *testing.T) { + db := dbSetup() + replayRepo := postgres.NewReplayRepository(db) + replayReqs, err := replayRepo.GetReplaysByProject(ctx, tnnt.ProjectName(), 3) + assert.Nil(t, err) + assert.Len(t, replayReqs, 0) + }) + }) + t.Run("GetReplayJobConfig", func(t *testing.T) { t.Run("return replay task config when scheduledAt is provided", func(t *testing.T) { db := dbSetup() @@ -178,4 +221,51 @@ func TestPostgresSchedulerRepository(t *testing.T) { assert.Equal(t, map[string]string{}, actualReplayJobConfig) }) }) + + t.Run("GetReplayByID", func(t *testing.T) { + t.Run("return no replay with runs if not exist", func(t *testing.T) { + db := dbSetup() + replayRepo := postgres.NewReplayRepository(db) + + replayID := uuid.New() + replayWithRuns, err := replayRepo.GetReplayByID(ctx, replayID) + assert.NotNil(t, err) + assert.True(t, errors.IsErrorType(err, errors.ErrNotFound)) + assert.Empty(t, replayWithRuns) + }) + + t.Run("return replay with no runs if runs is empty", func(t *testing.T) { + db := dbSetup() + replayRepo := postgres.NewReplayRepository(db) + startTime, _ := time.Parse(scheduler.ISODateFormat, "2022-01-01T15:04:05Z") + endTime, _ := time.Parse(scheduler.ISODateFormat, "2022-01-03T15:04:05Z") + + replayConfig := scheduler.NewReplayConfig(startTime, endTime, true, map[string]string{}, description) + replayReq := scheduler.NewReplayRequest(jobBName, tnnt, replayConfig, scheduler.ReplayStateCreated) + replayID, err := replayRepo.RegisterReplay(ctx, replayReq, []*scheduler.JobRunStatus{}) + assert.Nil(t, err) + + replayWithRuns, err := replayRepo.GetReplayByID(ctx, replayID) + assert.Nil(t, err) + assert.NotEmpty(t, replayWithRuns) + assert.Empty(t, replayWithRuns.Runs) + }) + t.Run("return replay with runs given replay ID", func(t *testing.T) { + db := dbSetup() + replayRepo := postgres.NewReplayRepository(db) + startTime, _ := time.Parse(scheduler.ISODateFormat, "2022-01-01T15:04:05Z") + endTime, _ := time.Parse(scheduler.ISODateFormat, "2022-01-03T15:04:05Z") + + replayConfig := scheduler.NewReplayConfig(startTime, endTime, true, map[string]string{}, description) + replayReq := scheduler.NewReplayRequest(jobBName, tnnt, replayConfig, scheduler.ReplayStateCreated) + replayID, err := replayRepo.RegisterReplay(ctx, replayReq, jobRunsAllPending) + assert.Nil(t, err) + + replayWithRuns, err := replayRepo.GetReplayByID(ctx, replayID) + assert.Nil(t, err) + assert.NotEmpty(t, replayWithRuns) + assert.NotEmpty(t, replayWithRuns.Runs) + assert.Len(t, replayWithRuns.Runs, len(jobRunsAllPending)) + }) + }) } diff --git a/internal/store/postgres/tenant/namespace_repository.go b/internal/store/postgres/tenant/namespace_repository.go index a66ee04254..2fb58fbdbb 100644 --- a/internal/store/postgres/tenant/namespace_repository.go +++ b/internal/store/postgres/tenant/namespace_repository.go @@ -8,8 +8,8 @@ import ( "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgxpool" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) type NamespaceRepository struct { diff --git a/internal/store/postgres/tenant/namespace_repository_test.go b/internal/store/postgres/tenant/namespace_repository_test.go index b27f50dc21..8a1e3f75b7 100644 --- a/internal/store/postgres/tenant/namespace_repository_test.go +++ b/internal/store/postgres/tenant/namespace_repository_test.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/tenant" - postgres "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + "github.com/raystack/optimus/core/tenant" + postgres "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func TestPostgresNamespaceRepository(t *testing.T) { diff --git a/internal/store/postgres/tenant/project_repository.go b/internal/store/postgres/tenant/project_repository.go index 29aad58673..9f4203e64c 100644 --- a/internal/store/postgres/tenant/project_repository.go +++ b/internal/store/postgres/tenant/project_repository.go @@ -8,8 +8,8 @@ import ( "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgxpool" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/errors" ) type ProjectRepository struct { diff --git a/internal/store/postgres/tenant/project_repository_test.go b/internal/store/postgres/tenant/project_repository_test.go index c2804eff01..eef1b3d520 100644 --- a/internal/store/postgres/tenant/project_repository_test.go +++ b/internal/store/postgres/tenant/project_repository_test.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/tenant" - postgres "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + "github.com/raystack/optimus/core/tenant" + postgres "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func TestPostgresProjectRepository(t *testing.T) { diff --git a/internal/store/postgres/tenant/secret_repository.go b/internal/store/postgres/tenant/secret_repository.go index 7692ba2cdd..00573b0cd0 100644 --- a/internal/store/postgres/tenant/secret_repository.go +++ b/internal/store/postgres/tenant/secret_repository.go @@ -12,9 +12,9 @@ import ( "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5/pgxpool" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/core/tenant/dto" - "github.com/odpf/optimus/internal/errors" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/core/tenant/dto" + "github.com/raystack/optimus/internal/errors" ) type SecretRepository struct { diff --git a/internal/store/postgres/tenant/secret_repository_test.go b/internal/store/postgres/tenant/secret_repository_test.go index 34706c00e9..4ac4f68c8d 100644 --- a/internal/store/postgres/tenant/secret_repository_test.go +++ b/internal/store/postgres/tenant/secret_repository_test.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/core/tenant" - postgres "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + "github.com/raystack/optimus/core/tenant" + postgres "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func TestPostgresSecretRepository(t *testing.T) { diff --git a/internal/telemetry/dashboards/Readme.md b/internal/telemetry/dashboards/Readme.md new file mode 100644 index 0000000000..92e9b9cc0e --- /dev/null +++ b/internal/telemetry/dashboards/Readme.md @@ -0,0 +1,3 @@ +To create a limited access role and user create a new role via ./scripts/add_monitoring_role.sql + +NOTE: these are not migration scripts, they are supposed to be used manualy if need be \ No newline at end of file diff --git a/internal/telemetry/dashboards/grafana8.json b/internal/telemetry/dashboards/grafana8.json deleted file mode 100644 index 872a565f62..0000000000 --- a/internal/telemetry/dashboards/grafana8.json +++ /dev/null @@ -1,1285 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 326, - "iteration": 1663310204681, - "links": [], - "panels": [ - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 15, - "panels": [], - "title": "Overview", - "type": "row" - }, - { - "datasource": "Optimus-Server-DB", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "light-purple", - "mode": "fixed" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 6, - "x": 2, - "y": 1 - }, - "id": 19, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^count$/", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "8.0.7", - "targets": [ - { - "format": "table", - "group": [], - "hide": false, - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n count(*)\nFROM\n project\n", - "refId": "A", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "column" - } - ] - ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Projects", - "transparent": true, - "type": "stat" - }, - { - "datasource": "Optimus-Server-DB", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "orange", - "mode": "fixed" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 6, - "x": 9, - "y": 1 - }, - "id": 21, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^count$/", - "values": false - }, - "text": {}, - "textMode": "value" - }, - "pluginVersion": "8.0.7", - "targets": [ - { - "format": "table", - "group": [], - "hide": false, - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n count(*)\nFROM\n namespace", - "refId": "A", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "column" - } - ] - ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Namespaces", - "transparent": true, - "type": "stat" - }, - { - "datasource": "Optimus-Server-DB", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "blue", - "mode": "fixed" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 6, - "x": 16, - "y": 1 - }, - "id": 23, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^count$/", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "8.0.7", - "targets": [ - { - "datasource": "Optimus-Server-DB", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n count(*)\nFROM\n job\nwhere deleted_at is null", - "refId": "A", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "column" - } - ] - ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Jobs", - "transparent": true, - "type": "stat" - }, - { - "datasource": "Optimus-Server-DB", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "orange", - "mode": "fixed" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 6 - }, - "id": 11, - "interval": "30m", - "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 1, - "orientation": "vertical", - "reduceOptions": { - "calcs": [], - "fields": "/^count$/", - "values": true - }, - "showUnfilled": true, - "text": {} - }, - "pluginVersion": "8.0.7", - "targets": [ - { - "datasource": "Optimus-Server-DB", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n p.name,\n count(*)\nFROM\n namespace n\nJOIN project p ON p.id = n.project_id\nGROUP BY p.name\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "column" - } - ] - ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Namespaces", - "type": "bargauge" - }, - { - "datasource": "Optimus-Server-DB", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "light-red", - "mode": "fixed" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 6 - }, - "id": 9, - "interval": "30m", - "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 1, - "orientation": "vertical", - "reduceOptions": { - "calcs": [], - "fields": "/^count$/", - "values": true - }, - "showUnfilled": true, - "text": {} - }, - "pluginVersion": "8.0.7", - "targets": [ - { - "datasource": "Optimus-Server-DB", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n p.name,\n count(*)\nFROM\n secret s\nJOIN project p ON p.id = s.project_id\nGROUP BY p.name\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "column" - } - ] - ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Secrets", - "type": "bargauge" - }, - { - "datasource": "Optimus-Server-DB", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "displayMode": "auto" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "job_count" - }, - "properties": [ - { - "id": "custom.width", - "value": 236 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "depencecy_count" - }, - "properties": [ - { - "id": "custom.width", - "value": 199 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "dependency_count" - }, - "properties": [ - { - "id": "custom.width", - "value": 285 - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 14 - }, - "id": 27, - "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "8.0.7", - "targets": [ - { - "datasource": "Optimus-Server-DB", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT cardinality as dependency_count, count(*) as job_count FROM\n(\n SELECT name, cardinality(ARRAY(SELECT jsonb_object_keys(dependencies)))\n FROM job\n WHERE deleted_at is NULL\n) as k\nGROUP by cardinality\norder by job_count desc", - "refId": "A", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "column" - } - ] - ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Number jobs by dependency count", - "type": "table" - }, - { - "datasource": "Optimus-Server-DB", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "displayMode": "auto" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "name" - }, - "properties": [ - { - "id": "custom.width", - "value": 183 - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 6, - "x": 9, - "y": 14 - }, - "id": 29, - "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "8.0.7", - "targets": [ - { - "datasource": "Optimus-Server-DB", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n\tn.name,\n\tcount(*)\nFROM\n\tjob j\nJOIN namespace n ON n.id = j.namespace_id\nwhere j.project_id = '$project'\nAND j.deleted_at is NULL\ngroup by n.name", - "refId": "A", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "column" - } - ] - ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Jobs / Namespace in $project", - "type": "table" - }, - { - "datasource": "Optimus-Server-DB", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "displayMode": "auto" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 14 - }, - "id": 25, - "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true - }, - "pluginVersion": "8.0.7", - "targets": [ - { - "datasource": "Optimus-Server-DB", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT \n task_name as task_type,\n count(*) as jobs_count \nFROM \n job\nWHERE deleted_at is NULL\ngroup by task_name\norder by jobs_count desc\n", - "refId": "A", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "column" - } - ] - ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "jobs count per task type", - "type": "table" - }, - { - "collapsed": false, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 22 - }, - "id": 13, - "panels": [], - "title": "SLA Dashboard", - "type": "row" - }, - { - "datasource": "Optimus-Server-DB", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "displayMode": "auto" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 24, - "x": 0, - "y": 23 - }, - "id": 4, - "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": false, - "displayName": "total_run_in_interval" - } - ] - }, - "pluginVersion": "8.0.7", - "targets": [ - { - "datasource": "Optimus-Server-DB", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "select \n\tfiltered.job_id, job.name,\n\tROUND((filtered.count*100)/total.count::decimal, 2) as miss_percentage ,\n\tfiltered.max_delay , filtered.avg_delay, total.count as total_runs_in_interval\nfrom (\n\tselect \n\t\tcount(*) as count , \n\t\tjob_id , \n\t\tmax(duration) as max_delay, \n\t\tavg(duration) as avg_delay \n\tfrom job_run \n\twhere $__timeFilter(scheduled_at)\n\t\tAND EXTRACT(EPOCH from least(end_time , now())- start_time) > sla_definition \t\t\n AND namespace_id = '$namespace' \n AND project_id = '$project'\n\tgroup by job_id\n) as filtered \ninner join (\n\tselect count(*) , job_id \n\tfrom job_run \n\twhere $__timeFilter(scheduled_at) \n AND namespace_id = '$namespace' \n AND project_id = '$project'\n\tgroup by job_id\n) as total on total.job_id = filtered.job_id\ninner join job on job.id = filtered.job_id", - "refId": "A", - "select": [ - [ - { - "params": [ - "duration" - ], - "type": "column" - } - ] - ], - "table": "job_run", - "timeColumn": "scheduled_at", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "uuid", - "name": "", - "params": [ - "namespace_id", - "=", - "'$namespace'" - ], - "type": "expression" - }, - { - "datatype": "uuid", - "name": "", - "params": [ - "project_id", - "=", - "'$project'" - ], - "type": "expression" - } - ] - } - ], - "title": "SLA miss summary", - "type": "table" - }, - { - "datasource": "Optimus-Server-DB", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "displayMode": "auto" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 24, - "x": 0, - "y": 29 - }, - "id": 5, - "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": false, - "displayName": "total_run_in_interval" - } - ] - }, - "pluginVersion": "8.0.7", - "targets": [ - { - "datasource": "Optimus-Server-DB", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "select job.name, \n\t\tlast_job_runs.scheduled_at,\n\t\tlast_job_runs.start_time , \n\t\tlast_job_runs.end_time, \n\t\tEXTRACT(EPOCH from least(last_job_runs.end_time , now())- last_job_runs.start_time) as total_job_run_time, \n\t\tlast_job_runs.sla_definition \nfrom \n\t(SELECT DISTINCT ON (job_id,scheduled_at ) * FROM job_run where $__timeFilter(scheduled_at) and namespace_id = '$namespace' \n AND project_id = '$project' ORDER BY job_id,scheduled_at, attempt DESC ) as last_job_runs\ninner join job \n\ton last_job_runs.job_id = job.id\n\twhere EXTRACT(EPOCH from least(last_job_runs.end_time , now())- last_job_runs.start_time) > last_job_runs.sla_definition \n", - "refId": "A", - "select": [ - [ - { - "params": [ - "duration" - ], - "type": "column" - } - ] - ], - "table": "job_run", - "timeColumn": "scheduled_at", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "uuid", - "name": "", - "params": [ - "namespace_id", - "=", - "'$namespace'" - ], - "type": "expression" - }, - { - "datatype": "uuid", - "name": "", - "params": [ - "project_id", - "=", - "'$project'" - ], - "type": "expression" - } - ] - } - ], - "title": "SLA missed last runs ", - "type": "table" - }, - { - "datasource": "Optimus-Server-DB", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMin": 0, - "fillOpacity": 80, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineWidth": 1 - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 15, - "w": 23, - "x": 0, - "y": 35 - }, - "id": 7, - "options": { - "barRadius": 0, - "barWidth": 0.97, - "groupWidth": 0.7, - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "orientation": "horizontal", - "showValue": "always", - "stacking": "none", - "text": {}, - "tooltip": { - "mode": "single", - "sort": "none" - }, - "xTickLabelRotation": 0, - "xTickLabelSpacing": 0 - }, - "targets": [ - { - "datasource": "Optimus-Server-DB", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT concat(job.name,'_',job_run.scheduled_at) as job_run_schedule, count(*) as reruns FROM job_run \ninner join job on job_run.job_id = job.id\nwhere\n $__timeFilter(scheduled_at) \n AND job_run.namespace_id = '$namespace' \n AND job_run.project_id = '$project'\ngroup by (job.name, job_run.job_id, job_run.scheduled_at ) \n", - "refId": "A", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "column" - } - ] - ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "job rerun counts ", - "type": "barchart" - }, - { - "datasource": "Optimus-Server-DB", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMin": 0, - "fillOpacity": 85, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineWidth": 0 - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 14, - "w": 24, - "x": 0, - "y": 50 - }, - "id": 2, - "options": { - "barRadius": 0, - "barWidth": 0.98, - "groupWidth": 0.7, - "legend": { - "calcs": [ - "last", - "max", - "min", - "mean" - ], - "displayMode": "table", - "placement": "bottom" - }, - "orientation": "auto", - "showValue": "always", - "stacking": "normal", - "text": {}, - "tooltip": { - "mode": "multi", - "sort": "none" - }, - "xTickLabelRotation": 15, - "xTickLabelSpacing": 0 - }, - "pluginVersion": "8.5.5", - "targets": [ - { - "datasource": "Optimus-Server-DB", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n timezone('utc',job_run.scheduled_at) as time,\n job_run.attempt as attempt, \n concat(timezone('utc',job_run.scheduled_at), '_',job_run.attempt ),\n sensor_run.duration as sensor_duration,\n task_run.duration as task_duration,\n hook_run.duration as hook_duration\nFROM job_run\nleft join sensor_run on sensor_run.job_run_id = job_run.job_run_id and sensor_run.job_run_attempt = job_run.attempt\nleft join task_run on task_run.job_run_id = job_run.job_run_id and task_run.job_run_attempt = job_run.attempt\nleft join hook_run on hook_run.job_run_id = job_run.job_run_id and hook_run.job_run_attempt = job_run.attempt\nWHERE\n $__timeFilter(scheduled_at) \n AND job_id = '$job_id' \n AND namespace_id = '$namespace' \n AND project_id = '$project'\n\nORDER BY scheduled_at , attempt", - "refId": "A", - "select": [ - [ - { - "params": [ - "duration" - ], - "type": "column" - } - ] - ], - "table": "job_run", - "timeColumn": "scheduled_at", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "uuid", - "name": "", - "params": [ - "job_id", - "=", - "'$job_id'" - ], - "type": "expression" - } - ] - } - ], - "title": "job durations", - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "attempt": true - }, - "indexByName": {}, - "renameByName": {} - } - } - ], - "type": "barchart" - } - ], - "refresh": "", - "schemaVersion": 30, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": { - "selected": false, - "text": "dojo", - "value": "11595945-8f21-471f-a4c1-0b1cf1fa0352" - }, - "datasource": "Optimus-Server-DB", - "definition": "SELECT name AS __text, id AS __value FROM project", - "description": "optimus project name ", - "error": null, - "hide": 0, - "includeAll": false, - "label": null, - "multi": false, - "name": "project", - "options": [], - "query": "SELECT name AS __text, id AS __value FROM project", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - }, - { - "allValue": null, - "current": { - "selected": false, - "text": "playground", - "value": "25914c11-4d80-4a49-8387-fede3140737d" - }, - "datasource": "Optimus-Server-DB", - "definition": "select id as __value, name as __text from namespace where project_id = '$project'", - "description": null, - "error": null, - "hide": 0, - "includeAll": false, - "label": null, - "multi": false, - "name": "namespace", - "options": [], - "query": "select id as __value, name as __text from namespace where project_id = '$project'", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - }, - { - "allValue": null, - "current": { - "selected": false, - "text": "optimus.data_logs", - "value": "7a67d70c-3e33-4c9e-aab7-d5abcb923aa8" - }, - "datasource": "Optimus-Server-DB", - "definition": "select job.name as __text , job_run.job_id as __value \nfrom job_run \ninner join job on job_run.job_id = job.id\nWHERE $__timeFilter(scheduled_at)", - "description": "optimus job id ", - "error": null, - "hide": 0, - "includeAll": false, - "label": null, - "multi": false, - "name": "job_id", - "options": [], - "query": "select job.name as __text , job_run.job_id as __value \nfrom job_run \ninner join job on job_run.job_id = job.id\nWHERE $__timeFilter(scheduled_at)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - } - ] - }, - "time": { - "from": "now-30d", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "", - "title": "Optimus Dashboard", - "uid": "fD3G8mn4z", - "version": 9 -} \ No newline at end of file diff --git a/internal/telemetry/dashboards/scripts/add_monitoring_role.down.sql b/internal/telemetry/dashboards/scripts/add_monitoring_role.down.sql new file mode 100644 index 0000000000..301591f0bc --- /dev/null +++ b/internal/telemetry/dashboards/scripts/add_monitoring_role.down.sql @@ -0,0 +1,5 @@ +DROP OWNED BY MONITORING; + +DROP ROLE IF EXISTS MONITORING; + +DROP USER IF EXISTS MONITORING_USER; \ No newline at end of file diff --git a/internal/telemetry/dashboards/scripts/add_monitoring_role.up.sql b/internal/telemetry/dashboards/scripts/add_monitoring_role.up.sql new file mode 100644 index 0000000000..69a02cb407 --- /dev/null +++ b/internal/telemetry/dashboards/scripts/add_monitoring_role.up.sql @@ -0,0 +1,9 @@ +CREATE ROLE MONITORING; + +GRANT CONNECT ON DATABASE OPTIMUS TO MONITORING; + +GRANT SELECT ON JOB_RUN , SENSOR_RUN , TASK_RUN , HOOK_RUN , JOB_UPSTREAM, JOB , RESOURCE, PROJECT, NAMESPACE TO MONITORING; + +CREATE USER MONITORING_USER WITH PASSWORD '*********'; + +GRANT MONITORING TO MONITORING_USER; \ No newline at end of file diff --git a/internal/telemetry/prometheus.go b/internal/telemetry/prometheus.go index dcf7b66a32..949b8da7ef 100644 --- a/internal/telemetry/prometheus.go +++ b/internal/telemetry/prometheus.go @@ -2,14 +2,18 @@ package telemetry import ( "sort" + "sync" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) var ( - counterMetricMap = map[string]prometheus.Counter{} + counterMetricMap = map[string]prometheus.Counter{} + counterMetricMutex = sync.Mutex{} + gaugeMetricMap = map[string]prometheus.Gauge{} + gaugeMetricMutex = sync.Mutex{} ) func getKey(metric string, labels map[string]string) string { @@ -27,16 +31,28 @@ func getKey(metric string, labels map[string]string) string { func NewCounter(metric string, labels map[string]string) prometheus.Counter { metricKey := getKey(metric, labels) - if _, ok := counterMetricMap[metricKey]; !ok { - counterMetricMap[metricKey] = promauto.NewCounter(prometheus.CounterOpts{Name: metric, ConstLabels: labels}) + + counterMetricMutex.Lock() + defer counterMetricMutex.Unlock() + + if existingMetric, ok := counterMetricMap[metricKey]; ok { + return existingMetric } - return counterMetricMap[metricKey] + newMetric := promauto.NewCounter(prometheus.CounterOpts{Name: metric, ConstLabels: labels}) + counterMetricMap[metricKey] = newMetric + return newMetric } func NewGauge(metric string, labels map[string]string) prometheus.Gauge { metricKey := getKey(metric, labels) - if _, ok := gaugeMetricMap[metricKey]; !ok { - gaugeMetricMap[metricKey] = promauto.NewGauge(prometheus.GaugeOpts{Name: metric, ConstLabels: labels}) + + gaugeMetricMutex.Lock() + defer gaugeMetricMutex.Unlock() + + if existingMetric, ok := gaugeMetricMap[metricKey]; ok { + return existingMetric } - return gaugeMetricMap[metricKey] + newMetric := promauto.NewGauge(prometheus.GaugeOpts{Name: metric, ConstLabels: labels}) + gaugeMetricMap[metricKey] = newMetric + return newMetric } diff --git a/internal/telemetry/telemetry.go b/internal/telemetry/telemetry.go index 5669fc4eb0..ba7f4451f3 100644 --- a/internal/telemetry/telemetry.go +++ b/internal/telemetry/telemetry.go @@ -7,10 +7,10 @@ import ( "net/http/pprof" "time" - "github.com/odpf/salt/log" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/raystack/salt/log" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/exporters/jaeger" @@ -19,7 +19,7 @@ import ( tracesdk "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" - "github.com/odpf/optimus/config" + "github.com/raystack/optimus/config" ) const MetricWaitInterval = time.Second * 2 diff --git a/internal/utils/contains_test.go b/internal/utils/contains_test.go index b14fd58cc1..77a3eb7b3a 100644 --- a/internal/utils/contains_test.go +++ b/internal/utils/contains_test.go @@ -3,7 +3,7 @@ package utils_test import ( "testing" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/utils" ) func TestContainsString(t *testing.T) { diff --git a/internal/utils/convert_test.go b/internal/utils/convert_test.go index fd31b6359f..326a64cf3f 100644 --- a/internal/utils/convert_test.go +++ b/internal/utils/convert_test.go @@ -6,7 +6,7 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/utils" ) func TestConvert(t *testing.T) { diff --git a/internal/utils/file_test.go b/internal/utils/file_test.go index a35c527754..dd1312691a 100644 --- a/internal/utils/file_test.go +++ b/internal/utils/file_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/utils" ) func TestIsPathOccupied(t *testing.T) { diff --git a/internal/utils/map_test.go b/internal/utils/map_test.go index 40e4fa00e9..636b37f905 100644 --- a/internal/utils/map_test.go +++ b/internal/utils/map_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/structpb" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/utils" ) func TestMapHelper(t *testing.T) { diff --git a/internal/utils/proto_test.go b/internal/utils/proto_test.go index 4542630a1a..d0a473bba2 100644 --- a/internal/utils/proto_test.go +++ b/internal/utils/proto_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/utils" ) func TestProtoHelper(t *testing.T) { diff --git a/internal/utils/validator_test.go b/internal/utils/validator_test.go index 1d9bb780d4..3d122bc7fb 100644 --- a/internal/utils/validator_test.go +++ b/internal/utils/validator_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/utils" + "github.com/raystack/optimus/internal/utils" ) func TestValidator(t *testing.T) { diff --git a/internal/writer/check_job_specification_response_writer.go b/internal/writer/check_job_specification_response_writer.go index 0e2718ddc2..b6e7df36ac 100644 --- a/internal/writer/check_job_specification_response_writer.go +++ b/internal/writer/check_job_specification_response_writer.go @@ -1,7 +1,7 @@ package writer import ( - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type checkJobSpecificationResponseWriter struct { diff --git a/internal/writer/deploy_resource_specification_response_writer.go b/internal/writer/deploy_resource_specification_response_writer.go index 56badd4a95..fb3b5de44c 100644 --- a/internal/writer/deploy_resource_specification_response_writer.go +++ b/internal/writer/deploy_resource_specification_response_writer.go @@ -1,7 +1,7 @@ package writer import ( - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type deployResourceSpecificationResponseWriter struct { diff --git a/internal/writer/logwriter.go b/internal/writer/logwriter.go index b85ba4262d..2074e811eb 100644 --- a/internal/writer/logwriter.go +++ b/internal/writer/logwriter.go @@ -1,9 +1,9 @@ package writer import ( - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type saltLogger struct { diff --git a/internal/writer/refresh_job_response_writer.go b/internal/writer/refresh_job_response_writer.go index a630176caf..fe5b2c9e24 100644 --- a/internal/writer/refresh_job_response_writer.go +++ b/internal/writer/refresh_job_response_writer.go @@ -1,7 +1,7 @@ package writer import ( - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type RefreshJobResponseWriter interface { diff --git a/internal/writer/replace_all_job_specifications_response_writer.go b/internal/writer/replace_all_job_specifications_response_writer.go index 44b837c53d..da45f5b8c2 100644 --- a/internal/writer/replace_all_job_specifications_response_writer.go +++ b/internal/writer/replace_all_job_specifications_response_writer.go @@ -1,7 +1,7 @@ package writer import ( - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type ReplaceAllJobSpecificationsResponseWriter interface { diff --git a/internal/writer/writer.go b/internal/writer/writer.go index 005599c0fb..d878681d25 100644 --- a/internal/writer/writer.go +++ b/internal/writer/writer.go @@ -1,7 +1,7 @@ package writer import ( - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type LogLevel int diff --git a/main.go b/main.go index 61237030d9..1812ba1af3 100644 --- a/main.go +++ b/main.go @@ -9,10 +9,10 @@ import ( _ "go.uber.org/automaxprocs" - clientCmd "github.com/odpf/optimus/client/cmd" - _ "github.com/odpf/optimus/client/extension/provider" - server "github.com/odpf/optimus/server/cmd" - "github.com/odpf/optimus/server/cmd/migration" + clientCmd "github.com/raystack/optimus/client/cmd" + _ "github.com/raystack/optimus/client/extension/provider" + server "github.com/raystack/optimus/server/cmd" + "github.com/raystack/optimus/server/cmd/migration" ) var errRequestFail = errors.New("🔥 unable to complete request successfully") diff --git a/plugin/binary/plugin.go b/plugin/binary/plugin.go index 9c39af56ad..a7b47fb573 100644 --- a/plugin/binary/plugin.go +++ b/plugin/binary/plugin.go @@ -9,9 +9,9 @@ import ( "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-plugin" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/plugin/v1beta1/dependencyresolver" - oplugin "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/plugin/v1beta1/dependencyresolver" + oplugin "github.com/raystack/optimus/sdk/plugin" ) var ( diff --git a/plugin/plugin.go b/plugin/plugin.go index 025fc1f528..c93696b5d6 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -9,11 +9,11 @@ import ( "github.com/hashicorp/go-hclog" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/plugin/binary" - "github.com/odpf/optimus/plugin/v1beta1/dependencyresolver" - "github.com/odpf/optimus/plugin/yaml" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/plugin/binary" + "github.com/raystack/optimus/plugin/v1beta1/dependencyresolver" + "github.com/raystack/optimus/plugin/yaml" + "github.com/raystack/optimus/sdk/plugin" ) func Initialize(pluginLogger hclog.Logger, arg ...string) (*models.PluginRepository, error) { diff --git a/plugin/plugin_manager.go b/plugin/plugin_manager.go index 722915063b..b9aeaeb9bf 100644 --- a/plugin/plugin_manager.go +++ b/plugin/plugin_manager.go @@ -12,8 +12,8 @@ import ( getter "github.com/hashicorp/go-getter" "github.com/hashicorp/go-hclog" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/plugin/yaml" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/plugin/yaml" ) var ( diff --git a/plugin/v1beta1/dependencyresolver/adapter.go b/plugin/v1beta1/dependencyresolver/adapter.go index 4bcae1f694..bda4163135 100644 --- a/plugin/v1beta1/dependencyresolver/adapter.go +++ b/plugin/v1beta1/dependencyresolver/adapter.go @@ -1,8 +1,8 @@ package dependencyresolver import ( - pb "github.com/odpf/optimus/protos/odpf/optimus/plugins/v1beta1" - "github.com/odpf/optimus/sdk/plugin" + pb "github.com/raystack/optimus/protos/raystack/optimus/plugins/v1beta1" + "github.com/raystack/optimus/sdk/plugin" ) func adaptConfigsToProto(c plugin.Configs) *pb.Configs { diff --git a/plugin/v1beta1/dependencyresolver/client.go b/plugin/v1beta1/dependencyresolver/client.go index 1d705e6f87..db28b1244a 100644 --- a/plugin/v1beta1/dependencyresolver/client.go +++ b/plugin/v1beta1/dependencyresolver/client.go @@ -12,10 +12,8 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/odpf/optimus/internal/utils" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" - pbp "github.com/odpf/optimus/protos/odpf/optimus/plugins/v1beta1" - "github.com/odpf/optimus/sdk/plugin" + pbp "github.com/raystack/optimus/protos/raystack/optimus/plugins/v1beta1" + "github.com/raystack/optimus/sdk/plugin" ) const ( @@ -90,12 +88,12 @@ func (m *GRPCClient) CompileAssets(ctx context.Context, request plugin.CompileAs _, span := tracer.Start(ctx, "CompileAssets") defer span.End() - var instanceData []*pb.InstanceSpecData + var instanceData []*pbp.InstanceData for _, inst := range request.InstanceData { - instanceData = append(instanceData, &pb.InstanceSpecData{ + instanceData = append(instanceData, &pbp.InstanceData{ Name: inst.Name, Value: inst.Value, - Type: pb.InstanceSpecData_Type(pb.InstanceSpecData_Type_value[utils.ToEnumProto(inst.Type, "type")]), + Type: inst.Type, }) } diff --git a/plugin/v1beta1/dependencyresolver/connector.go b/plugin/v1beta1/dependencyresolver/connector.go index cddd020e5d..7aa1aa15d0 100644 --- a/plugin/v1beta1/dependencyresolver/connector.go +++ b/plugin/v1beta1/dependencyresolver/connector.go @@ -8,8 +8,8 @@ import ( "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "google.golang.org/grpc" - pbp "github.com/odpf/optimus/protos/odpf/optimus/plugins/v1beta1" - oplugin "github.com/odpf/optimus/sdk/plugin" + pbp "github.com/raystack/optimus/protos/raystack/optimus/plugins/v1beta1" + oplugin "github.com/raystack/optimus/sdk/plugin" ) var _ plugin.GRPCPlugin = &Connector{} diff --git a/plugin/v1beta1/dependencyresolver/server.go b/plugin/v1beta1/dependencyresolver/server.go index 867b4ec768..9f839358cb 100644 --- a/plugin/v1beta1/dependencyresolver/server.go +++ b/plugin/v1beta1/dependencyresolver/server.go @@ -3,9 +3,8 @@ package dependencyresolver import ( "context" - "github.com/odpf/optimus/internal/utils" - pbp "github.com/odpf/optimus/protos/odpf/optimus/plugins/v1beta1" - "github.com/odpf/optimus/sdk/plugin" + pbp "github.com/raystack/optimus/protos/raystack/optimus/plugins/v1beta1" + "github.com/raystack/optimus/sdk/plugin" ) // GRPCServer will be used by plugins this is working as proto adapter @@ -54,7 +53,7 @@ func (s *GRPCServer) CompileAssets(ctx context.Context, req *pbp.CompileAssetsRe instanceData = append(instanceData, plugin.JobRunSpecData{ Name: inst.Name, Value: inst.Value, - Type: utils.FromEnumProto(inst.Type.String(), "type"), + Type: inst.Type, }) } diff --git a/plugin/yaml/plugin.go b/plugin/yaml/plugin.go index 683502f2c9..77d6887575 100644 --- a/plugin/yaml/plugin.go +++ b/plugin/yaml/plugin.go @@ -11,8 +11,8 @@ import ( "github.com/spf13/afero" "gopkg.in/yaml.v2" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/sdk/plugin" ) const ( diff --git a/plugin/yaml/plugin_test.go b/plugin/yaml/plugin_test.go index 3187c34cdb..c103c32169 100644 --- a/plugin/yaml/plugin_test.go +++ b/plugin/yaml/plugin_test.go @@ -8,9 +8,9 @@ import ( "github.com/hashicorp/go-hclog" "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/plugin/yaml" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/plugin/yaml" + "github.com/raystack/optimus/sdk/plugin" ) type mockYamlMod struct { @@ -53,7 +53,7 @@ func TestYamlPlugin(t *testing.T) { expectedInfo := &plugin.Info{ Name: "bq2bqtest", Description: "Testing", - Image: "docker.io/odpf/optimus-task-bq2bq-executor:latest", + Image: "docker.io/raystack/optimus-task-bq2bq-executor:latest", Entrypoint: plugin.Entrypoint{ Shell: "/bin/bash", Script: "sleep 100; sleep 150", diff --git a/plugin/yaml/tests/sample_plugin.yaml b/plugin/yaml/tests/sample_plugin.yaml index 75e4eb3627..8b7c012ac5 100644 --- a/plugin/yaml/tests/sample_plugin.yaml +++ b/plugin/yaml/tests/sample_plugin.yaml @@ -5,7 +5,7 @@ pluginmods: - cli - dependencyresolver pluginversion: latest -image: docker.io/odpf/optimus-task-bq2bq-executor:latest +image: docker.io/raystack/optimus-task-bq2bq-executor:latest entrypoint: shell: "/bin/bash" script: |- @@ -19,9 +19,9 @@ questions: minlength: 3 defaultconfig: -- name: TEST - value: "{{.test}}" + - name: TEST + value: "{{.test}}" defaultassets: - name: query.sql - value: Select * from "project.dataset.table"; \ No newline at end of file + value: Select * from "project.dataset.table"; diff --git a/plugin/yaml/tests/sample_plugin_without_shell.yaml b/plugin/yaml/tests/sample_plugin_without_shell.yaml index f45e6bfbf9..098aff64dc 100644 --- a/plugin/yaml/tests/sample_plugin_without_shell.yaml +++ b/plugin/yaml/tests/sample_plugin_without_shell.yaml @@ -5,7 +5,7 @@ pluginmods: - cli - dependencyresolver pluginversion: latest -image: docker.io/odpf/optimus-task-bq2bq-executor:latest +image: docker.io/raystack/optimus-task-bq2bq-executor:latest entrypoint: script: "sleep 100" @@ -16,9 +16,9 @@ questions: minlength: 3 defaultconfig: -- name: TEST - value: "{{.test}}" + - name: TEST + value: "{{.test}}" defaultassets: - name: query.sql - value: Select * from "project.dataset.table"; \ No newline at end of file + value: Select * from "project.dataset.table"; diff --git a/protos/odpf/optimus/cluster/v1beta1/command.pb.go b/protos/odpf/optimus/cluster/v1beta1/command.pb.go deleted file mode 100644 index eb7cfdbbcd..0000000000 --- a/protos/odpf/optimus/cluster/v1beta1/command.pb.go +++ /dev/null @@ -1,511 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/cluster/v1beta1/command.proto - -package optimus - -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 CommandLogType int32 - -const ( - CommandLogType_COMMAND_LOG_TYPE_UNSPECIFIED CommandLogType = 0 - CommandLogType_COMMAND_LOG_TYPE_NOOP CommandLogType = 1 - CommandLogType_COMMAND_LOG_TYPE_SCHEDULE_JOB CommandLogType = 2 - CommandLogType_COMMAND_LOG_TYPE_UPDATE_JOB CommandLogType = 3 -) - -// Enum value maps for CommandLogType. -var ( - CommandLogType_name = map[int32]string{ - 0: "COMMAND_LOG_TYPE_UNSPECIFIED", - 1: "COMMAND_LOG_TYPE_NOOP", - 2: "COMMAND_LOG_TYPE_SCHEDULE_JOB", - 3: "COMMAND_LOG_TYPE_UPDATE_JOB", - } - CommandLogType_value = map[string]int32{ - "COMMAND_LOG_TYPE_UNSPECIFIED": 0, - "COMMAND_LOG_TYPE_NOOP": 1, - "COMMAND_LOG_TYPE_SCHEDULE_JOB": 2, - "COMMAND_LOG_TYPE_UPDATE_JOB": 3, - } -) - -func (x CommandLogType) Enum() *CommandLogType { - p := new(CommandLogType) - *p = x - return p -} - -func (x CommandLogType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CommandLogType) Descriptor() protoreflect.EnumDescriptor { - return file_odpf_optimus_cluster_v1beta1_command_proto_enumTypes[0].Descriptor() -} - -func (CommandLogType) Type() protoreflect.EnumType { - return &file_odpf_optimus_cluster_v1beta1_command_proto_enumTypes[0] -} - -func (x CommandLogType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CommandLogType.Descriptor instead. -func (CommandLogType) EnumDescriptor() ([]byte, []int) { - return file_odpf_optimus_cluster_v1beta1_command_proto_rawDescGZIP(), []int{0} -} - -type CommandLog struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type CommandLogType `protobuf:"varint,1,opt,name=type,proto3,enum=odpf.optimus.cluster.v1beta1.CommandLogType" json:"type,omitempty"` - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (x *CommandLog) Reset() { - *x = CommandLog{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandLog) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandLog) ProtoMessage() {} - -func (x *CommandLog) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_cluster_v1beta1_command_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 CommandLog.ProtoReflect.Descriptor instead. -func (*CommandLog) Descriptor() ([]byte, []int) { - return file_odpf_optimus_cluster_v1beta1_command_proto_rawDescGZIP(), []int{0} -} - -func (x *CommandLog) GetType() CommandLogType { - if x != nil { - return x.Type - } - return CommandLogType_COMMAND_LOG_TYPE_UNSPECIFIED -} - -func (x *CommandLog) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -type CommandNoop struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *CommandNoop) Reset() { - *x = CommandNoop{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandNoop) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandNoop) ProtoMessage() {} - -func (x *CommandNoop) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_cluster_v1beta1_command_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 CommandNoop.ProtoReflect.Descriptor instead. -func (*CommandNoop) Descriptor() ([]byte, []int) { - return file_odpf_optimus_cluster_v1beta1_command_proto_rawDescGZIP(), []int{1} -} - -func (x *CommandNoop) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -// CommandScheduleJob will be sent to assign job for execution to a peer -type CommandScheduleJob struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // peer_id is the node name to which this job is assigned to get - // executed - PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` - RunIds []string `protobuf:"bytes,2,rep,name=run_ids,json=runIds,proto3" json:"run_ids,omitempty"` -} - -func (x *CommandScheduleJob) Reset() { - *x = CommandScheduleJob{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandScheduleJob) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandScheduleJob) ProtoMessage() {} - -func (x *CommandScheduleJob) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_cluster_v1beta1_command_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 CommandScheduleJob.ProtoReflect.Descriptor instead. -func (*CommandScheduleJob) Descriptor() ([]byte, []int) { - return file_odpf_optimus_cluster_v1beta1_command_proto_rawDescGZIP(), []int{2} -} - -func (x *CommandScheduleJob) GetPeerId() string { - if x != nil { - return x.PeerId - } - return "" -} - -func (x *CommandScheduleJob) GetRunIds() []string { - if x != nil { - return x.RunIds - } - return nil -} - -// CommandUpdateJob will be sent to update the attributes of job which was -// previously scheduled for execution -type CommandUpdateJob struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` - Patches []*CommandUpdateJob_Patch `protobuf:"bytes,2,rep,name=patches,proto3" json:"patches,omitempty"` -} - -func (x *CommandUpdateJob) Reset() { - *x = CommandUpdateJob{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandUpdateJob) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandUpdateJob) ProtoMessage() {} - -func (x *CommandUpdateJob) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_cluster_v1beta1_command_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 CommandUpdateJob.ProtoReflect.Descriptor instead. -func (*CommandUpdateJob) Descriptor() ([]byte, []int) { - return file_odpf_optimus_cluster_v1beta1_command_proto_rawDescGZIP(), []int{3} -} - -func (x *CommandUpdateJob) GetPeerId() string { - if x != nil { - return x.PeerId - } - return "" -} - -func (x *CommandUpdateJob) GetPatches() []*CommandUpdateJob_Patch { - if x != nil { - return x.Patches - } - return nil -} - -type CommandUpdateJob_Patch struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *CommandUpdateJob_Patch) Reset() { - *x = CommandUpdateJob_Patch{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommandUpdateJob_Patch) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommandUpdateJob_Patch) ProtoMessage() {} - -func (x *CommandUpdateJob_Patch) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_cluster_v1beta1_command_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 CommandUpdateJob_Patch.ProtoReflect.Descriptor instead. -func (*CommandUpdateJob_Patch) Descriptor() ([]byte, []int) { - return file_odpf_optimus_cluster_v1beta1_command_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *CommandUpdateJob_Patch) GetRunId() string { - if x != nil { - return x.RunId - } - return "" -} - -func (x *CommandUpdateJob_Patch) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -var File_odpf_optimus_cluster_v1beta1_command_proto protoreflect.FileDescriptor - -var file_odpf_optimus_cluster_v1beta1_command_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x22, 0x68, 0x0a, 0x0a, 0x43, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x6f, 0x67, 0x12, 0x40, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x6f, 0x67, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x1d, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4e, - 0x6f, 0x6f, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x46, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x53, 0x63, - 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x10, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, - 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x07, 0x70, 0x61, 0x74, - 0x63, 0x68, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, - 0x52, 0x07, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x1a, 0x36, 0x0a, 0x05, 0x50, 0x61, 0x74, - 0x63, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x2a, 0x91, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x6f, 0x67, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, - 0x4c, 0x4f, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, - 0x44, 0x5f, 0x4c, 0x4f, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x4f, 0x50, 0x10, - 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x4c, 0x4f, 0x47, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x5f, 0x4a, - 0x4f, 0x42, 0x10, 0x02, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, - 0x4c, 0x4f, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, - 0x4a, 0x4f, 0x42, 0x10, 0x03, 0x42, 0x20, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_optimus_cluster_v1beta1_command_proto_rawDescOnce sync.Once - file_odpf_optimus_cluster_v1beta1_command_proto_rawDescData = file_odpf_optimus_cluster_v1beta1_command_proto_rawDesc -) - -func file_odpf_optimus_cluster_v1beta1_command_proto_rawDescGZIP() []byte { - file_odpf_optimus_cluster_v1beta1_command_proto_rawDescOnce.Do(func() { - file_odpf_optimus_cluster_v1beta1_command_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_cluster_v1beta1_command_proto_rawDescData) - }) - return file_odpf_optimus_cluster_v1beta1_command_proto_rawDescData -} - -var file_odpf_optimus_cluster_v1beta1_command_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_odpf_optimus_cluster_v1beta1_command_proto_goTypes = []interface{}{ - (CommandLogType)(0), // 0: odpf.optimus.cluster.v1beta1.CommandLogType - (*CommandLog)(nil), // 1: odpf.optimus.cluster.v1beta1.CommandLog - (*CommandNoop)(nil), // 2: odpf.optimus.cluster.v1beta1.CommandNoop - (*CommandScheduleJob)(nil), // 3: odpf.optimus.cluster.v1beta1.CommandScheduleJob - (*CommandUpdateJob)(nil), // 4: odpf.optimus.cluster.v1beta1.CommandUpdateJob - (*CommandUpdateJob_Patch)(nil), // 5: odpf.optimus.cluster.v1beta1.CommandUpdateJob.Patch -} -var file_odpf_optimus_cluster_v1beta1_command_proto_depIdxs = []int32{ - 0, // 0: odpf.optimus.cluster.v1beta1.CommandLog.type:type_name -> odpf.optimus.cluster.v1beta1.CommandLogType - 5, // 1: odpf.optimus.cluster.v1beta1.CommandUpdateJob.patches:type_name -> odpf.optimus.cluster.v1beta1.CommandUpdateJob.Patch - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_odpf_optimus_cluster_v1beta1_command_proto_init() } -func file_odpf_optimus_cluster_v1beta1_command_proto_init() { - if File_odpf_optimus_cluster_v1beta1_command_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandLog); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandNoop); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandScheduleJob); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandUpdateJob); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommandUpdateJob_Patch); 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_odpf_optimus_cluster_v1beta1_command_proto_rawDesc, - NumEnums: 1, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_odpf_optimus_cluster_v1beta1_command_proto_goTypes, - DependencyIndexes: file_odpf_optimus_cluster_v1beta1_command_proto_depIdxs, - EnumInfos: file_odpf_optimus_cluster_v1beta1_command_proto_enumTypes, - MessageInfos: file_odpf_optimus_cluster_v1beta1_command_proto_msgTypes, - }.Build() - File_odpf_optimus_cluster_v1beta1_command_proto = out.File - file_odpf_optimus_cluster_v1beta1_command_proto_rawDesc = nil - file_odpf_optimus_cluster_v1beta1_command_proto_goTypes = nil - file_odpf_optimus_cluster_v1beta1_command_proto_depIdxs = nil -} diff --git a/protos/odpf/optimus/core/v1beta1/backup.pb.go b/protos/odpf/optimus/core/v1beta1/backup.pb.go deleted file mode 100644 index 3e80171cc2..0000000000 --- a/protos/odpf/optimus/core/v1beta1/backup.pb.go +++ /dev/null @@ -1,859 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/core/v1beta1/backup.proto - -package optimus - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - 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 IgnoredResource struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` -} - -func (x *IgnoredResource) Reset() { - *x = IgnoredResource{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IgnoredResource) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IgnoredResource) ProtoMessage() {} - -func (x *IgnoredResource) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_backup_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 IgnoredResource.ProtoReflect.Descriptor instead. -func (*IgnoredResource) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{0} -} - -func (x *IgnoredResource) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *IgnoredResource) GetReason() string { - if x != nil { - return x.Reason - } - return "" -} - -type CreateBackupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` - NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - Config map[string]string `protobuf:"bytes,7,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - ResourceNames []string `protobuf:"bytes,9,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"` -} - -func (x *CreateBackupRequest) Reset() { - *x = CreateBackupRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateBackupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBackupRequest) ProtoMessage() {} - -func (x *CreateBackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_backup_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 CreateBackupRequest.ProtoReflect.Descriptor instead. -func (*CreateBackupRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateBackupRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *CreateBackupRequest) GetDatastoreName() string { - if x != nil { - return x.DatastoreName - } - return "" -} - -func (x *CreateBackupRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -func (x *CreateBackupRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *CreateBackupRequest) GetConfig() map[string]string { - if x != nil { - return x.Config - } - return nil -} - -func (x *CreateBackupRequest) GetResourceNames() []string { - if x != nil { - return x.ResourceNames - } - return nil -} - -type CreateBackupResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ResourceNames []string `protobuf:"bytes,1,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"` - IgnoredResources []*IgnoredResource `protobuf:"bytes,3,rep,name=ignored_resources,json=ignoredResources,proto3" json:"ignored_resources,omitempty"` - BackupId string `protobuf:"bytes,4,opt,name=backup_id,json=backupId,proto3" json:"backup_id,omitempty"` -} - -func (x *CreateBackupResponse) Reset() { - *x = CreateBackupResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateBackupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBackupResponse) ProtoMessage() {} - -func (x *CreateBackupResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_backup_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 CreateBackupResponse.ProtoReflect.Descriptor instead. -func (*CreateBackupResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateBackupResponse) GetResourceNames() []string { - if x != nil { - return x.ResourceNames - } - return nil -} - -func (x *CreateBackupResponse) GetIgnoredResources() []*IgnoredResource { - if x != nil { - return x.IgnoredResources - } - return nil -} - -func (x *CreateBackupResponse) GetBackupId() string { - if x != nil { - return x.BackupId - } - return "" -} - -type ListBackupsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` - NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` -} - -func (x *ListBackupsRequest) Reset() { - *x = ListBackupsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBackupsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBackupsRequest) ProtoMessage() {} - -func (x *ListBackupsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_backup_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 ListBackupsRequest.ProtoReflect.Descriptor instead. -func (*ListBackupsRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{3} -} - -func (x *ListBackupsRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *ListBackupsRequest) GetDatastoreName() string { - if x != nil { - return x.DatastoreName - } - return "" -} - -func (x *ListBackupsRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -type ListBackupsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Backups []*BackupSpec `protobuf:"bytes,1,rep,name=backups,proto3" json:"backups,omitempty"` -} - -func (x *ListBackupsResponse) Reset() { - *x = ListBackupsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBackupsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBackupsResponse) ProtoMessage() {} - -func (x *ListBackupsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_backup_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 ListBackupsResponse.ProtoReflect.Descriptor instead. -func (*ListBackupsResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{4} -} - -func (x *ListBackupsResponse) GetBackups() []*BackupSpec { - if x != nil { - return x.Backups - } - return nil -} - -type BackupSpec struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - Config map[string]string `protobuf:"bytes,5,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - ResourceNames []string `protobuf:"bytes,6,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"` -} - -func (x *BackupSpec) Reset() { - *x = BackupSpec{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BackupSpec) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupSpec) ProtoMessage() {} - -func (x *BackupSpec) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_backup_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 BackupSpec.ProtoReflect.Descriptor instead. -func (*BackupSpec) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{5} -} - -func (x *BackupSpec) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *BackupSpec) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *BackupSpec) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *BackupSpec) GetConfig() map[string]string { - if x != nil { - return x.Config - } - return nil -} - -func (x *BackupSpec) GetResourceNames() []string { - if x != nil { - return x.ResourceNames - } - return nil -} - -type GetBackupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` - NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` - Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetBackupRequest) Reset() { - *x = GetBackupRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBackupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBackupRequest) ProtoMessage() {} - -func (x *GetBackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_backup_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 GetBackupRequest.ProtoReflect.Descriptor instead. -func (*GetBackupRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{6} -} - -func (x *GetBackupRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *GetBackupRequest) GetDatastoreName() string { - if x != nil { - return x.DatastoreName - } - return "" -} - -func (x *GetBackupRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -func (x *GetBackupRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type GetBackupResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Spec *BackupSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (x *GetBackupResponse) Reset() { - *x = GetBackupResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBackupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBackupResponse) ProtoMessage() {} - -func (x *GetBackupResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_backup_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 GetBackupResponse.ProtoReflect.Descriptor instead. -func (*GetBackupResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{7} -} - -func (x *GetBackupResponse) GetSpec() *BackupSpec { - if x != nil { - return x.Spec - } - return nil -} - -var File_odpf_optimus_core_v1beta1_backup_proto protoreflect.FileDescriptor - -var file_odpf_optimus_core_v1beta1_backup_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x3d, 0x0a, 0x0f, 0x49, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x22, 0xf0, 0x02, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x06, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, - 0x08, 0x08, 0x10, 0x09, 0x22, 0xb9, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, - 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x11, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x5f, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x67, 0x6e, 0x6f, - 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x10, 0x69, 0x67, 0x6e, - 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x0a, - 0x09, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, - 0x22, 0x85, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, - 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x56, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, - 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3f, 0x0a, 0x07, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x25, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x53, 0x70, 0x65, 0x63, 0x52, 0x07, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, - 0x22, 0xac, 0x02, 0x0a, 0x0a, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x70, 0x65, 0x63, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x06, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, - 0x70, 0x65, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x39, - 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, - 0x93, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, - 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x54, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x04, 0x73, 0x70, - 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x70, 0x65, 0x63, 0x52, - 0x04, 0x73, 0x70, 0x65, 0x63, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x32, 0x8e, 0x05, 0x0a, 0x0d, - 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xd8, 0x01, - 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2e, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x67, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x61, 0x22, 0x5c, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, - 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x62, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x3a, 0x01, 0x2a, 0x12, 0xd2, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, - 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x12, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5e, 0x12, - 0x5c, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0xcc, 0x01, - 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2b, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, - 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5e, 0x12, 0x5c, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, - 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0x8d, 0x01, 0x0a, - 0x16, 0x69, 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x14, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, - 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, - 0x41, 0x3a, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, - 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, - 0x01, 0x01, 0x72, 0x18, 0x0a, 0x16, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x42, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_optimus_core_v1beta1_backup_proto_rawDescOnce sync.Once - file_odpf_optimus_core_v1beta1_backup_proto_rawDescData = file_odpf_optimus_core_v1beta1_backup_proto_rawDesc -) - -func file_odpf_optimus_core_v1beta1_backup_proto_rawDescGZIP() []byte { - file_odpf_optimus_core_v1beta1_backup_proto_rawDescOnce.Do(func() { - file_odpf_optimus_core_v1beta1_backup_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_core_v1beta1_backup_proto_rawDescData) - }) - return file_odpf_optimus_core_v1beta1_backup_proto_rawDescData -} - -var file_odpf_optimus_core_v1beta1_backup_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_odpf_optimus_core_v1beta1_backup_proto_goTypes = []interface{}{ - (*IgnoredResource)(nil), // 0: odpf.optimus.core.v1beta1.IgnoredResource - (*CreateBackupRequest)(nil), // 1: odpf.optimus.core.v1beta1.CreateBackupRequest - (*CreateBackupResponse)(nil), // 2: odpf.optimus.core.v1beta1.CreateBackupResponse - (*ListBackupsRequest)(nil), // 3: odpf.optimus.core.v1beta1.ListBackupsRequest - (*ListBackupsResponse)(nil), // 4: odpf.optimus.core.v1beta1.ListBackupsResponse - (*BackupSpec)(nil), // 5: odpf.optimus.core.v1beta1.BackupSpec - (*GetBackupRequest)(nil), // 6: odpf.optimus.core.v1beta1.GetBackupRequest - (*GetBackupResponse)(nil), // 7: odpf.optimus.core.v1beta1.GetBackupResponse - nil, // 8: odpf.optimus.core.v1beta1.CreateBackupRequest.ConfigEntry - nil, // 9: odpf.optimus.core.v1beta1.BackupSpec.ConfigEntry - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp -} -var file_odpf_optimus_core_v1beta1_backup_proto_depIdxs = []int32{ - 8, // 0: odpf.optimus.core.v1beta1.CreateBackupRequest.config:type_name -> odpf.optimus.core.v1beta1.CreateBackupRequest.ConfigEntry - 0, // 1: odpf.optimus.core.v1beta1.CreateBackupResponse.ignored_resources:type_name -> odpf.optimus.core.v1beta1.IgnoredResource - 5, // 2: odpf.optimus.core.v1beta1.ListBackupsResponse.backups:type_name -> odpf.optimus.core.v1beta1.BackupSpec - 10, // 3: odpf.optimus.core.v1beta1.BackupSpec.created_at:type_name -> google.protobuf.Timestamp - 9, // 4: odpf.optimus.core.v1beta1.BackupSpec.config:type_name -> odpf.optimus.core.v1beta1.BackupSpec.ConfigEntry - 5, // 5: odpf.optimus.core.v1beta1.GetBackupResponse.spec:type_name -> odpf.optimus.core.v1beta1.BackupSpec - 1, // 6: odpf.optimus.core.v1beta1.BackupService.CreateBackup:input_type -> odpf.optimus.core.v1beta1.CreateBackupRequest - 3, // 7: odpf.optimus.core.v1beta1.BackupService.ListBackups:input_type -> odpf.optimus.core.v1beta1.ListBackupsRequest - 6, // 8: odpf.optimus.core.v1beta1.BackupService.GetBackup:input_type -> odpf.optimus.core.v1beta1.GetBackupRequest - 2, // 9: odpf.optimus.core.v1beta1.BackupService.CreateBackup:output_type -> odpf.optimus.core.v1beta1.CreateBackupResponse - 4, // 10: odpf.optimus.core.v1beta1.BackupService.ListBackups:output_type -> odpf.optimus.core.v1beta1.ListBackupsResponse - 7, // 11: odpf.optimus.core.v1beta1.BackupService.GetBackup:output_type -> odpf.optimus.core.v1beta1.GetBackupResponse - 9, // [9:12] is the sub-list for method output_type - 6, // [6:9] 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_odpf_optimus_core_v1beta1_backup_proto_init() } -func file_odpf_optimus_core_v1beta1_backup_proto_init() { - if File_odpf_optimus_core_v1beta1_backup_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IgnoredResource); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBackupRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBackupResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBackupsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBackupsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BackupSpec); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBackupRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_backup_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBackupResponse); 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_odpf_optimus_core_v1beta1_backup_proto_rawDesc, - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_odpf_optimus_core_v1beta1_backup_proto_goTypes, - DependencyIndexes: file_odpf_optimus_core_v1beta1_backup_proto_depIdxs, - MessageInfos: file_odpf_optimus_core_v1beta1_backup_proto_msgTypes, - }.Build() - File_odpf_optimus_core_v1beta1_backup_proto = out.File - file_odpf_optimus_core_v1beta1_backup_proto_rawDesc = nil - file_odpf_optimus_core_v1beta1_backup_proto_goTypes = nil - file_odpf_optimus_core_v1beta1_backup_proto_depIdxs = nil -} diff --git a/protos/odpf/optimus/core/v1beta1/job_run.pb.go b/protos/odpf/optimus/core/v1beta1/job_run.pb.go deleted file mode 100644 index 18624c33d7..0000000000 --- a/protos/odpf/optimus/core/v1beta1/job_run.pb.go +++ /dev/null @@ -1,1268 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/core/v1beta1/job_run.proto - -package optimus - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - 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 InstanceSpec_Type int32 - -const ( - InstanceSpec_TYPE_UNSPECIFIED InstanceSpec_Type = 0 - InstanceSpec_TYPE_TASK InstanceSpec_Type = 1 - InstanceSpec_TYPE_HOOK InstanceSpec_Type = 2 -) - -// Enum value maps for InstanceSpec_Type. -var ( - InstanceSpec_Type_name = map[int32]string{ - 0: "TYPE_UNSPECIFIED", - 1: "TYPE_TASK", - 2: "TYPE_HOOK", - } - InstanceSpec_Type_value = map[string]int32{ - "TYPE_UNSPECIFIED": 0, - "TYPE_TASK": 1, - "TYPE_HOOK": 2, - } -) - -func (x InstanceSpec_Type) Enum() *InstanceSpec_Type { - p := new(InstanceSpec_Type) - *p = x - return p -} - -func (x InstanceSpec_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (InstanceSpec_Type) Descriptor() protoreflect.EnumDescriptor { - return file_odpf_optimus_core_v1beta1_job_run_proto_enumTypes[0].Descriptor() -} - -func (InstanceSpec_Type) Type() protoreflect.EnumType { - return &file_odpf_optimus_core_v1beta1_job_run_proto_enumTypes[0] -} - -func (x InstanceSpec_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use InstanceSpec_Type.Descriptor instead. -func (InstanceSpec_Type) EnumDescriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{7, 0} -} - -// type of data, could be an env var or file -type InstanceSpecData_Type int32 - -const ( - InstanceSpecData_TYPE_UNSPECIFIED InstanceSpecData_Type = 0 - InstanceSpecData_TYPE_ENV InstanceSpecData_Type = 1 - InstanceSpecData_TYPE_FILE InstanceSpecData_Type = 2 -) - -// Enum value maps for InstanceSpecData_Type. -var ( - InstanceSpecData_Type_name = map[int32]string{ - 0: "TYPE_UNSPECIFIED", - 1: "TYPE_ENV", - 2: "TYPE_FILE", - } - InstanceSpecData_Type_value = map[string]int32{ - "TYPE_UNSPECIFIED": 0, - "TYPE_ENV": 1, - "TYPE_FILE": 2, - } -) - -func (x InstanceSpecData_Type) Enum() *InstanceSpecData_Type { - p := new(InstanceSpecData_Type) - *p = x - return p -} - -func (x InstanceSpecData_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (InstanceSpecData_Type) Descriptor() protoreflect.EnumDescriptor { - return file_odpf_optimus_core_v1beta1_job_run_proto_enumTypes[1].Descriptor() -} - -func (InstanceSpecData_Type) Type() protoreflect.EnumType { - return &file_odpf_optimus_core_v1beta1_job_run_proto_enumTypes[1] -} - -func (x InstanceSpecData_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use InstanceSpecData_Type.Descriptor instead. -func (InstanceSpecData_Type) EnumDescriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{8, 0} -} - -type UploadToSchedulerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - NamespaceName *string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName,proto3,oneof" json:"namespace_name,omitempty"` -} - -func (x *UploadToSchedulerRequest) Reset() { - *x = UploadToSchedulerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UploadToSchedulerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadToSchedulerRequest) ProtoMessage() {} - -func (x *UploadToSchedulerRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 UploadToSchedulerRequest.ProtoReflect.Descriptor instead. -func (*UploadToSchedulerRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{0} -} - -func (x *UploadToSchedulerRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *UploadToSchedulerRequest) GetNamespaceName() string { - if x != nil && x.NamespaceName != nil { - return *x.NamespaceName - } - return "" -} - -type UploadToSchedulerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` - ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` -} - -func (x *UploadToSchedulerResponse) Reset() { - *x = UploadToSchedulerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UploadToSchedulerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadToSchedulerResponse) ProtoMessage() {} - -func (x *UploadToSchedulerResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 UploadToSchedulerResponse.ProtoReflect.Descriptor instead. -func (*UploadToSchedulerResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{1} -} - -func (x *UploadToSchedulerResponse) GetStatus() bool { - if x != nil { - return x.Status - } - return false -} - -func (x *UploadToSchedulerResponse) GetErrorMessage() string { - if x != nil { - return x.ErrorMessage - } - return "" -} - -type RegisterJobEventRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` - NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` - Event *JobEvent `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"` -} - -func (x *RegisterJobEventRequest) Reset() { - *x = RegisterJobEventRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterJobEventRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterJobEventRequest) ProtoMessage() {} - -func (x *RegisterJobEventRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 RegisterJobEventRequest.ProtoReflect.Descriptor instead. -func (*RegisterJobEventRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{2} -} - -func (x *RegisterJobEventRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *RegisterJobEventRequest) GetJobName() string { - if x != nil { - return x.JobName - } - return "" -} - -func (x *RegisterJobEventRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -func (x *RegisterJobEventRequest) GetEvent() *JobEvent { - if x != nil { - return x.Event - } - return nil -} - -type RegisterJobEventResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RegisterJobEventResponse) Reset() { - *x = RegisterJobEventResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterJobEventResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterJobEventResponse) ProtoMessage() {} - -func (x *RegisterJobEventResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 RegisterJobEventResponse.ProtoReflect.Descriptor instead. -func (*RegisterJobEventResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{3} -} - -type JobRunInputRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` - ScheduledAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=scheduled_at,json=scheduledAt,proto3" json:"scheduled_at,omitempty"` - InstanceName string `protobuf:"bytes,5,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` - InstanceType InstanceSpec_Type `protobuf:"varint,6,opt,name=instance_type,json=instanceType,proto3,enum=odpf.optimus.core.v1beta1.InstanceSpec_Type" json:"instance_type,omitempty"` - // either set job_name if this is a scheduled execution - // or set jobrun_id if this is a manual triggered execution - // and not really registered as a valid job - JobrunId string `protobuf:"bytes,7,opt,name=jobrun_id,json=jobrunId,proto3" json:"jobrun_id,omitempty"` -} - -func (x *JobRunInputRequest) Reset() { - *x = JobRunInputRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JobRunInputRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobRunInputRequest) ProtoMessage() {} - -func (x *JobRunInputRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 JobRunInputRequest.ProtoReflect.Descriptor instead. -func (*JobRunInputRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{4} -} - -func (x *JobRunInputRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *JobRunInputRequest) GetJobName() string { - if x != nil { - return x.JobName - } - return "" -} - -func (x *JobRunInputRequest) GetScheduledAt() *timestamppb.Timestamp { - if x != nil { - return x.ScheduledAt - } - return nil -} - -func (x *JobRunInputRequest) GetInstanceName() string { - if x != nil { - return x.InstanceName - } - return "" -} - -func (x *JobRunInputRequest) GetInstanceType() InstanceSpec_Type { - if x != nil { - return x.InstanceType - } - return InstanceSpec_TYPE_UNSPECIFIED -} - -func (x *JobRunInputRequest) GetJobrunId() string { - if x != nil { - return x.JobrunId - } - return "" -} - -type JobRunRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` - StartDate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` - EndDate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` - Filter []string `protobuf:"bytes,5,rep,name=filter,proto3" json:"filter,omitempty"` -} - -func (x *JobRunRequest) Reset() { - *x = JobRunRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JobRunRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobRunRequest) ProtoMessage() {} - -func (x *JobRunRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 JobRunRequest.ProtoReflect.Descriptor instead. -func (*JobRunRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{5} -} - -func (x *JobRunRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *JobRunRequest) GetJobName() string { - if x != nil { - return x.JobName - } - return "" -} - -func (x *JobRunRequest) GetStartDate() *timestamppb.Timestamp { - if x != nil { - return x.StartDate - } - return nil -} - -func (x *JobRunRequest) GetEndDate() *timestamppb.Timestamp { - if x != nil { - return x.EndDate - } - return nil -} - -func (x *JobRunRequest) GetFilter() []string { - if x != nil { - return x.Filter - } - return nil -} - -type JobRunResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - JobRuns []*JobRun `protobuf:"bytes,1,rep,name=job_runs,json=jobRuns,proto3" json:"job_runs,omitempty"` -} - -func (x *JobRunResponse) Reset() { - *x = JobRunResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JobRunResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobRunResponse) ProtoMessage() {} - -func (x *JobRunResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 JobRunResponse.ProtoReflect.Descriptor instead. -func (*JobRunResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{6} -} - -func (x *JobRunResponse) GetJobRuns() []*JobRun { - if x != nil { - return x.JobRuns - } - return nil -} - -type InstanceSpec struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - State string `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` - Data []*InstanceSpecData `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"` - ExecutedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` - Type InstanceSpec_Type `protobuf:"varint,7,opt,name=type,proto3,enum=odpf.optimus.core.v1beta1.InstanceSpec_Type" json:"type,omitempty"` -} - -func (x *InstanceSpec) Reset() { - *x = InstanceSpec{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InstanceSpec) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InstanceSpec) ProtoMessage() {} - -func (x *InstanceSpec) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 InstanceSpec.ProtoReflect.Descriptor instead. -func (*InstanceSpec) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{7} -} - -func (x *InstanceSpec) GetState() string { - if x != nil { - return x.State - } - return "" -} - -func (x *InstanceSpec) GetData() []*InstanceSpecData { - if x != nil { - return x.Data - } - return nil -} - -func (x *InstanceSpec) GetExecutedAt() *timestamppb.Timestamp { - if x != nil { - return x.ExecutedAt - } - return nil -} - -func (x *InstanceSpec) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *InstanceSpec) GetType() InstanceSpec_Type { - if x != nil { - return x.Type - } - return InstanceSpec_TYPE_UNSPECIFIED -} - -type InstanceSpecData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Type InstanceSpecData_Type `protobuf:"varint,5,opt,name=type,proto3,enum=odpf.optimus.core.v1beta1.InstanceSpecData_Type" json:"type,omitempty"` -} - -func (x *InstanceSpecData) Reset() { - *x = InstanceSpecData{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InstanceSpecData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InstanceSpecData) ProtoMessage() {} - -func (x *InstanceSpecData) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 InstanceSpecData.ProtoReflect.Descriptor instead. -func (*InstanceSpecData) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{8} -} - -func (x *InstanceSpecData) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *InstanceSpecData) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *InstanceSpecData) GetType() InstanceSpecData_Type { - if x != nil { - return x.Type - } - return InstanceSpecData_TYPE_UNSPECIFIED -} - -type JobRunInputResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Envs map[string]string `protobuf:"bytes,1,rep,name=envs,proto3" json:"envs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Files map[string]string `protobuf:"bytes,2,rep,name=files,proto3" json:"files,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Secrets map[string]string `protobuf:"bytes,3,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *JobRunInputResponse) Reset() { - *x = JobRunInputResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JobRunInputResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JobRunInputResponse) ProtoMessage() {} - -func (x *JobRunInputResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 JobRunInputResponse.ProtoReflect.Descriptor instead. -func (*JobRunInputResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{9} -} - -func (x *JobRunInputResponse) GetEnvs() map[string]string { - if x != nil { - return x.Envs - } - return nil -} - -func (x *JobRunInputResponse) GetFiles() map[string]string { - if x != nil { - return x.Files - } - return nil -} - -func (x *JobRunInputResponse) GetSecrets() map[string]string { - if x != nil { - return x.Secrets - } - return nil -} - -type TaskWindow struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Size *durationpb.Duration `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"` - Offset *durationpb.Duration `protobuf:"bytes,2,opt,name=offset,proto3" json:"offset,omitempty"` - TruncateTo string `protobuf:"bytes,3,opt,name=truncate_to,json=truncateTo,proto3" json:"truncate_to,omitempty"` -} - -func (x *TaskWindow) Reset() { - *x = TaskWindow{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TaskWindow) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TaskWindow) ProtoMessage() {} - -func (x *TaskWindow) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_run_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 TaskWindow.ProtoReflect.Descriptor instead. -func (*TaskWindow) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{10} -} - -func (x *TaskWindow) GetSize() *durationpb.Duration { - if x != nil { - return x.Size - } - return nil -} - -func (x *TaskWindow) GetOffset() *durationpb.Duration { - if x != nil { - return x.Offset - } - return nil -} - -func (x *TaskWindow) GetTruncateTo() string { - if x != nil { - return x.TruncateTo - } - return "" -} - -var File_odpf_optimus_core_v1beta1_job_run_proto protoreflect.FileDescriptor - -var file_odpf_optimus_core_v1beta1_job_run_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6a, 0x6f, 0x62, 0x5f, - 0x72, 0x75, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6a, - 0x6f, 0x62, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, - 0x18, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x6f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x0e, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x58, 0x0a, 0x19, 0x55, - 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x6f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x17, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x22, 0x1a, 0x0a, 0x18, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4a, 0x6f, 0x62, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xac, 0x02, - 0x0a, 0x12, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x41, - 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x6f, 0x62, - 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x6f, - 0x62, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xd7, 0x01, 0x0a, - 0x0d, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x64, - 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x4e, 0x0a, 0x0e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, - 0x72, 0x75, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x52, 0x07, 0x6a, - 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x73, 0x22, 0xc0, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x74, 0x61, - 0x6e, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3f, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x53, 0x70, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3b, - 0x0a, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x40, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x22, 0x3a, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x10, 0x01, 0x12, 0x0d, - 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x4f, 0x4f, 0x4b, 0x10, 0x02, 0x4a, 0x04, 0x08, - 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0xc9, 0x01, 0x0a, 0x10, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x44, - 0x61, 0x74, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x39, - 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x56, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, - 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0xba, 0x03, 0x0a, 0x13, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, - 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, - 0x04, 0x65, 0x6e, 0x76, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, - 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x45, 0x6e, 0x76, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x76, 0x73, 0x12, 0x4f, 0x0a, 0x05, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, - 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x07, - 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, - 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x65, - 0x63, 0x72, 0x65, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x45, 0x6e, 0x76, 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, 0x1a, 0x38, 0x0a, 0x0a, - 0x46, 0x69, 0x6c, 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, 0x1a, 0x3a, 0x0a, 0x0c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, - 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, 0x8f, 0x01, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x57, 0x69, 0x6e, 0x64, 0x6f, - 0x77, 0x12, 0x2d, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, - 0x12, 0x31, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x66, 0x66, - 0x73, 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x5f, - 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, - 0x74, 0x65, 0x54, 0x6f, 0x32, 0xed, 0x05, 0x0a, 0x0d, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xb1, 0x01, 0x0a, 0x0b, 0x4a, 0x6f, 0x62, 0x52, 0x75, - 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x22, 0x38, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, - 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, - 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x75, - 0x6e, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x99, 0x01, 0x0a, 0x06, 0x4a, - 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x12, 0x28, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x29, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, - 0x75, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x34, 0x12, 0x32, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x7d, 0x2f, 0x72, 0x75, 0x6e, 0x12, 0xd7, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x32, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x33, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x54, 0x22, 0x4f, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, - 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3a, 0x01, 0x2a, - 0x12, 0xb1, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x6f, 0x53, 0x63, 0x68, - 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x33, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x6f, 0x53, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x6f, - 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x1a, 0x26, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x3a, 0x01, 0x2a, 0x42, 0x87, 0x01, 0x0a, 0x16, 0x69, 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, - 0x0d, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, - 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, - 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x92, 0x41, 0x3b, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, - 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, - 0x2a, 0x01, 0x01, 0x72, 0x19, 0x0a, 0x17, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x4a, - 0x6f, 0x62, 0x20, 0x52, 0x75, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_optimus_core_v1beta1_job_run_proto_rawDescOnce sync.Once - file_odpf_optimus_core_v1beta1_job_run_proto_rawDescData = file_odpf_optimus_core_v1beta1_job_run_proto_rawDesc -) - -func file_odpf_optimus_core_v1beta1_job_run_proto_rawDescGZIP() []byte { - file_odpf_optimus_core_v1beta1_job_run_proto_rawDescOnce.Do(func() { - file_odpf_optimus_core_v1beta1_job_run_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_core_v1beta1_job_run_proto_rawDescData) - }) - return file_odpf_optimus_core_v1beta1_job_run_proto_rawDescData -} - -var file_odpf_optimus_core_v1beta1_job_run_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_odpf_optimus_core_v1beta1_job_run_proto_goTypes = []interface{}{ - (InstanceSpec_Type)(0), // 0: odpf.optimus.core.v1beta1.InstanceSpec.Type - (InstanceSpecData_Type)(0), // 1: odpf.optimus.core.v1beta1.InstanceSpecData.Type - (*UploadToSchedulerRequest)(nil), // 2: odpf.optimus.core.v1beta1.UploadToSchedulerRequest - (*UploadToSchedulerResponse)(nil), // 3: odpf.optimus.core.v1beta1.UploadToSchedulerResponse - (*RegisterJobEventRequest)(nil), // 4: odpf.optimus.core.v1beta1.RegisterJobEventRequest - (*RegisterJobEventResponse)(nil), // 5: odpf.optimus.core.v1beta1.RegisterJobEventResponse - (*JobRunInputRequest)(nil), // 6: odpf.optimus.core.v1beta1.JobRunInputRequest - (*JobRunRequest)(nil), // 7: odpf.optimus.core.v1beta1.JobRunRequest - (*JobRunResponse)(nil), // 8: odpf.optimus.core.v1beta1.JobRunResponse - (*InstanceSpec)(nil), // 9: odpf.optimus.core.v1beta1.InstanceSpec - (*InstanceSpecData)(nil), // 10: odpf.optimus.core.v1beta1.InstanceSpecData - (*JobRunInputResponse)(nil), // 11: odpf.optimus.core.v1beta1.JobRunInputResponse - (*TaskWindow)(nil), // 12: odpf.optimus.core.v1beta1.TaskWindow - nil, // 13: odpf.optimus.core.v1beta1.JobRunInputResponse.EnvsEntry - nil, // 14: odpf.optimus.core.v1beta1.JobRunInputResponse.FilesEntry - nil, // 15: odpf.optimus.core.v1beta1.JobRunInputResponse.SecretsEntry - (*JobEvent)(nil), // 16: odpf.optimus.core.v1beta1.JobEvent - (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp - (*JobRun)(nil), // 18: odpf.optimus.core.v1beta1.JobRun - (*durationpb.Duration)(nil), // 19: google.protobuf.Duration -} -var file_odpf_optimus_core_v1beta1_job_run_proto_depIdxs = []int32{ - 16, // 0: odpf.optimus.core.v1beta1.RegisterJobEventRequest.event:type_name -> odpf.optimus.core.v1beta1.JobEvent - 17, // 1: odpf.optimus.core.v1beta1.JobRunInputRequest.scheduled_at:type_name -> google.protobuf.Timestamp - 0, // 2: odpf.optimus.core.v1beta1.JobRunInputRequest.instance_type:type_name -> odpf.optimus.core.v1beta1.InstanceSpec.Type - 17, // 3: odpf.optimus.core.v1beta1.JobRunRequest.start_date:type_name -> google.protobuf.Timestamp - 17, // 4: odpf.optimus.core.v1beta1.JobRunRequest.end_date:type_name -> google.protobuf.Timestamp - 18, // 5: odpf.optimus.core.v1beta1.JobRunResponse.job_runs:type_name -> odpf.optimus.core.v1beta1.JobRun - 10, // 6: odpf.optimus.core.v1beta1.InstanceSpec.data:type_name -> odpf.optimus.core.v1beta1.InstanceSpecData - 17, // 7: odpf.optimus.core.v1beta1.InstanceSpec.executed_at:type_name -> google.protobuf.Timestamp - 0, // 8: odpf.optimus.core.v1beta1.InstanceSpec.type:type_name -> odpf.optimus.core.v1beta1.InstanceSpec.Type - 1, // 9: odpf.optimus.core.v1beta1.InstanceSpecData.type:type_name -> odpf.optimus.core.v1beta1.InstanceSpecData.Type - 13, // 10: odpf.optimus.core.v1beta1.JobRunInputResponse.envs:type_name -> odpf.optimus.core.v1beta1.JobRunInputResponse.EnvsEntry - 14, // 11: odpf.optimus.core.v1beta1.JobRunInputResponse.files:type_name -> odpf.optimus.core.v1beta1.JobRunInputResponse.FilesEntry - 15, // 12: odpf.optimus.core.v1beta1.JobRunInputResponse.secrets:type_name -> odpf.optimus.core.v1beta1.JobRunInputResponse.SecretsEntry - 19, // 13: odpf.optimus.core.v1beta1.TaskWindow.size:type_name -> google.protobuf.Duration - 19, // 14: odpf.optimus.core.v1beta1.TaskWindow.offset:type_name -> google.protobuf.Duration - 6, // 15: odpf.optimus.core.v1beta1.JobRunService.JobRunInput:input_type -> odpf.optimus.core.v1beta1.JobRunInputRequest - 7, // 16: odpf.optimus.core.v1beta1.JobRunService.JobRun:input_type -> odpf.optimus.core.v1beta1.JobRunRequest - 4, // 17: odpf.optimus.core.v1beta1.JobRunService.RegisterJobEvent:input_type -> odpf.optimus.core.v1beta1.RegisterJobEventRequest - 2, // 18: odpf.optimus.core.v1beta1.JobRunService.UploadToScheduler:input_type -> odpf.optimus.core.v1beta1.UploadToSchedulerRequest - 11, // 19: odpf.optimus.core.v1beta1.JobRunService.JobRunInput:output_type -> odpf.optimus.core.v1beta1.JobRunInputResponse - 8, // 20: odpf.optimus.core.v1beta1.JobRunService.JobRun:output_type -> odpf.optimus.core.v1beta1.JobRunResponse - 5, // 21: odpf.optimus.core.v1beta1.JobRunService.RegisterJobEvent:output_type -> odpf.optimus.core.v1beta1.RegisterJobEventResponse - 3, // 22: odpf.optimus.core.v1beta1.JobRunService.UploadToScheduler:output_type -> odpf.optimus.core.v1beta1.UploadToSchedulerResponse - 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 -} - -func init() { file_odpf_optimus_core_v1beta1_job_run_proto_init() } -func file_odpf_optimus_core_v1beta1_job_run_proto_init() { - if File_odpf_optimus_core_v1beta1_job_run_proto != nil { - return - } - file_odpf_optimus_core_v1beta1_job_spec_proto_init() - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UploadToSchedulerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UploadToSchedulerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterJobEventRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterJobEventResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JobRunInputRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JobRunRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JobRunResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InstanceSpec); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InstanceSpecData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JobRunInputResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TaskWindow); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes[0].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_odpf_optimus_core_v1beta1_job_run_proto_rawDesc, - NumEnums: 2, - NumMessages: 14, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_odpf_optimus_core_v1beta1_job_run_proto_goTypes, - DependencyIndexes: file_odpf_optimus_core_v1beta1_job_run_proto_depIdxs, - EnumInfos: file_odpf_optimus_core_v1beta1_job_run_proto_enumTypes, - MessageInfos: file_odpf_optimus_core_v1beta1_job_run_proto_msgTypes, - }.Build() - File_odpf_optimus_core_v1beta1_job_run_proto = out.File - file_odpf_optimus_core_v1beta1_job_run_proto_rawDesc = nil - file_odpf_optimus_core_v1beta1_job_run_proto_goTypes = nil - file_odpf_optimus_core_v1beta1_job_run_proto_depIdxs = nil -} diff --git a/protos/odpf/optimus/core/v1beta1/namespace.pb.go b/protos/odpf/optimus/core/v1beta1/namespace.pb.go deleted file mode 100644 index a7d245846b..0000000000 --- a/protos/odpf/optimus/core/v1beta1/namespace.pb.go +++ /dev/null @@ -1,649 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/core/v1beta1/namespace.proto - -package optimus - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - 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 RegisterProjectNamespaceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - Namespace *NamespaceSpecification `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` -} - -func (x *RegisterProjectNamespaceRequest) Reset() { - *x = RegisterProjectNamespaceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterProjectNamespaceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterProjectNamespaceRequest) ProtoMessage() {} - -func (x *RegisterProjectNamespaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_namespace_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 RegisterProjectNamespaceRequest.ProtoReflect.Descriptor instead. -func (*RegisterProjectNamespaceRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{0} -} - -func (x *RegisterProjectNamespaceRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *RegisterProjectNamespaceRequest) GetNamespace() *NamespaceSpecification { - if x != nil { - return x.Namespace - } - return nil -} - -type RegisterProjectNamespaceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *RegisterProjectNamespaceResponse) Reset() { - *x = RegisterProjectNamespaceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterProjectNamespaceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterProjectNamespaceResponse) ProtoMessage() {} - -func (x *RegisterProjectNamespaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_namespace_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 RegisterProjectNamespaceResponse.ProtoReflect.Descriptor instead. -func (*RegisterProjectNamespaceResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{1} -} - -func (x *RegisterProjectNamespaceResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *RegisterProjectNamespaceResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type ListProjectNamespacesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` -} - -func (x *ListProjectNamespacesRequest) Reset() { - *x = ListProjectNamespacesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListProjectNamespacesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListProjectNamespacesRequest) ProtoMessage() {} - -func (x *ListProjectNamespacesRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_namespace_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 ListProjectNamespacesRequest.ProtoReflect.Descriptor instead. -func (*ListProjectNamespacesRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{2} -} - -func (x *ListProjectNamespacesRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -type ListProjectNamespacesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespaces []*NamespaceSpecification `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces,omitempty"` -} - -func (x *ListProjectNamespacesResponse) Reset() { - *x = ListProjectNamespacesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListProjectNamespacesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListProjectNamespacesResponse) ProtoMessage() {} - -func (x *ListProjectNamespacesResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_namespace_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 ListProjectNamespacesResponse.ProtoReflect.Descriptor instead. -func (*ListProjectNamespacesResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{3} -} - -func (x *ListProjectNamespacesResponse) GetNamespaces() []*NamespaceSpecification { - if x != nil { - return x.Namespaces - } - return nil -} - -type GetNamespaceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` -} - -func (x *GetNamespaceRequest) Reset() { - *x = GetNamespaceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetNamespaceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNamespaceRequest) ProtoMessage() {} - -func (x *GetNamespaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_namespace_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 GetNamespaceRequest.ProtoReflect.Descriptor instead. -func (*GetNamespaceRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{4} -} - -func (x *GetNamespaceRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *GetNamespaceRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -type GetNamespaceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace *NamespaceSpecification `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` -} - -func (x *GetNamespaceResponse) Reset() { - *x = GetNamespaceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetNamespaceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNamespaceResponse) ProtoMessage() {} - -func (x *GetNamespaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_namespace_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 GetNamespaceResponse.ProtoReflect.Descriptor instead. -func (*GetNamespaceResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{5} -} - -func (x *GetNamespaceResponse) GetNamespace() *NamespaceSpecification { - if x != nil { - return x.Namespace - } - return nil -} - -type NamespaceSpecification struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Config map[string]string `protobuf:"bytes,2,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *NamespaceSpecification) Reset() { - *x = NamespaceSpecification{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamespaceSpecification) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamespaceSpecification) ProtoMessage() {} - -func (x *NamespaceSpecification) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_namespace_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 NamespaceSpecification.ProtoReflect.Descriptor instead. -func (*NamespaceSpecification) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{6} -} - -func (x *NamespaceSpecification) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamespaceSpecification) GetConfig() map[string]string { - if x != nil { - return x.Config - } - return nil -} - -var File_odpf_optimus_core_v1beta1_namespace_proto protoreflect.FileDescriptor - -var file_odpf_optimus_core_v1beta1_namespace_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, - 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x95, 0x01, 0x0a, 0x1f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4f, 0x0a, 0x09, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x56, 0x0a, 0x20, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x22, 0x41, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x72, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x13, 0x47, - 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x67, 0x0a, 0x14, - 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x16, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x55, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xd4, 0x04, 0x0a, 0x10, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xc9, 0x01, 0x0a, 0x18, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x3a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0xbd, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x73, 0x12, 0x37, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0xb3, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x3c, 0x12, 0x3a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0x93, 0x01, - 0x0a, 0x16, 0x69, 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x17, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x92, 0x41, 0x3d, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, - 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, - 0x61, 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x1b, 0x0a, 0x19, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_optimus_core_v1beta1_namespace_proto_rawDescOnce sync.Once - file_odpf_optimus_core_v1beta1_namespace_proto_rawDescData = file_odpf_optimus_core_v1beta1_namespace_proto_rawDesc -) - -func file_odpf_optimus_core_v1beta1_namespace_proto_rawDescGZIP() []byte { - file_odpf_optimus_core_v1beta1_namespace_proto_rawDescOnce.Do(func() { - file_odpf_optimus_core_v1beta1_namespace_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_core_v1beta1_namespace_proto_rawDescData) - }) - return file_odpf_optimus_core_v1beta1_namespace_proto_rawDescData -} - -var file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_odpf_optimus_core_v1beta1_namespace_proto_goTypes = []interface{}{ - (*RegisterProjectNamespaceRequest)(nil), // 0: odpf.optimus.core.v1beta1.RegisterProjectNamespaceRequest - (*RegisterProjectNamespaceResponse)(nil), // 1: odpf.optimus.core.v1beta1.RegisterProjectNamespaceResponse - (*ListProjectNamespacesRequest)(nil), // 2: odpf.optimus.core.v1beta1.ListProjectNamespacesRequest - (*ListProjectNamespacesResponse)(nil), // 3: odpf.optimus.core.v1beta1.ListProjectNamespacesResponse - (*GetNamespaceRequest)(nil), // 4: odpf.optimus.core.v1beta1.GetNamespaceRequest - (*GetNamespaceResponse)(nil), // 5: odpf.optimus.core.v1beta1.GetNamespaceResponse - (*NamespaceSpecification)(nil), // 6: odpf.optimus.core.v1beta1.NamespaceSpecification - nil, // 7: odpf.optimus.core.v1beta1.NamespaceSpecification.ConfigEntry -} -var file_odpf_optimus_core_v1beta1_namespace_proto_depIdxs = []int32{ - 6, // 0: odpf.optimus.core.v1beta1.RegisterProjectNamespaceRequest.namespace:type_name -> odpf.optimus.core.v1beta1.NamespaceSpecification - 6, // 1: odpf.optimus.core.v1beta1.ListProjectNamespacesResponse.namespaces:type_name -> odpf.optimus.core.v1beta1.NamespaceSpecification - 6, // 2: odpf.optimus.core.v1beta1.GetNamespaceResponse.namespace:type_name -> odpf.optimus.core.v1beta1.NamespaceSpecification - 7, // 3: odpf.optimus.core.v1beta1.NamespaceSpecification.config:type_name -> odpf.optimus.core.v1beta1.NamespaceSpecification.ConfigEntry - 0, // 4: odpf.optimus.core.v1beta1.NamespaceService.RegisterProjectNamespace:input_type -> odpf.optimus.core.v1beta1.RegisterProjectNamespaceRequest - 2, // 5: odpf.optimus.core.v1beta1.NamespaceService.ListProjectNamespaces:input_type -> odpf.optimus.core.v1beta1.ListProjectNamespacesRequest - 4, // 6: odpf.optimus.core.v1beta1.NamespaceService.GetNamespace:input_type -> odpf.optimus.core.v1beta1.GetNamespaceRequest - 1, // 7: odpf.optimus.core.v1beta1.NamespaceService.RegisterProjectNamespace:output_type -> odpf.optimus.core.v1beta1.RegisterProjectNamespaceResponse - 3, // 8: odpf.optimus.core.v1beta1.NamespaceService.ListProjectNamespaces:output_type -> odpf.optimus.core.v1beta1.ListProjectNamespacesResponse - 5, // 9: odpf.optimus.core.v1beta1.NamespaceService.GetNamespace:output_type -> odpf.optimus.core.v1beta1.GetNamespaceResponse - 7, // [7:10] is the sub-list for method output_type - 4, // [4:7] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_odpf_optimus_core_v1beta1_namespace_proto_init() } -func file_odpf_optimus_core_v1beta1_namespace_proto_init() { - if File_odpf_optimus_core_v1beta1_namespace_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterProjectNamespaceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterProjectNamespaceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListProjectNamespacesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListProjectNamespacesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetNamespaceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetNamespaceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamespaceSpecification); 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_odpf_optimus_core_v1beta1_namespace_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_odpf_optimus_core_v1beta1_namespace_proto_goTypes, - DependencyIndexes: file_odpf_optimus_core_v1beta1_namespace_proto_depIdxs, - MessageInfos: file_odpf_optimus_core_v1beta1_namespace_proto_msgTypes, - }.Build() - File_odpf_optimus_core_v1beta1_namespace_proto = out.File - file_odpf_optimus_core_v1beta1_namespace_proto_rawDesc = nil - file_odpf_optimus_core_v1beta1_namespace_proto_goTypes = nil - file_odpf_optimus_core_v1beta1_namespace_proto_depIdxs = nil -} diff --git a/protos/odpf/optimus/core/v1beta1/project.pb.go b/protos/odpf/optimus/core/v1beta1/project.pb.go deleted file mode 100644 index e2dc743e36..0000000000 --- a/protos/odpf/optimus/core/v1beta1/project.pb.go +++ /dev/null @@ -1,691 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/core/v1beta1/project.proto - -package optimus - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - 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 RegisterProjectRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Project *ProjectSpecification `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` -} - -func (x *RegisterProjectRequest) Reset() { - *x = RegisterProjectRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_project_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterProjectRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterProjectRequest) ProtoMessage() {} - -func (x *RegisterProjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_project_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 RegisterProjectRequest.ProtoReflect.Descriptor instead. -func (*RegisterProjectRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{0} -} - -func (x *RegisterProjectRequest) GetProject() *ProjectSpecification { - if x != nil { - return x.Project - } - return nil -} - -type RegisterProjectResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *RegisterProjectResponse) Reset() { - *x = RegisterProjectResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_project_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterProjectResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterProjectResponse) ProtoMessage() {} - -func (x *RegisterProjectResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_project_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 RegisterProjectResponse.ProtoReflect.Descriptor instead. -func (*RegisterProjectResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{1} -} - -func (x *RegisterProjectResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *RegisterProjectResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type ListProjectsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ListProjectsRequest) Reset() { - *x = ListProjectsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_project_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListProjectsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListProjectsRequest) ProtoMessage() {} - -func (x *ListProjectsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_project_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 ListProjectsRequest.ProtoReflect.Descriptor instead. -func (*ListProjectsRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{2} -} - -type ListProjectsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Projects []*ProjectSpecification `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"` -} - -func (x *ListProjectsResponse) Reset() { - *x = ListProjectsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_project_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListProjectsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListProjectsResponse) ProtoMessage() {} - -func (x *ListProjectsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_project_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 ListProjectsResponse.ProtoReflect.Descriptor instead. -func (*ListProjectsResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{3} -} - -func (x *ListProjectsResponse) GetProjects() []*ProjectSpecification { - if x != nil { - return x.Projects - } - return nil -} - -type GetProjectRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` -} - -func (x *GetProjectRequest) Reset() { - *x = GetProjectRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_project_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetProjectRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetProjectRequest) ProtoMessage() {} - -func (x *GetProjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_project_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 GetProjectRequest.ProtoReflect.Descriptor instead. -func (*GetProjectRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{4} -} - -func (x *GetProjectRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -type GetProjectResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Project *ProjectSpecification `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` -} - -func (x *GetProjectResponse) Reset() { - *x = GetProjectResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_project_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetProjectResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetProjectResponse) ProtoMessage() {} - -func (x *GetProjectResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_project_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 GetProjectResponse.ProtoReflect.Descriptor instead. -func (*GetProjectResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{5} -} - -func (x *GetProjectResponse) GetProject() *ProjectSpecification { - if x != nil { - return x.Project - } - return nil -} - -type ProjectSpecification struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Config map[string]string `protobuf:"bytes,2,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Secrets []*ProjectSpecification_ProjectSecret `protobuf:"bytes,3,rep,name=secrets,proto3" json:"secrets,omitempty"` -} - -func (x *ProjectSpecification) Reset() { - *x = ProjectSpecification{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_project_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProjectSpecification) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProjectSpecification) ProtoMessage() {} - -func (x *ProjectSpecification) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_project_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 ProjectSpecification.ProtoReflect.Descriptor instead. -func (*ProjectSpecification) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{6} -} - -func (x *ProjectSpecification) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ProjectSpecification) GetConfig() map[string]string { - if x != nil { - return x.Config - } - return nil -} - -func (x *ProjectSpecification) GetSecrets() []*ProjectSpecification_ProjectSecret { - if x != nil { - return x.Secrets - } - return nil -} - -type ProjectSpecification_ProjectSecret struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *ProjectSpecification_ProjectSecret) Reset() { - *x = ProjectSpecification_ProjectSecret{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_project_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProjectSpecification_ProjectSecret) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProjectSpecification_ProjectSecret) ProtoMessage() {} - -func (x *ProjectSpecification_ProjectSecret) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_project_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 ProjectSpecification_ProjectSecret.ProtoReflect.Descriptor instead. -func (*ProjectSpecification_ProjectSecret) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{6, 1} -} - -func (x *ProjectSpecification_ProjectSecret) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ProjectSpecification_ProjectSecret) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -var File_odpf_optimus_core_v1beta1_project_proto protoreflect.FileDescriptor - -var file_odpf_optimus_core_v1beta1_project_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x69, 0x0a, 0x16, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x07, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x4d, 0x0a, - 0x17, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x15, 0x0a, 0x13, - 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x63, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x36, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, - 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x22, 0x5f, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x22, 0xce, 0x02, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x53, - 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x57, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x52, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x1a, 0x39, 0x0a, 0x0b, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x32, 0xc9, 0x03, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x95, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x31, 0x2e, 0x6f, 0x64, 0x70, 0x66, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x89, 0x01, - 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x2e, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x92, 0x01, 0x0a, 0x0a, 0x47, 0x65, - 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, - 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0x8f, - 0x01, 0x0a, 0x16, 0x69, 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x15, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, - 0x64, 0x70, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x92, 0x41, 0x3b, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, - 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, - 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x19, 0x0a, 0x17, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_optimus_core_v1beta1_project_proto_rawDescOnce sync.Once - file_odpf_optimus_core_v1beta1_project_proto_rawDescData = file_odpf_optimus_core_v1beta1_project_proto_rawDesc -) - -func file_odpf_optimus_core_v1beta1_project_proto_rawDescGZIP() []byte { - file_odpf_optimus_core_v1beta1_project_proto_rawDescOnce.Do(func() { - file_odpf_optimus_core_v1beta1_project_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_core_v1beta1_project_proto_rawDescData) - }) - return file_odpf_optimus_core_v1beta1_project_proto_rawDescData -} - -var file_odpf_optimus_core_v1beta1_project_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_odpf_optimus_core_v1beta1_project_proto_goTypes = []interface{}{ - (*RegisterProjectRequest)(nil), // 0: odpf.optimus.core.v1beta1.RegisterProjectRequest - (*RegisterProjectResponse)(nil), // 1: odpf.optimus.core.v1beta1.RegisterProjectResponse - (*ListProjectsRequest)(nil), // 2: odpf.optimus.core.v1beta1.ListProjectsRequest - (*ListProjectsResponse)(nil), // 3: odpf.optimus.core.v1beta1.ListProjectsResponse - (*GetProjectRequest)(nil), // 4: odpf.optimus.core.v1beta1.GetProjectRequest - (*GetProjectResponse)(nil), // 5: odpf.optimus.core.v1beta1.GetProjectResponse - (*ProjectSpecification)(nil), // 6: odpf.optimus.core.v1beta1.ProjectSpecification - nil, // 7: odpf.optimus.core.v1beta1.ProjectSpecification.ConfigEntry - (*ProjectSpecification_ProjectSecret)(nil), // 8: odpf.optimus.core.v1beta1.ProjectSpecification.ProjectSecret -} -var file_odpf_optimus_core_v1beta1_project_proto_depIdxs = []int32{ - 6, // 0: odpf.optimus.core.v1beta1.RegisterProjectRequest.project:type_name -> odpf.optimus.core.v1beta1.ProjectSpecification - 6, // 1: odpf.optimus.core.v1beta1.ListProjectsResponse.projects:type_name -> odpf.optimus.core.v1beta1.ProjectSpecification - 6, // 2: odpf.optimus.core.v1beta1.GetProjectResponse.project:type_name -> odpf.optimus.core.v1beta1.ProjectSpecification - 7, // 3: odpf.optimus.core.v1beta1.ProjectSpecification.config:type_name -> odpf.optimus.core.v1beta1.ProjectSpecification.ConfigEntry - 8, // 4: odpf.optimus.core.v1beta1.ProjectSpecification.secrets:type_name -> odpf.optimus.core.v1beta1.ProjectSpecification.ProjectSecret - 0, // 5: odpf.optimus.core.v1beta1.ProjectService.RegisterProject:input_type -> odpf.optimus.core.v1beta1.RegisterProjectRequest - 2, // 6: odpf.optimus.core.v1beta1.ProjectService.ListProjects:input_type -> odpf.optimus.core.v1beta1.ListProjectsRequest - 4, // 7: odpf.optimus.core.v1beta1.ProjectService.GetProject:input_type -> odpf.optimus.core.v1beta1.GetProjectRequest - 1, // 8: odpf.optimus.core.v1beta1.ProjectService.RegisterProject:output_type -> odpf.optimus.core.v1beta1.RegisterProjectResponse - 3, // 9: odpf.optimus.core.v1beta1.ProjectService.ListProjects:output_type -> odpf.optimus.core.v1beta1.ListProjectsResponse - 5, // 10: odpf.optimus.core.v1beta1.ProjectService.GetProject:output_type -> odpf.optimus.core.v1beta1.GetProjectResponse - 8, // [8:11] is the sub-list for method output_type - 5, // [5:8] 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_odpf_optimus_core_v1beta1_project_proto_init() } -func file_odpf_optimus_core_v1beta1_project_proto_init() { - if File_odpf_optimus_core_v1beta1_project_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_core_v1beta1_project_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterProjectRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_project_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterProjectResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_project_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListProjectsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_project_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListProjectsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_project_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetProjectRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_project_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetProjectResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_project_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProjectSpecification); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_project_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProjectSpecification_ProjectSecret); 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_odpf_optimus_core_v1beta1_project_proto_rawDesc, - NumEnums: 0, - NumMessages: 9, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_odpf_optimus_core_v1beta1_project_proto_goTypes, - DependencyIndexes: file_odpf_optimus_core_v1beta1_project_proto_depIdxs, - MessageInfos: file_odpf_optimus_core_v1beta1_project_proto_msgTypes, - }.Build() - File_odpf_optimus_core_v1beta1_project_proto = out.File - file_odpf_optimus_core_v1beta1_project_proto_rawDesc = nil - file_odpf_optimus_core_v1beta1_project_proto_goTypes = nil - file_odpf_optimus_core_v1beta1_project_proto_depIdxs = nil -} diff --git a/protos/odpf/optimus/core/v1beta1/replay.pb.go b/protos/odpf/optimus/core/v1beta1/replay.pb.go deleted file mode 100644 index 9604a6e3f0..0000000000 --- a/protos/odpf/optimus/core/v1beta1/replay.pb.go +++ /dev/null @@ -1,314 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/core/v1beta1/replay.proto - -package optimus - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - 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 ReplayRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` - NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` - StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - EndTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` - Parallel bool `protobuf:"varint,6,opt,name=parallel,proto3" json:"parallel,omitempty"` - Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` - JobConfig string `protobuf:"bytes,8,opt,name=job_config,json=jobConfig,proto3" json:"job_config,omitempty"` -} - -func (x *ReplayRequest) Reset() { - *x = ReplayRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_replay_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReplayRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReplayRequest) ProtoMessage() {} - -func (x *ReplayRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_replay_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 ReplayRequest.ProtoReflect.Descriptor instead. -func (*ReplayRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{0} -} - -func (x *ReplayRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *ReplayRequest) GetJobName() string { - if x != nil { - return x.JobName - } - return "" -} - -func (x *ReplayRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -func (x *ReplayRequest) GetStartTime() *timestamppb.Timestamp { - if x != nil { - return x.StartTime - } - return nil -} - -func (x *ReplayRequest) GetEndTime() *timestamppb.Timestamp { - if x != nil { - return x.EndTime - } - return nil -} - -func (x *ReplayRequest) GetParallel() bool { - if x != nil { - return x.Parallel - } - return false -} - -func (x *ReplayRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *ReplayRequest) GetJobConfig() string { - if x != nil { - return x.JobConfig - } - return "" -} - -type ReplayResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *ReplayResponse) Reset() { - *x = ReplayResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_replay_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReplayResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReplayResponse) ProtoMessage() {} - -func (x *ReplayResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_replay_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 ReplayResponse.ProtoReflect.Descriptor instead. -func (*ReplayResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{1} -} - -func (x *ReplayResponse) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -var File_odpf_optimus_core_v1beta1_replay_proto protoreflect.FileDescriptor - -var file_odpf_optimus_core_v1beta1_replay_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x70, 0x6c, - 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xc3, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x70, - 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x6f, 0x62, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, - 0x6f, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x20, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6c, - 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x32, 0xa2, 0x01, 0x0a, 0x0d, 0x52, - 0x65, 0x70, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x90, 0x01, 0x0a, - 0x06, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x28, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x29, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2b, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x01, 0x2a, 0x42, - 0x8d, 0x01, 0x0a, 0x16, 0x69, 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x14, 0x52, 0x65, 0x70, 0x6c, - 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, - 0x64, 0x70, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x92, 0x41, 0x3a, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, - 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, - 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x18, 0x0a, 0x16, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x20, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_optimus_core_v1beta1_replay_proto_rawDescOnce sync.Once - file_odpf_optimus_core_v1beta1_replay_proto_rawDescData = file_odpf_optimus_core_v1beta1_replay_proto_rawDesc -) - -func file_odpf_optimus_core_v1beta1_replay_proto_rawDescGZIP() []byte { - file_odpf_optimus_core_v1beta1_replay_proto_rawDescOnce.Do(func() { - file_odpf_optimus_core_v1beta1_replay_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_core_v1beta1_replay_proto_rawDescData) - }) - return file_odpf_optimus_core_v1beta1_replay_proto_rawDescData -} - -var file_odpf_optimus_core_v1beta1_replay_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_odpf_optimus_core_v1beta1_replay_proto_goTypes = []interface{}{ - (*ReplayRequest)(nil), // 0: odpf.optimus.core.v1beta1.ReplayRequest - (*ReplayResponse)(nil), // 1: odpf.optimus.core.v1beta1.ReplayResponse - (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp -} -var file_odpf_optimus_core_v1beta1_replay_proto_depIdxs = []int32{ - 2, // 0: odpf.optimus.core.v1beta1.ReplayRequest.start_time:type_name -> google.protobuf.Timestamp - 2, // 1: odpf.optimus.core.v1beta1.ReplayRequest.end_time:type_name -> google.protobuf.Timestamp - 0, // 2: odpf.optimus.core.v1beta1.ReplayService.Replay:input_type -> odpf.optimus.core.v1beta1.ReplayRequest - 1, // 3: odpf.optimus.core.v1beta1.ReplayService.Replay:output_type -> odpf.optimus.core.v1beta1.ReplayResponse - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_odpf_optimus_core_v1beta1_replay_proto_init() } -func file_odpf_optimus_core_v1beta1_replay_proto_init() { - if File_odpf_optimus_core_v1beta1_replay_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_core_v1beta1_replay_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReplayRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_replay_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReplayResponse); 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_odpf_optimus_core_v1beta1_replay_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_odpf_optimus_core_v1beta1_replay_proto_goTypes, - DependencyIndexes: file_odpf_optimus_core_v1beta1_replay_proto_depIdxs, - MessageInfos: file_odpf_optimus_core_v1beta1_replay_proto_msgTypes, - }.Build() - File_odpf_optimus_core_v1beta1_replay_proto = out.File - file_odpf_optimus_core_v1beta1_replay_proto_rawDesc = nil - file_odpf_optimus_core_v1beta1_replay_proto_goTypes = nil - file_odpf_optimus_core_v1beta1_replay_proto_depIdxs = nil -} diff --git a/protos/odpf/optimus/core/v1beta1/replay.pb.gw.go b/protos/odpf/optimus/core/v1beta1/replay.pb.gw.go deleted file mode 100644 index 9d75015115..0000000000 --- a/protos/odpf/optimus/core/v1beta1/replay.pb.gw.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: odpf/optimus/core/v1beta1/replay.proto - -/* -Package optimus is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package optimus - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join - -func request_ReplayService_Replay_0(ctx context.Context, marshaler runtime.Marshaler, client ReplayServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReplayRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["project_name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") - } - - protoReq.ProjectName, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) - } - - msg, err := client.Replay(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReplayService_Replay_0(ctx context.Context, marshaler runtime.Marshaler, server ReplayServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReplayRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["project_name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") - } - - protoReq.ProjectName, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) - } - - msg, err := server.Replay(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterReplayServiceHandlerServer registers the http handlers for service ReplayService to "mux". -// UnaryRPC :call ReplayServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterReplayServiceHandlerFromEndpoint instead. -func RegisterReplayServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReplayServiceServer) error { - - mux.Handle("POST", pattern_ReplayService_Replay_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ReplayService/Replay", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/replay")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReplayService_Replay_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReplayService_Replay_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterReplayServiceHandlerFromEndpoint is same as RegisterReplayServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterReplayServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterReplayServiceHandler(ctx, mux, conn) -} - -// RegisterReplayServiceHandler registers the http handlers for service ReplayService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterReplayServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterReplayServiceHandlerClient(ctx, mux, NewReplayServiceClient(conn)) -} - -// RegisterReplayServiceHandlerClient registers the http handlers for service ReplayService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ReplayServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ReplayServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ReplayServiceClient" to call the correct interceptors. -func RegisterReplayServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReplayServiceClient) error { - - mux.Handle("POST", pattern_ReplayService_Replay_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ReplayService/Replay", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/replay")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReplayService_Replay_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReplayService_Replay_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_ReplayService_Replay_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "project", "project_name", "replay"}, "")) -) - -var ( - forward_ReplayService_Replay_0 = runtime.ForwardResponseMessage -) diff --git a/protos/odpf/optimus/core/v1beta1/replay.swagger.json b/protos/odpf/optimus/core/v1beta1/replay.swagger.json deleted file mode 100644 index 51651331e6..0000000000 --- a/protos/odpf/optimus/core/v1beta1/replay.swagger.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "odpf/optimus/core/v1beta1/replay.proto", - "version": "0.1" - }, - "tags": [ - { - "name": "ReplayService" - } - ], - "host": "127.0.0.1:9100", - "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1beta1/project/{projectName}/replay": { - "post": { - "operationId": "ReplayService_Replay", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1beta1ReplayResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "projectName", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "jobName": { - "type": "string" - }, - "namespaceName": { - "type": "string" - }, - "startTime": { - "type": "string", - "format": "date-time" - }, - "endTime": { - "type": "string", - "format": "date-time" - }, - "parallel": { - "type": "boolean" - }, - "description": { - "type": "string" - }, - "jobConfig": { - "type": "string" - } - } - } - } - ], - "tags": [ - "ReplayService" - ] - } - } - }, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string" - }, - "value": { - "type": "string", - "format": "byte" - } - } - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1beta1ReplayResponse": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - } - }, - "externalDocs": { - "description": "Optimus Replay Service" - } -} diff --git a/protos/odpf/optimus/core/v1beta1/replay_grpc.pb.go b/protos/odpf/optimus/core/v1beta1/replay_grpc.pb.go deleted file mode 100644 index cc9b7a2cbe..0000000000 --- a/protos/odpf/optimus/core/v1beta1/replay_grpc.pb.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: odpf/optimus/core/v1beta1/replay.proto - -package optimus - -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 - -// ReplayServiceClient is the client API for ReplayService 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 ReplayServiceClient interface { - Replay(ctx context.Context, in *ReplayRequest, opts ...grpc.CallOption) (*ReplayResponse, error) -} - -type replayServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewReplayServiceClient(cc grpc.ClientConnInterface) ReplayServiceClient { - return &replayServiceClient{cc} -} - -func (c *replayServiceClient) Replay(ctx context.Context, in *ReplayRequest, opts ...grpc.CallOption) (*ReplayResponse, error) { - out := new(ReplayResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.ReplayService/Replay", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ReplayServiceServer is the server API for ReplayService service. -// All implementations must embed UnimplementedReplayServiceServer -// for forward compatibility -type ReplayServiceServer interface { - Replay(context.Context, *ReplayRequest) (*ReplayResponse, error) - mustEmbedUnimplementedReplayServiceServer() -} - -// UnimplementedReplayServiceServer must be embedded to have forward compatible implementations. -type UnimplementedReplayServiceServer struct { -} - -func (UnimplementedReplayServiceServer) Replay(context.Context, *ReplayRequest) (*ReplayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Replay not implemented") -} -func (UnimplementedReplayServiceServer) mustEmbedUnimplementedReplayServiceServer() {} - -// UnsafeReplayServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ReplayServiceServer will -// result in compilation errors. -type UnsafeReplayServiceServer interface { - mustEmbedUnimplementedReplayServiceServer() -} - -func RegisterReplayServiceServer(s grpc.ServiceRegistrar, srv ReplayServiceServer) { - s.RegisterService(&ReplayService_ServiceDesc, srv) -} - -func _ReplayService_Replay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReplayRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReplayServiceServer).Replay(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.ReplayService/Replay", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReplayServiceServer).Replay(ctx, req.(*ReplayRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ReplayService_ServiceDesc is the grpc.ServiceDesc for ReplayService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ReplayService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "odpf.optimus.core.v1beta1.ReplayService", - HandlerType: (*ReplayServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Replay", - Handler: _ReplayService_Replay_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "odpf/optimus/core/v1beta1/replay.proto", -} diff --git a/protos/odpf/optimus/core/v1beta1/resource.pb.go b/protos/odpf/optimus/core/v1beta1/resource.pb.go deleted file mode 100644 index f552f76677..0000000000 --- a/protos/odpf/optimus/core/v1beta1/resource.pb.go +++ /dev/null @@ -1,1167 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/core/v1beta1/resource.proto - -package optimus - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - structpb "google.golang.org/protobuf/types/known/structpb" - reflect "reflect" - sync "sync" -) - -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 DeployResourceSpecificationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` - Resources []*ResourceSpecification `protobuf:"bytes,3,rep,name=resources,proto3" json:"resources,omitempty"` - NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` -} - -func (x *DeployResourceSpecificationRequest) Reset() { - *x = DeployResourceSpecificationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeployResourceSpecificationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeployResourceSpecificationRequest) ProtoMessage() {} - -func (x *DeployResourceSpecificationRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 DeployResourceSpecificationRequest.ProtoReflect.Descriptor instead. -func (*DeployResourceSpecificationRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{0} -} - -func (x *DeployResourceSpecificationRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *DeployResourceSpecificationRequest) GetDatastoreName() string { - if x != nil { - return x.DatastoreName - } - return "" -} - -func (x *DeployResourceSpecificationRequest) GetResources() []*ResourceSpecification { - if x != nil { - return x.Resources - } - return nil -} - -func (x *DeployResourceSpecificationRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -type DeployResourceSpecificationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogStatus *Log `protobuf:"bytes,5,opt,name=log_status,json=logStatus,proto3" json:"log_status,omitempty"` -} - -func (x *DeployResourceSpecificationResponse) Reset() { - *x = DeployResourceSpecificationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeployResourceSpecificationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeployResourceSpecificationResponse) ProtoMessage() {} - -func (x *DeployResourceSpecificationResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 DeployResourceSpecificationResponse.ProtoReflect.Descriptor instead. -func (*DeployResourceSpecificationResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{1} -} - -func (x *DeployResourceSpecificationResponse) GetLogStatus() *Log { - if x != nil { - return x.LogStatus - } - return nil -} - -// ListResourceSpecificationRequest lists all resource specifications of a datastore in project -type ListResourceSpecificationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` - NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` -} - -func (x *ListResourceSpecificationRequest) Reset() { - *x = ListResourceSpecificationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResourceSpecificationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResourceSpecificationRequest) ProtoMessage() {} - -func (x *ListResourceSpecificationRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 ListResourceSpecificationRequest.ProtoReflect.Descriptor instead. -func (*ListResourceSpecificationRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{2} -} - -func (x *ListResourceSpecificationRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *ListResourceSpecificationRequest) GetDatastoreName() string { - if x != nil { - return x.DatastoreName - } - return "" -} - -func (x *ListResourceSpecificationRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -type ListResourceSpecificationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Resources []*ResourceSpecification `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` -} - -func (x *ListResourceSpecificationResponse) Reset() { - *x = ListResourceSpecificationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResourceSpecificationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResourceSpecificationResponse) ProtoMessage() {} - -func (x *ListResourceSpecificationResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 ListResourceSpecificationResponse.ProtoReflect.Descriptor instead. -func (*ListResourceSpecificationResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{3} -} - -func (x *ListResourceSpecificationResponse) GetResources() []*ResourceSpecification { - if x != nil { - return x.Resources - } - return nil -} - -type CreateResourceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` - Resource *ResourceSpecification `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` - NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` -} - -func (x *CreateResourceRequest) Reset() { - *x = CreateResourceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateResourceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateResourceRequest) ProtoMessage() {} - -func (x *CreateResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 CreateResourceRequest.ProtoReflect.Descriptor instead. -func (*CreateResourceRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{4} -} - -func (x *CreateResourceRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *CreateResourceRequest) GetDatastoreName() string { - if x != nil { - return x.DatastoreName - } - return "" -} - -func (x *CreateResourceRequest) GetResource() *ResourceSpecification { - if x != nil { - return x.Resource - } - return nil -} - -func (x *CreateResourceRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -type CreateResourceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *CreateResourceResponse) Reset() { - *x = CreateResourceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateResourceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateResourceResponse) ProtoMessage() {} - -func (x *CreateResourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 CreateResourceResponse.ProtoReflect.Descriptor instead. -func (*CreateResourceResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{5} -} - -func (x *CreateResourceResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *CreateResourceResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type ReadResourceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` - ResourceName string `protobuf:"bytes,3,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` - NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` -} - -func (x *ReadResourceRequest) Reset() { - *x = ReadResourceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReadResourceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadResourceRequest) ProtoMessage() {} - -func (x *ReadResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 ReadResourceRequest.ProtoReflect.Descriptor instead. -func (*ReadResourceRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{6} -} - -func (x *ReadResourceRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *ReadResourceRequest) GetDatastoreName() string { - if x != nil { - return x.DatastoreName - } - return "" -} - -func (x *ReadResourceRequest) GetResourceName() string { - if x != nil { - return x.ResourceName - } - return "" -} - -func (x *ReadResourceRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -type ReadResourceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - Resource *ResourceSpecification `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (x *ReadResourceResponse) Reset() { - *x = ReadResourceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReadResourceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadResourceResponse) ProtoMessage() {} - -func (x *ReadResourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 ReadResourceResponse.ProtoReflect.Descriptor instead. -func (*ReadResourceResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{7} -} - -func (x *ReadResourceResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *ReadResourceResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *ReadResourceResponse) GetResource() *ResourceSpecification { - if x != nil { - return x.Resource - } - return nil -} - -type UpdateResourceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` - Resource *ResourceSpecification `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` - NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` -} - -func (x *UpdateResourceRequest) Reset() { - *x = UpdateResourceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateResourceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateResourceRequest) ProtoMessage() {} - -func (x *UpdateResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 UpdateResourceRequest.ProtoReflect.Descriptor instead. -func (*UpdateResourceRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{8} -} - -func (x *UpdateResourceRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *UpdateResourceRequest) GetDatastoreName() string { - if x != nil { - return x.DatastoreName - } - return "" -} - -func (x *UpdateResourceRequest) GetResource() *ResourceSpecification { - if x != nil { - return x.Resource - } - return nil -} - -func (x *UpdateResourceRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -type UpdateResourceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *UpdateResourceResponse) Reset() { - *x = UpdateResourceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateResourceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateResourceResponse) ProtoMessage() {} - -func (x *UpdateResourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 UpdateResourceResponse.ProtoReflect.Descriptor instead. -func (*UpdateResourceResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{9} -} - -func (x *UpdateResourceResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *UpdateResourceResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -// ResourceSpecification are datastore specification representation of a resource -type ResourceSpecification struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - Spec *structpb.Struct `protobuf:"bytes,5,opt,name=spec,proto3" json:"spec,omitempty"` - Assets map[string]string `protobuf:"bytes,6,rep,name=assets,proto3" json:"assets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *ResourceSpecification) Reset() { - *x = ResourceSpecification{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceSpecification) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceSpecification) ProtoMessage() {} - -func (x *ResourceSpecification) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_resource_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 ResourceSpecification.ProtoReflect.Descriptor instead. -func (*ResourceSpecification) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{10} -} - -func (x *ResourceSpecification) GetVersion() int32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *ResourceSpecification) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ResourceSpecification) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *ResourceSpecification) GetSpec() *structpb.Struct { - if x != nil { - return x.Spec - } - return nil -} - -func (x *ResourceSpecification) GetAssets() map[string]string { - if x != nil { - return x.Assets - } - return nil -} - -func (x *ResourceSpecification) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -var File_odpf_optimus_core_v1beta1_resource_proto protoreflect.FileDescriptor - -var file_odpf_optimus_core_v1beta1_resource_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x64, 0x70, 0x66, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x26, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe5, 0x01, 0x0a, 0x22, 0x44, 0x65, - 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, - 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4e, 0x0a, 0x09, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0x6a, 0x0a, 0x23, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x09, 0x6c, 0x6f, - 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x05, 0x22, 0x93, 0x01, - 0x0a, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, - 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x22, 0x73, 0x0a, 0x21, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0xd6, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, - 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0xab, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, - 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x98, 0x01, - 0x0a, 0x14, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xd6, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, - 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0x4c, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0xae, 0x03, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 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, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x73, - 0x70, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x54, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x54, - 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x41, 0x73, 0x73, 0x65, 0x74, 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, 0x1a, - 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, - 0x32, 0xe7, 0x08, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0xa2, 0x01, 0x0a, 0x1b, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, - 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0xfe, 0x01, 0x0a, 0x19, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x66, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x60, 0x12, 0x5e, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0xe0, 0x01, 0x0a, 0x0e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x30, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x31, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x69, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x63, 0x22, 0x5e, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0xe7, 0x01, - 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2e, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x76, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x70, 0x12, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, - 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0xe0, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x30, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x69, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x63, 0x1a, 0x5e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, - 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x42, 0x9c, 0x01, 0x0a, 0x16, 0x69, - 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, - 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, - 0x41, 0x47, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, - 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, - 0x01, 0x01, 0x72, 0x25, 0x0a, 0x23, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_odpf_optimus_core_v1beta1_resource_proto_rawDescOnce sync.Once - file_odpf_optimus_core_v1beta1_resource_proto_rawDescData = file_odpf_optimus_core_v1beta1_resource_proto_rawDesc -) - -func file_odpf_optimus_core_v1beta1_resource_proto_rawDescGZIP() []byte { - file_odpf_optimus_core_v1beta1_resource_proto_rawDescOnce.Do(func() { - file_odpf_optimus_core_v1beta1_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_core_v1beta1_resource_proto_rawDescData) - }) - return file_odpf_optimus_core_v1beta1_resource_proto_rawDescData -} - -var file_odpf_optimus_core_v1beta1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_odpf_optimus_core_v1beta1_resource_proto_goTypes = []interface{}{ - (*DeployResourceSpecificationRequest)(nil), // 0: odpf.optimus.core.v1beta1.DeployResourceSpecificationRequest - (*DeployResourceSpecificationResponse)(nil), // 1: odpf.optimus.core.v1beta1.DeployResourceSpecificationResponse - (*ListResourceSpecificationRequest)(nil), // 2: odpf.optimus.core.v1beta1.ListResourceSpecificationRequest - (*ListResourceSpecificationResponse)(nil), // 3: odpf.optimus.core.v1beta1.ListResourceSpecificationResponse - (*CreateResourceRequest)(nil), // 4: odpf.optimus.core.v1beta1.CreateResourceRequest - (*CreateResourceResponse)(nil), // 5: odpf.optimus.core.v1beta1.CreateResourceResponse - (*ReadResourceRequest)(nil), // 6: odpf.optimus.core.v1beta1.ReadResourceRequest - (*ReadResourceResponse)(nil), // 7: odpf.optimus.core.v1beta1.ReadResourceResponse - (*UpdateResourceRequest)(nil), // 8: odpf.optimus.core.v1beta1.UpdateResourceRequest - (*UpdateResourceResponse)(nil), // 9: odpf.optimus.core.v1beta1.UpdateResourceResponse - (*ResourceSpecification)(nil), // 10: odpf.optimus.core.v1beta1.ResourceSpecification - nil, // 11: odpf.optimus.core.v1beta1.ResourceSpecification.AssetsEntry - nil, // 12: odpf.optimus.core.v1beta1.ResourceSpecification.LabelsEntry - (*Log)(nil), // 13: odpf.optimus.core.v1beta1.Log - (*structpb.Struct)(nil), // 14: google.protobuf.Struct -} -var file_odpf_optimus_core_v1beta1_resource_proto_depIdxs = []int32{ - 10, // 0: odpf.optimus.core.v1beta1.DeployResourceSpecificationRequest.resources:type_name -> odpf.optimus.core.v1beta1.ResourceSpecification - 13, // 1: odpf.optimus.core.v1beta1.DeployResourceSpecificationResponse.log_status:type_name -> odpf.optimus.core.v1beta1.Log - 10, // 2: odpf.optimus.core.v1beta1.ListResourceSpecificationResponse.resources:type_name -> odpf.optimus.core.v1beta1.ResourceSpecification - 10, // 3: odpf.optimus.core.v1beta1.CreateResourceRequest.resource:type_name -> odpf.optimus.core.v1beta1.ResourceSpecification - 10, // 4: odpf.optimus.core.v1beta1.ReadResourceResponse.resource:type_name -> odpf.optimus.core.v1beta1.ResourceSpecification - 10, // 5: odpf.optimus.core.v1beta1.UpdateResourceRequest.resource:type_name -> odpf.optimus.core.v1beta1.ResourceSpecification - 14, // 6: odpf.optimus.core.v1beta1.ResourceSpecification.spec:type_name -> google.protobuf.Struct - 11, // 7: odpf.optimus.core.v1beta1.ResourceSpecification.assets:type_name -> odpf.optimus.core.v1beta1.ResourceSpecification.AssetsEntry - 12, // 8: odpf.optimus.core.v1beta1.ResourceSpecification.labels:type_name -> odpf.optimus.core.v1beta1.ResourceSpecification.LabelsEntry - 0, // 9: odpf.optimus.core.v1beta1.ResourceService.DeployResourceSpecification:input_type -> odpf.optimus.core.v1beta1.DeployResourceSpecificationRequest - 2, // 10: odpf.optimus.core.v1beta1.ResourceService.ListResourceSpecification:input_type -> odpf.optimus.core.v1beta1.ListResourceSpecificationRequest - 4, // 11: odpf.optimus.core.v1beta1.ResourceService.CreateResource:input_type -> odpf.optimus.core.v1beta1.CreateResourceRequest - 6, // 12: odpf.optimus.core.v1beta1.ResourceService.ReadResource:input_type -> odpf.optimus.core.v1beta1.ReadResourceRequest - 8, // 13: odpf.optimus.core.v1beta1.ResourceService.UpdateResource:input_type -> odpf.optimus.core.v1beta1.UpdateResourceRequest - 1, // 14: odpf.optimus.core.v1beta1.ResourceService.DeployResourceSpecification:output_type -> odpf.optimus.core.v1beta1.DeployResourceSpecificationResponse - 3, // 15: odpf.optimus.core.v1beta1.ResourceService.ListResourceSpecification:output_type -> odpf.optimus.core.v1beta1.ListResourceSpecificationResponse - 5, // 16: odpf.optimus.core.v1beta1.ResourceService.CreateResource:output_type -> odpf.optimus.core.v1beta1.CreateResourceResponse - 7, // 17: odpf.optimus.core.v1beta1.ResourceService.ReadResource:output_type -> odpf.optimus.core.v1beta1.ReadResourceResponse - 9, // 18: odpf.optimus.core.v1beta1.ResourceService.UpdateResource:output_type -> odpf.optimus.core.v1beta1.UpdateResourceResponse - 14, // [14:19] is the sub-list for method output_type - 9, // [9:14] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_odpf_optimus_core_v1beta1_resource_proto_init() } -func file_odpf_optimus_core_v1beta1_resource_proto_init() { - if File_odpf_optimus_core_v1beta1_resource_proto != nil { - return - } - file_odpf_optimus_core_v1beta1_status_proto_init() - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeployResourceSpecificationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeployResourceSpecificationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResourceSpecificationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResourceSpecificationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateResourceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateResourceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadResourceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadResourceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateResourceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateResourceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_resource_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceSpecification); 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_odpf_optimus_core_v1beta1_resource_proto_rawDesc, - NumEnums: 0, - NumMessages: 13, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_odpf_optimus_core_v1beta1_resource_proto_goTypes, - DependencyIndexes: file_odpf_optimus_core_v1beta1_resource_proto_depIdxs, - MessageInfos: file_odpf_optimus_core_v1beta1_resource_proto_msgTypes, - }.Build() - File_odpf_optimus_core_v1beta1_resource_proto = out.File - file_odpf_optimus_core_v1beta1_resource_proto_rawDesc = nil - file_odpf_optimus_core_v1beta1_resource_proto_goTypes = nil - file_odpf_optimus_core_v1beta1_resource_proto_depIdxs = nil -} diff --git a/protos/odpf/optimus/core/v1beta1/runtime.pb.go b/protos/odpf/optimus/core/v1beta1/runtime.pb.go deleted file mode 100644 index 372c8f84d7..0000000000 --- a/protos/odpf/optimus/core/v1beta1/runtime.pb.go +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/core/v1beta1/runtime.proto - -package optimus - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - 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 VersionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Client string `protobuf:"bytes,1,opt,name=client,proto3" json:"client,omitempty"` -} - -func (x *VersionRequest) Reset() { - *x = VersionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_runtime_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VersionRequest) ProtoMessage() {} - -func (x *VersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_runtime_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 VersionRequest.ProtoReflect.Descriptor instead. -func (*VersionRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_runtime_proto_rawDescGZIP(), []int{0} -} - -func (x *VersionRequest) GetClient() string { - if x != nil { - return x.Client - } - return "" -} - -type VersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` -} - -func (x *VersionResponse) Reset() { - *x = VersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_runtime_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VersionResponse) ProtoMessage() {} - -func (x *VersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_runtime_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 VersionResponse.ProtoReflect.Descriptor instead. -func (*VersionResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_runtime_proto_rawDescGZIP(), []int{1} -} - -func (x *VersionResponse) GetServer() string { - if x != nil { - return x.Server - } - return "" -} - -var File_odpf_optimus_core_v1beta1_runtime_proto protoreflect.FileDescriptor - -var file_odpf_optimus_core_v1beta1_runtime_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x75, 0x6e, 0x74, - 0x69, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x22, 0x29, 0x0a, 0x0f, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x32, 0x8f, 0x01, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x74, - 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7d, 0x0a, 0x07, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x01, 0x2a, 0x42, 0x8f, 0x01, 0x0a, 0x16, 0x69, 0x6f, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x42, 0x15, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1e, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, 0x41, 0x3b, - 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, - 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x01, 0x01, - 0x72, 0x19, 0x0a, 0x17, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x52, 0x75, 0x6e, 0x74, - 0x69, 0x6d, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_optimus_core_v1beta1_runtime_proto_rawDescOnce sync.Once - file_odpf_optimus_core_v1beta1_runtime_proto_rawDescData = file_odpf_optimus_core_v1beta1_runtime_proto_rawDesc -) - -func file_odpf_optimus_core_v1beta1_runtime_proto_rawDescGZIP() []byte { - file_odpf_optimus_core_v1beta1_runtime_proto_rawDescOnce.Do(func() { - file_odpf_optimus_core_v1beta1_runtime_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_core_v1beta1_runtime_proto_rawDescData) - }) - return file_odpf_optimus_core_v1beta1_runtime_proto_rawDescData -} - -var file_odpf_optimus_core_v1beta1_runtime_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_odpf_optimus_core_v1beta1_runtime_proto_goTypes = []interface{}{ - (*VersionRequest)(nil), // 0: odpf.optimus.core.v1beta1.VersionRequest - (*VersionResponse)(nil), // 1: odpf.optimus.core.v1beta1.VersionResponse -} -var file_odpf_optimus_core_v1beta1_runtime_proto_depIdxs = []int32{ - 0, // 0: odpf.optimus.core.v1beta1.RuntimeService.Version:input_type -> odpf.optimus.core.v1beta1.VersionRequest - 1, // 1: odpf.optimus.core.v1beta1.RuntimeService.Version:output_type -> odpf.optimus.core.v1beta1.VersionResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_odpf_optimus_core_v1beta1_runtime_proto_init() } -func file_odpf_optimus_core_v1beta1_runtime_proto_init() { - if File_odpf_optimus_core_v1beta1_runtime_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_core_v1beta1_runtime_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VersionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_runtime_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VersionResponse); 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_odpf_optimus_core_v1beta1_runtime_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_odpf_optimus_core_v1beta1_runtime_proto_goTypes, - DependencyIndexes: file_odpf_optimus_core_v1beta1_runtime_proto_depIdxs, - MessageInfos: file_odpf_optimus_core_v1beta1_runtime_proto_msgTypes, - }.Build() - File_odpf_optimus_core_v1beta1_runtime_proto = out.File - file_odpf_optimus_core_v1beta1_runtime_proto_rawDesc = nil - file_odpf_optimus_core_v1beta1_runtime_proto_goTypes = nil - file_odpf_optimus_core_v1beta1_runtime_proto_depIdxs = nil -} diff --git a/protos/odpf/optimus/core/v1beta1/secret.pb.go b/protos/odpf/optimus/core/v1beta1/secret.pb.go deleted file mode 100644 index f14639344c..0000000000 --- a/protos/odpf/optimus/core/v1beta1/secret.pb.go +++ /dev/null @@ -1,809 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/core/v1beta1/secret.proto - -package optimus - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - 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 RegisterSecretRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - SecretName string `protobuf:"bytes,2,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // base64 encoded secret value - NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` -} - -func (x *RegisterSecretRequest) Reset() { - *x = RegisterSecretRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterSecretRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterSecretRequest) ProtoMessage() {} - -func (x *RegisterSecretRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_secret_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 RegisterSecretRequest.ProtoReflect.Descriptor instead. -func (*RegisterSecretRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{0} -} - -func (x *RegisterSecretRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *RegisterSecretRequest) GetSecretName() string { - if x != nil { - return x.SecretName - } - return "" -} - -func (x *RegisterSecretRequest) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *RegisterSecretRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -type RegisterSecretResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RegisterSecretResponse) Reset() { - *x = RegisterSecretResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterSecretResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterSecretResponse) ProtoMessage() {} - -func (x *RegisterSecretResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_secret_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 RegisterSecretResponse.ProtoReflect.Descriptor instead. -func (*RegisterSecretResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{1} -} - -type UpdateSecretRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - SecretName string `protobuf:"bytes,2,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // base64 encoded secret value - NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` -} - -func (x *UpdateSecretRequest) Reset() { - *x = UpdateSecretRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateSecretRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSecretRequest) ProtoMessage() {} - -func (x *UpdateSecretRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_secret_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 UpdateSecretRequest.ProtoReflect.Descriptor instead. -func (*UpdateSecretRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{2} -} - -func (x *UpdateSecretRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *UpdateSecretRequest) GetSecretName() string { - if x != nil { - return x.SecretName - } - return "" -} - -func (x *UpdateSecretRequest) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *UpdateSecretRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -type UpdateSecretResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateSecretResponse) Reset() { - *x = UpdateSecretResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateSecretResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSecretResponse) ProtoMessage() {} - -func (x *UpdateSecretResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_secret_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 UpdateSecretResponse.ProtoReflect.Descriptor instead. -func (*UpdateSecretResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{3} -} - -type ListSecretsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` -} - -func (x *ListSecretsRequest) Reset() { - *x = ListSecretsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSecretsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSecretsRequest) ProtoMessage() {} - -func (x *ListSecretsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_secret_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 ListSecretsRequest.ProtoReflect.Descriptor instead. -func (*ListSecretsRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{4} -} - -func (x *ListSecretsRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -type ListSecretsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Secrets []*ListSecretsResponse_Secret `protobuf:"bytes,1,rep,name=secrets,proto3" json:"secrets,omitempty"` -} - -func (x *ListSecretsResponse) Reset() { - *x = ListSecretsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSecretsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSecretsResponse) ProtoMessage() {} - -func (x *ListSecretsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_secret_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 ListSecretsResponse.ProtoReflect.Descriptor instead. -func (*ListSecretsResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{5} -} - -func (x *ListSecretsResponse) GetSecrets() []*ListSecretsResponse_Secret { - if x != nil { - return x.Secrets - } - return nil -} - -type DeleteSecretRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - SecretName string `protobuf:"bytes,2,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"` - NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` -} - -func (x *DeleteSecretRequest) Reset() { - *x = DeleteSecretRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteSecretRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteSecretRequest) ProtoMessage() {} - -func (x *DeleteSecretRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_secret_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 DeleteSecretRequest.ProtoReflect.Descriptor instead. -func (*DeleteSecretRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{6} -} - -func (x *DeleteSecretRequest) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *DeleteSecretRequest) GetSecretName() string { - if x != nil { - return x.SecretName - } - return "" -} - -func (x *DeleteSecretRequest) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -type DeleteSecretResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteSecretResponse) Reset() { - *x = DeleteSecretResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteSecretResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteSecretResponse) ProtoMessage() {} - -func (x *DeleteSecretResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_secret_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 DeleteSecretResponse.ProtoReflect.Descriptor instead. -func (*DeleteSecretResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{7} -} - -type ListSecretsResponse_Secret struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Digest string `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` - Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` -} - -func (x *ListSecretsResponse_Secret) Reset() { - *x = ListSecretsResponse_Secret{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSecretsResponse_Secret) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSecretsResponse_Secret) ProtoMessage() {} - -func (x *ListSecretsResponse_Secret) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_secret_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 ListSecretsResponse_Secret.ProtoReflect.Descriptor instead. -func (*ListSecretsResponse_Secret) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *ListSecretsResponse_Secret) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ListSecretsResponse_Secret) GetDigest() string { - if x != nil { - return x.Digest - } - return "" -} - -func (x *ListSecretsResponse_Secret) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *ListSecretsResponse_Secret) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -var File_odpf_optimus_core_v1beta1_secret_proto protoreflect.FileDescriptor - -var file_odpf_optimus_core_v1beta1_secret_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x98, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, - 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, - 0x16, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x96, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x22, 0x16, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0xf6, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x07, 0x73, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x52, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x1a, 0x8d, 0x01, 0x0a, 0x06, 0x53, - 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, - 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x80, 0x01, 0x0a, 0x13, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x16, 0x0a, - 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xca, 0x05, 0x0a, 0x0d, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xb6, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x30, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, - 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x22, 0x34, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2f, - 0x7b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, - 0x12, 0xb0, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x12, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x1a, 0x34, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x2f, 0x7b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x3a, 0x01, 0x2a, 0x12, 0x9c, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x73, 0x12, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x12, 0xad, 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x12, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x2a, 0x34, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x73, 0x65, - 0x63, 0x72, 0x65, 0x74, 0x2f, 0x7b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x7d, 0x42, 0x98, 0x01, 0x0a, 0x16, 0x69, 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x14, 0x53, - 0x65, 0x63, 0x72, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, 0x41, 0x45, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, - 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, - 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x23, 0x0a, 0x21, 0x4f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x20, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x20, 0x4d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_optimus_core_v1beta1_secret_proto_rawDescOnce sync.Once - file_odpf_optimus_core_v1beta1_secret_proto_rawDescData = file_odpf_optimus_core_v1beta1_secret_proto_rawDesc -) - -func file_odpf_optimus_core_v1beta1_secret_proto_rawDescGZIP() []byte { - file_odpf_optimus_core_v1beta1_secret_proto_rawDescOnce.Do(func() { - file_odpf_optimus_core_v1beta1_secret_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_core_v1beta1_secret_proto_rawDescData) - }) - return file_odpf_optimus_core_v1beta1_secret_proto_rawDescData -} - -var file_odpf_optimus_core_v1beta1_secret_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_odpf_optimus_core_v1beta1_secret_proto_goTypes = []interface{}{ - (*RegisterSecretRequest)(nil), // 0: odpf.optimus.core.v1beta1.RegisterSecretRequest - (*RegisterSecretResponse)(nil), // 1: odpf.optimus.core.v1beta1.RegisterSecretResponse - (*UpdateSecretRequest)(nil), // 2: odpf.optimus.core.v1beta1.UpdateSecretRequest - (*UpdateSecretResponse)(nil), // 3: odpf.optimus.core.v1beta1.UpdateSecretResponse - (*ListSecretsRequest)(nil), // 4: odpf.optimus.core.v1beta1.ListSecretsRequest - (*ListSecretsResponse)(nil), // 5: odpf.optimus.core.v1beta1.ListSecretsResponse - (*DeleteSecretRequest)(nil), // 6: odpf.optimus.core.v1beta1.DeleteSecretRequest - (*DeleteSecretResponse)(nil), // 7: odpf.optimus.core.v1beta1.DeleteSecretResponse - (*ListSecretsResponse_Secret)(nil), // 8: odpf.optimus.core.v1beta1.ListSecretsResponse.Secret - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp -} -var file_odpf_optimus_core_v1beta1_secret_proto_depIdxs = []int32{ - 8, // 0: odpf.optimus.core.v1beta1.ListSecretsResponse.secrets:type_name -> odpf.optimus.core.v1beta1.ListSecretsResponse.Secret - 9, // 1: odpf.optimus.core.v1beta1.ListSecretsResponse.Secret.updated_at:type_name -> google.protobuf.Timestamp - 0, // 2: odpf.optimus.core.v1beta1.SecretService.RegisterSecret:input_type -> odpf.optimus.core.v1beta1.RegisterSecretRequest - 2, // 3: odpf.optimus.core.v1beta1.SecretService.UpdateSecret:input_type -> odpf.optimus.core.v1beta1.UpdateSecretRequest - 4, // 4: odpf.optimus.core.v1beta1.SecretService.ListSecrets:input_type -> odpf.optimus.core.v1beta1.ListSecretsRequest - 6, // 5: odpf.optimus.core.v1beta1.SecretService.DeleteSecret:input_type -> odpf.optimus.core.v1beta1.DeleteSecretRequest - 1, // 6: odpf.optimus.core.v1beta1.SecretService.RegisterSecret:output_type -> odpf.optimus.core.v1beta1.RegisterSecretResponse - 3, // 7: odpf.optimus.core.v1beta1.SecretService.UpdateSecret:output_type -> odpf.optimus.core.v1beta1.UpdateSecretResponse - 5, // 8: odpf.optimus.core.v1beta1.SecretService.ListSecrets:output_type -> odpf.optimus.core.v1beta1.ListSecretsResponse - 7, // 9: odpf.optimus.core.v1beta1.SecretService.DeleteSecret:output_type -> odpf.optimus.core.v1beta1.DeleteSecretResponse - 6, // [6:10] is the sub-list for method output_type - 2, // [2:6] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_odpf_optimus_core_v1beta1_secret_proto_init() } -func file_odpf_optimus_core_v1beta1_secret_proto_init() { - if File_odpf_optimus_core_v1beta1_secret_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterSecretRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterSecretResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateSecretRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateSecretResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSecretsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSecretsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteSecretRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteSecretResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_core_v1beta1_secret_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSecretsResponse_Secret); 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_odpf_optimus_core_v1beta1_secret_proto_rawDesc, - NumEnums: 0, - NumMessages: 9, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_odpf_optimus_core_v1beta1_secret_proto_goTypes, - DependencyIndexes: file_odpf_optimus_core_v1beta1_secret_proto_depIdxs, - MessageInfos: file_odpf_optimus_core_v1beta1_secret_proto_msgTypes, - }.Build() - File_odpf_optimus_core_v1beta1_secret_proto = out.File - file_odpf_optimus_core_v1beta1_secret_proto_rawDesc = nil - file_odpf_optimus_core_v1beta1_secret_proto_goTypes = nil - file_odpf_optimus_core_v1beta1_secret_proto_depIdxs = nil -} diff --git a/protos/odpf/optimus/core/v1beta1/status.pb.go b/protos/odpf/optimus/core/v1beta1/status.pb.go deleted file mode 100644 index 2fe065f402..0000000000 --- a/protos/odpf/optimus/core/v1beta1/status.pb.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/core/v1beta1/status.proto - -package optimus - -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 Level int32 - -const ( - Level_LEVEL_UNSPECIFIED Level = 0 - Level_LEVEL_TRACE Level = 1 - Level_LEVEL_DEBUG Level = 2 - Level_LEVEL_INFO Level = 3 - Level_LEVEL_WARNING Level = 4 - Level_LEVEL_ERROR Level = 5 - Level_LEVEL_FATAL Level = 6 -) - -// Enum value maps for Level. -var ( - Level_name = map[int32]string{ - 0: "LEVEL_UNSPECIFIED", - 1: "LEVEL_TRACE", - 2: "LEVEL_DEBUG", - 3: "LEVEL_INFO", - 4: "LEVEL_WARNING", - 5: "LEVEL_ERROR", - 6: "LEVEL_FATAL", - } - Level_value = map[string]int32{ - "LEVEL_UNSPECIFIED": 0, - "LEVEL_TRACE": 1, - "LEVEL_DEBUG": 2, - "LEVEL_INFO": 3, - "LEVEL_WARNING": 4, - "LEVEL_ERROR": 5, - "LEVEL_FATAL": 6, - } -) - -func (x Level) Enum() *Level { - p := new(Level) - *p = x - return p -} - -func (x Level) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Level) Descriptor() protoreflect.EnumDescriptor { - return file_odpf_optimus_core_v1beta1_status_proto_enumTypes[0].Descriptor() -} - -func (Level) Type() protoreflect.EnumType { - return &file_odpf_optimus_core_v1beta1_status_proto_enumTypes[0] -} - -func (x Level) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Level.Descriptor instead. -func (Level) EnumDescriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_status_proto_rawDescGZIP(), []int{0} -} - -type Log struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Level Level `protobuf:"varint,1,opt,name=level,proto3,enum=odpf.optimus.core.v1beta1.Level" json:"level,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *Log) Reset() { - *x = Log{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_status_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Log) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Log) ProtoMessage() {} - -func (x *Log) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_status_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 Log.ProtoReflect.Descriptor instead. -func (*Log) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_status_proto_rawDescGZIP(), []int{0} -} - -func (x *Log) GetLevel() Level { - if x != nil { - return x.Level - } - return Level_LEVEL_UNSPECIFIED -} - -func (x *Log) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -var File_odpf_optimus_core_v1beta1_status_proto protoreflect.FileDescriptor - -var file_odpf_optimus_core_v1beta1_status_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x22, 0x57, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x36, 0x0a, 0x05, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x6f, 0x64, 0x70, 0x66, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x85, 0x01, 0x0a, - 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x15, 0x0a, 0x11, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, - 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0f, - 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x02, 0x12, - 0x0e, 0x0a, 0x0a, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x03, 0x12, - 0x11, 0x0a, 0x0d, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, - 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, - 0x52, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x46, 0x41, 0x54, - 0x41, 0x4c, 0x10, 0x06, 0x42, 0x42, 0x0a, 0x16, 0x69, 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x06, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, - 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_optimus_core_v1beta1_status_proto_rawDescOnce sync.Once - file_odpf_optimus_core_v1beta1_status_proto_rawDescData = file_odpf_optimus_core_v1beta1_status_proto_rawDesc -) - -func file_odpf_optimus_core_v1beta1_status_proto_rawDescGZIP() []byte { - file_odpf_optimus_core_v1beta1_status_proto_rawDescOnce.Do(func() { - file_odpf_optimus_core_v1beta1_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_core_v1beta1_status_proto_rawDescData) - }) - return file_odpf_optimus_core_v1beta1_status_proto_rawDescData -} - -var file_odpf_optimus_core_v1beta1_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_odpf_optimus_core_v1beta1_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_odpf_optimus_core_v1beta1_status_proto_goTypes = []interface{}{ - (Level)(0), // 0: odpf.optimus.core.v1beta1.Level - (*Log)(nil), // 1: odpf.optimus.core.v1beta1.Log -} -var file_odpf_optimus_core_v1beta1_status_proto_depIdxs = []int32{ - 0, // 0: odpf.optimus.core.v1beta1.Log.level:type_name -> odpf.optimus.core.v1beta1.Level - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_odpf_optimus_core_v1beta1_status_proto_init() } -func file_odpf_optimus_core_v1beta1_status_proto_init() { - if File_odpf_optimus_core_v1beta1_status_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_core_v1beta1_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Log); 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_odpf_optimus_core_v1beta1_status_proto_rawDesc, - NumEnums: 1, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_odpf_optimus_core_v1beta1_status_proto_goTypes, - DependencyIndexes: file_odpf_optimus_core_v1beta1_status_proto_depIdxs, - EnumInfos: file_odpf_optimus_core_v1beta1_status_proto_enumTypes, - MessageInfos: file_odpf_optimus_core_v1beta1_status_proto_msgTypes, - }.Build() - File_odpf_optimus_core_v1beta1_status_proto = out.File - file_odpf_optimus_core_v1beta1_status_proto_rawDesc = nil - file_odpf_optimus_core_v1beta1_status_proto_goTypes = nil - file_odpf_optimus_core_v1beta1_status_proto_depIdxs = nil -} diff --git a/protos/odpf/optimus/plugins/v1beta1/dependency_resolver.pb.go b/protos/odpf/optimus/plugins/v1beta1/dependency_resolver.pb.go deleted file mode 100644 index 95f7a8f851..0000000000 --- a/protos/odpf/optimus/plugins/v1beta1/dependency_resolver.pb.go +++ /dev/null @@ -1,1182 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: odpf/optimus/plugins/v1beta1/dependency_resolver.proto - -package optimus - -import ( - v1beta1 "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - 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 GetNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GetNameRequest) Reset() { - *x = GetNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNameRequest) ProtoMessage() {} - -func (x *GetNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 GetNameRequest.ProtoReflect.Descriptor instead. -func (*GetNameRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{0} -} - -type GetNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetNameResponse) Reset() { - *x = GetNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNameResponse) ProtoMessage() {} - -func (x *GetNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 GetNameResponse.ProtoReflect.Descriptor instead. -func (*GetNameResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{1} -} - -func (x *GetNameResponse) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type GenerateDestinationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Config *Configs `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` - Assets *Assets `protobuf:"bytes,2,opt,name=assets,proto3" json:"assets,omitempty"` - // Deprecated: Do not use. - Project *v1beta1.ProjectSpecification `protobuf:"bytes,3,opt,name=project,proto3" json:"project,omitempty"` - Options *PluginOptions `protobuf:"bytes,40,opt,name=options,proto3" json:"options,omitempty"` -} - -func (x *GenerateDestinationRequest) Reset() { - *x = GenerateDestinationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateDestinationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateDestinationRequest) ProtoMessage() {} - -func (x *GenerateDestinationRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 GenerateDestinationRequest.ProtoReflect.Descriptor instead. -func (*GenerateDestinationRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{2} -} - -func (x *GenerateDestinationRequest) GetConfig() *Configs { - if x != nil { - return x.Config - } - return nil -} - -func (x *GenerateDestinationRequest) GetAssets() *Assets { - if x != nil { - return x.Assets - } - return nil -} - -// Deprecated: Do not use. -func (x *GenerateDestinationRequest) GetProject() *v1beta1.ProjectSpecification { - if x != nil { - return x.Project - } - return nil -} - -func (x *GenerateDestinationRequest) GetOptions() *PluginOptions { - if x != nil { - return x.Options - } - return nil -} - -type GenerateDestinationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` - DestinationType string `protobuf:"bytes,2,opt,name=destination_type,json=destinationType,proto3" json:"destination_type,omitempty"` -} - -func (x *GenerateDestinationResponse) Reset() { - *x = GenerateDestinationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateDestinationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateDestinationResponse) ProtoMessage() {} - -func (x *GenerateDestinationResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 GenerateDestinationResponse.ProtoReflect.Descriptor instead. -func (*GenerateDestinationResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{3} -} - -func (x *GenerateDestinationResponse) GetDestination() string { - if x != nil { - return x.Destination - } - return "" -} - -func (x *GenerateDestinationResponse) GetDestinationType() string { - if x != nil { - return x.DestinationType - } - return "" -} - -type GenerateDependenciesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Config *Configs `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` - Assets *Assets `protobuf:"bytes,2,opt,name=assets,proto3" json:"assets,omitempty"` - // Deprecated: Do not use. - Project *v1beta1.ProjectSpecification `protobuf:"bytes,3,opt,name=project,proto3" json:"project,omitempty"` - Options *PluginOptions `protobuf:"bytes,40,opt,name=options,proto3" json:"options,omitempty"` -} - -func (x *GenerateDependenciesRequest) Reset() { - *x = GenerateDependenciesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateDependenciesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateDependenciesRequest) ProtoMessage() {} - -func (x *GenerateDependenciesRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 GenerateDependenciesRequest.ProtoReflect.Descriptor instead. -func (*GenerateDependenciesRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{4} -} - -func (x *GenerateDependenciesRequest) GetConfig() *Configs { - if x != nil { - return x.Config - } - return nil -} - -func (x *GenerateDependenciesRequest) GetAssets() *Assets { - if x != nil { - return x.Assets - } - return nil -} - -// Deprecated: Do not use. -func (x *GenerateDependenciesRequest) GetProject() *v1beta1.ProjectSpecification { - if x != nil { - return x.Project - } - return nil -} - -func (x *GenerateDependenciesRequest) GetOptions() *PluginOptions { - if x != nil { - return x.Options - } - return nil -} - -type GenerateDependenciesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Dependencies []string `protobuf:"bytes,1,rep,name=dependencies,proto3" json:"dependencies,omitempty"` -} - -func (x *GenerateDependenciesResponse) Reset() { - *x = GenerateDependenciesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateDependenciesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateDependenciesResponse) ProtoMessage() {} - -func (x *GenerateDependenciesResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 GenerateDependenciesResponse.ProtoReflect.Descriptor instead. -func (*GenerateDependenciesResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{5} -} - -func (x *GenerateDependenciesResponse) GetDependencies() []string { - if x != nil { - return x.Dependencies - } - return nil -} - -type Configs struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Configs []*Configs_Config `protobuf:"bytes,1,rep,name=configs,proto3" json:"configs,omitempty"` -} - -func (x *Configs) Reset() { - *x = Configs{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Configs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Configs) ProtoMessage() {} - -func (x *Configs) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 Configs.ProtoReflect.Descriptor instead. -func (*Configs) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{6} -} - -func (x *Configs) GetConfigs() []*Configs_Config { - if x != nil { - return x.Configs - } - return nil -} - -type Assets struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Assets []*Assets_Asset `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` -} - -func (x *Assets) Reset() { - *x = Assets{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Assets) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Assets) ProtoMessage() {} - -func (x *Assets) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 Assets.ProtoReflect.Descriptor instead. -func (*Assets) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{7} -} - -func (x *Assets) GetAssets() []*Assets_Asset { - if x != nil { - return x.Assets - } - return nil -} - -type CompileAssetsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Configs *Configs `protobuf:"bytes,1,opt,name=configs,proto3" json:"configs,omitempty"` - Assets *Assets `protobuf:"bytes,2,opt,name=assets,proto3" json:"assets,omitempty"` - // Deprecated: Do not use. - Window *v1beta1.TaskWindow `protobuf:"bytes,3,opt,name=window,proto3" json:"window,omitempty"` - // Deprecated: Do not use. - InstanceSchedule *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=instance_schedule,json=instanceSchedule,proto3" json:"instance_schedule,omitempty"` - InstanceData []*v1beta1.InstanceSpecData `protobuf:"bytes,5,rep,name=instance_data,json=instanceData,proto3" json:"instance_data,omitempty"` - StartTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - EndTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` - Options *PluginOptions `protobuf:"bytes,40,opt,name=options,proto3" json:"options,omitempty"` -} - -func (x *CompileAssetsRequest) Reset() { - *x = CompileAssetsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CompileAssetsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CompileAssetsRequest) ProtoMessage() {} - -func (x *CompileAssetsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 CompileAssetsRequest.ProtoReflect.Descriptor instead. -func (*CompileAssetsRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{8} -} - -func (x *CompileAssetsRequest) GetConfigs() *Configs { - if x != nil { - return x.Configs - } - return nil -} - -func (x *CompileAssetsRequest) GetAssets() *Assets { - if x != nil { - return x.Assets - } - return nil -} - -// Deprecated: Do not use. -func (x *CompileAssetsRequest) GetWindow() *v1beta1.TaskWindow { - if x != nil { - return x.Window - } - return nil -} - -// Deprecated: Do not use. -func (x *CompileAssetsRequest) GetInstanceSchedule() *timestamppb.Timestamp { - if x != nil { - return x.InstanceSchedule - } - return nil -} - -func (x *CompileAssetsRequest) GetInstanceData() []*v1beta1.InstanceSpecData { - if x != nil { - return x.InstanceData - } - return nil -} - -func (x *CompileAssetsRequest) GetStartTime() *timestamppb.Timestamp { - if x != nil { - return x.StartTime - } - return nil -} - -func (x *CompileAssetsRequest) GetEndTime() *timestamppb.Timestamp { - if x != nil { - return x.EndTime - } - return nil -} - -func (x *CompileAssetsRequest) GetOptions() *PluginOptions { - if x != nil { - return x.Options - } - return nil -} - -type CompileAssetsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Assets *Assets `protobuf:"bytes,1,opt,name=assets,proto3" json:"assets,omitempty"` -} - -func (x *CompileAssetsResponse) Reset() { - *x = CompileAssetsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CompileAssetsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CompileAssetsResponse) ProtoMessage() {} - -func (x *CompileAssetsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 CompileAssetsResponse.ProtoReflect.Descriptor instead. -func (*CompileAssetsResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{9} -} - -func (x *CompileAssetsResponse) GetAssets() *Assets { - if x != nil { - return x.Assets - } - return nil -} - -type PluginOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DryRun bool `protobuf:"varint,1,opt,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"` -} - -func (x *PluginOptions) Reset() { - *x = PluginOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginOptions) ProtoMessage() {} - -func (x *PluginOptions) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 PluginOptions.ProtoReflect.Descriptor instead. -func (*PluginOptions) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{10} -} - -func (x *PluginOptions) GetDryRun() bool { - if x != nil { - return x.DryRun - } - return false -} - -type Configs_Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Configs_Config) Reset() { - *x = Configs_Config{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Configs_Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Configs_Config) ProtoMessage() {} - -func (x *Configs_Config) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 Configs_Config.ProtoReflect.Descriptor instead. -func (*Configs_Config) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{6, 0} -} - -func (x *Configs_Config) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Configs_Config) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -type Assets_Asset struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Assets_Asset) Reset() { - *x = Assets_Asset{} - if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Assets_Asset) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Assets_Asset) ProtoMessage() {} - -func (x *Assets_Asset) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_plugins_v1beta1_dependency_resolver_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 Assets_Asset.ProtoReflect.Descriptor instead. -func (*Assets_Asset) Descriptor() ([]byte, []int) { - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *Assets_Asset) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Assets_Asset) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -var File_odpf_optimus_plugins_v1beta1_dependency_resolver_proto protoreflect.FileDescriptor - -var file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDesc = []byte{ - 0x0a, 0x36, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, - 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, - 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x75, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x27, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x25, 0x0a, 0x0f, 0x47, - 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0xaf, 0x02, 0x0a, 0x1a, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x4d, - 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x45, 0x0a, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x6a, 0x0a, 0x1b, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, - 0x22, 0xb0, 0x02, 0x0a, 0x1b, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, - 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3d, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x25, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x3c, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, - 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x4d, 0x0a, - 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x02, 0x18, 0x01, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x45, 0x0a, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0x42, 0x0a, 0x1c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, - 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x73, 0x12, 0x46, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x1a, 0x32, 0x0a, 0x06, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x7f, 0x0a, 0x06, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x06, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6f, 0x64, 0x70, 0x66, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2e, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x1a, 0x31, 0x0a, - 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0xb0, 0x04, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x65, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x07, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x73, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x73, - 0x73, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, - 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x06, 0x77, 0x69, 0x6e, 0x64, - 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x42, - 0x02, 0x18, 0x01, 0x52, 0x06, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x4b, 0x0a, 0x11, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x42, 0x02, 0x18, 0x01, 0x52, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0c, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0x55, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x41, 0x73, - 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, - 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, - 0x74, 0x73, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x22, 0x28, 0x0a, 0x0d, 0x50, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x64, - 0x72, 0x79, 0x5f, 0x72, 0x75, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x64, 0x72, - 0x79, 0x52, 0x75, 0x6e, 0x32, 0x9d, 0x04, 0x0a, 0x1c, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, - 0x6e, 0x63, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x66, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8a, 0x01, - 0x0a, 0x13, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x39, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x14, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x69, 0x65, 0x73, 0x12, 0x39, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x78, 0x0a, 0x0d, 0x43, 0x6f, - 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x32, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, - 0x6c, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x33, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5e, 0x0a, 0x1e, 0x69, 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x42, 0x1a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, - 0x63, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescOnce sync.Once - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescData = file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDesc -) - -func file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP() []byte { - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescOnce.Do(func() { - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescData) - }) - return file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescData -} - -var file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_goTypes = []interface{}{ - (*GetNameRequest)(nil), // 0: odpf.optimus.plugins.v1beta1.GetNameRequest - (*GetNameResponse)(nil), // 1: odpf.optimus.plugins.v1beta1.GetNameResponse - (*GenerateDestinationRequest)(nil), // 2: odpf.optimus.plugins.v1beta1.GenerateDestinationRequest - (*GenerateDestinationResponse)(nil), // 3: odpf.optimus.plugins.v1beta1.GenerateDestinationResponse - (*GenerateDependenciesRequest)(nil), // 4: odpf.optimus.plugins.v1beta1.GenerateDependenciesRequest - (*GenerateDependenciesResponse)(nil), // 5: odpf.optimus.plugins.v1beta1.GenerateDependenciesResponse - (*Configs)(nil), // 6: odpf.optimus.plugins.v1beta1.Configs - (*Assets)(nil), // 7: odpf.optimus.plugins.v1beta1.Assets - (*CompileAssetsRequest)(nil), // 8: odpf.optimus.plugins.v1beta1.CompileAssetsRequest - (*CompileAssetsResponse)(nil), // 9: odpf.optimus.plugins.v1beta1.CompileAssetsResponse - (*PluginOptions)(nil), // 10: odpf.optimus.plugins.v1beta1.PluginOptions - (*Configs_Config)(nil), // 11: odpf.optimus.plugins.v1beta1.Configs.Config - (*Assets_Asset)(nil), // 12: odpf.optimus.plugins.v1beta1.Assets.Asset - (*v1beta1.ProjectSpecification)(nil), // 13: odpf.optimus.core.v1beta1.ProjectSpecification - (*v1beta1.TaskWindow)(nil), // 14: odpf.optimus.core.v1beta1.TaskWindow - (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp - (*v1beta1.InstanceSpecData)(nil), // 16: odpf.optimus.core.v1beta1.InstanceSpecData -} -var file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_depIdxs = []int32{ - 6, // 0: odpf.optimus.plugins.v1beta1.GenerateDestinationRequest.config:type_name -> odpf.optimus.plugins.v1beta1.Configs - 7, // 1: odpf.optimus.plugins.v1beta1.GenerateDestinationRequest.assets:type_name -> odpf.optimus.plugins.v1beta1.Assets - 13, // 2: odpf.optimus.plugins.v1beta1.GenerateDestinationRequest.project:type_name -> odpf.optimus.core.v1beta1.ProjectSpecification - 10, // 3: odpf.optimus.plugins.v1beta1.GenerateDestinationRequest.options:type_name -> odpf.optimus.plugins.v1beta1.PluginOptions - 6, // 4: odpf.optimus.plugins.v1beta1.GenerateDependenciesRequest.config:type_name -> odpf.optimus.plugins.v1beta1.Configs - 7, // 5: odpf.optimus.plugins.v1beta1.GenerateDependenciesRequest.assets:type_name -> odpf.optimus.plugins.v1beta1.Assets - 13, // 6: odpf.optimus.plugins.v1beta1.GenerateDependenciesRequest.project:type_name -> odpf.optimus.core.v1beta1.ProjectSpecification - 10, // 7: odpf.optimus.plugins.v1beta1.GenerateDependenciesRequest.options:type_name -> odpf.optimus.plugins.v1beta1.PluginOptions - 11, // 8: odpf.optimus.plugins.v1beta1.Configs.configs:type_name -> odpf.optimus.plugins.v1beta1.Configs.Config - 12, // 9: odpf.optimus.plugins.v1beta1.Assets.assets:type_name -> odpf.optimus.plugins.v1beta1.Assets.Asset - 6, // 10: odpf.optimus.plugins.v1beta1.CompileAssetsRequest.configs:type_name -> odpf.optimus.plugins.v1beta1.Configs - 7, // 11: odpf.optimus.plugins.v1beta1.CompileAssetsRequest.assets:type_name -> odpf.optimus.plugins.v1beta1.Assets - 14, // 12: odpf.optimus.plugins.v1beta1.CompileAssetsRequest.window:type_name -> odpf.optimus.core.v1beta1.TaskWindow - 15, // 13: odpf.optimus.plugins.v1beta1.CompileAssetsRequest.instance_schedule:type_name -> google.protobuf.Timestamp - 16, // 14: odpf.optimus.plugins.v1beta1.CompileAssetsRequest.instance_data:type_name -> odpf.optimus.core.v1beta1.InstanceSpecData - 15, // 15: odpf.optimus.plugins.v1beta1.CompileAssetsRequest.start_time:type_name -> google.protobuf.Timestamp - 15, // 16: odpf.optimus.plugins.v1beta1.CompileAssetsRequest.end_time:type_name -> google.protobuf.Timestamp - 10, // 17: odpf.optimus.plugins.v1beta1.CompileAssetsRequest.options:type_name -> odpf.optimus.plugins.v1beta1.PluginOptions - 7, // 18: odpf.optimus.plugins.v1beta1.CompileAssetsResponse.assets:type_name -> odpf.optimus.plugins.v1beta1.Assets - 0, // 19: odpf.optimus.plugins.v1beta1.DependencyResolverModService.GetName:input_type -> odpf.optimus.plugins.v1beta1.GetNameRequest - 2, // 20: odpf.optimus.plugins.v1beta1.DependencyResolverModService.GenerateDestination:input_type -> odpf.optimus.plugins.v1beta1.GenerateDestinationRequest - 4, // 21: odpf.optimus.plugins.v1beta1.DependencyResolverModService.GenerateDependencies:input_type -> odpf.optimus.plugins.v1beta1.GenerateDependenciesRequest - 8, // 22: odpf.optimus.plugins.v1beta1.DependencyResolverModService.CompileAssets:input_type -> odpf.optimus.plugins.v1beta1.CompileAssetsRequest - 1, // 23: odpf.optimus.plugins.v1beta1.DependencyResolverModService.GetName:output_type -> odpf.optimus.plugins.v1beta1.GetNameResponse - 3, // 24: odpf.optimus.plugins.v1beta1.DependencyResolverModService.GenerateDestination:output_type -> odpf.optimus.plugins.v1beta1.GenerateDestinationResponse - 5, // 25: odpf.optimus.plugins.v1beta1.DependencyResolverModService.GenerateDependencies:output_type -> odpf.optimus.plugins.v1beta1.GenerateDependenciesResponse - 9, // 26: odpf.optimus.plugins.v1beta1.DependencyResolverModService.CompileAssets:output_type -> odpf.optimus.plugins.v1beta1.CompileAssetsResponse - 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 -} - -func init() { file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_init() } -func file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_init() { - if File_odpf_optimus_plugins_v1beta1_dependency_resolver_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateDestinationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateDestinationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateDependenciesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateDependenciesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Configs); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Assets); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CompileAssetsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CompileAssetsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Configs_Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Assets_Asset); 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_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDesc, - NumEnums: 0, - NumMessages: 13, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_goTypes, - DependencyIndexes: file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_depIdxs, - MessageInfos: file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes, - }.Build() - File_odpf_optimus_plugins_v1beta1_dependency_resolver_proto = out.File - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_rawDesc = nil - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_goTypes = nil - file_odpf_optimus_plugins_v1beta1_dependency_resolver_proto_depIdxs = nil -} diff --git a/protos/raystack/optimus/core/v1beta1/backup.pb.go b/protos/raystack/optimus/core/v1beta1/backup.pb.go new file mode 100644 index 0000000000..e7d99c6102 --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/backup.pb.go @@ -0,0 +1,865 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/core/v1beta1/backup.proto + +package optimus + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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 IgnoredResource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (x *IgnoredResource) Reset() { + *x = IgnoredResource{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IgnoredResource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IgnoredResource) ProtoMessage() {} + +func (x *IgnoredResource) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_backup_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 IgnoredResource.ProtoReflect.Descriptor instead. +func (*IgnoredResource) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{0} +} + +func (x *IgnoredResource) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *IgnoredResource) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +type CreateBackupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + Config map[string]string `protobuf:"bytes,7,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ResourceNames []string `protobuf:"bytes,9,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"` +} + +func (x *CreateBackupRequest) Reset() { + *x = CreateBackupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateBackupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBackupRequest) ProtoMessage() {} + +func (x *CreateBackupRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_backup_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 CreateBackupRequest.ProtoReflect.Descriptor instead. +func (*CreateBackupRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateBackupRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *CreateBackupRequest) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *CreateBackupRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *CreateBackupRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreateBackupRequest) GetConfig() map[string]string { + if x != nil { + return x.Config + } + return nil +} + +func (x *CreateBackupRequest) GetResourceNames() []string { + if x != nil { + return x.ResourceNames + } + return nil +} + +type CreateBackupResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResourceNames []string `protobuf:"bytes,1,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"` + IgnoredResources []*IgnoredResource `protobuf:"bytes,3,rep,name=ignored_resources,json=ignoredResources,proto3" json:"ignored_resources,omitempty"` + BackupId string `protobuf:"bytes,4,opt,name=backup_id,json=backupId,proto3" json:"backup_id,omitempty"` +} + +func (x *CreateBackupResponse) Reset() { + *x = CreateBackupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateBackupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBackupResponse) ProtoMessage() {} + +func (x *CreateBackupResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_backup_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 CreateBackupResponse.ProtoReflect.Descriptor instead. +func (*CreateBackupResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{2} +} + +func (x *CreateBackupResponse) GetResourceNames() []string { + if x != nil { + return x.ResourceNames + } + return nil +} + +func (x *CreateBackupResponse) GetIgnoredResources() []*IgnoredResource { + if x != nil { + return x.IgnoredResources + } + return nil +} + +func (x *CreateBackupResponse) GetBackupId() string { + if x != nil { + return x.BackupId + } + return "" +} + +type ListBackupsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` +} + +func (x *ListBackupsRequest) Reset() { + *x = ListBackupsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListBackupsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBackupsRequest) ProtoMessage() {} + +func (x *ListBackupsRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_backup_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 ListBackupsRequest.ProtoReflect.Descriptor instead. +func (*ListBackupsRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{3} +} + +func (x *ListBackupsRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *ListBackupsRequest) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *ListBackupsRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +type ListBackupsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Backups []*BackupSpec `protobuf:"bytes,1,rep,name=backups,proto3" json:"backups,omitempty"` +} + +func (x *ListBackupsResponse) Reset() { + *x = ListBackupsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListBackupsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBackupsResponse) ProtoMessage() {} + +func (x *ListBackupsResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_backup_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 ListBackupsResponse.ProtoReflect.Descriptor instead. +func (*ListBackupsResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{4} +} + +func (x *ListBackupsResponse) GetBackups() []*BackupSpec { + if x != nil { + return x.Backups + } + return nil +} + +type BackupSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + Config map[string]string `protobuf:"bytes,5,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ResourceNames []string `protobuf:"bytes,6,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"` +} + +func (x *BackupSpec) Reset() { + *x = BackupSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BackupSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BackupSpec) ProtoMessage() {} + +func (x *BackupSpec) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_backup_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 BackupSpec.ProtoReflect.Descriptor instead. +func (*BackupSpec) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{5} +} + +func (x *BackupSpec) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *BackupSpec) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *BackupSpec) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *BackupSpec) GetConfig() map[string]string { + if x != nil { + return x.Config + } + return nil +} + +func (x *BackupSpec) GetResourceNames() []string { + if x != nil { + return x.ResourceNames + } + return nil +} + +type GetBackupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetBackupRequest) Reset() { + *x = GetBackupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBackupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBackupRequest) ProtoMessage() {} + +func (x *GetBackupRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_backup_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 GetBackupRequest.ProtoReflect.Descriptor instead. +func (*GetBackupRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{6} +} + +func (x *GetBackupRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *GetBackupRequest) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *GetBackupRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *GetBackupRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetBackupResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Spec *BackupSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` +} + +func (x *GetBackupResponse) Reset() { + *x = GetBackupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBackupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBackupResponse) ProtoMessage() {} + +func (x *GetBackupResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_backup_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 GetBackupResponse.ProtoReflect.Descriptor instead. +func (*GetBackupResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_backup_proto_rawDescGZIP(), []int{7} +} + +func (x *GetBackupResponse) GetSpec() *BackupSpec { + if x != nil { + return x.Spec + } + return nil +} + +var File_raystack_optimus_core_v1beta1_backup_proto protoreflect.FileDescriptor + +var file_raystack_optimus_core_v1beta1_backup_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x20, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x3d, 0x0a, 0x0f, 0x49, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, + 0xf7, 0x02, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, + 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, + 0x06, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x22, 0xc0, 0x01, 0x0a, 0x14, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x5e, 0x0a, 0x11, 0x69, 0x67, 0x6e, + 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x10, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x85, 0x01, 0x0a, + 0x12, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, + 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x5d, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x62, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x70, 0x65, 0x63, 0x52, 0x07, 0x62, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x73, 0x22, 0xb3, 0x02, 0x0a, 0x0a, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x70, + 0x65, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x50, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x93, 0x01, 0x0a, 0x10, 0x47, 0x65, + 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, + 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x5b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x70, 0x65, 0x63, + 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x32, 0xb8, 0x05, 0x0a, + 0x0d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xe6, + 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, + 0x35, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x67, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x61, 0x22, 0x5c, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, + 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x3a, 0x01, 0x2a, 0x12, 0xe0, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x12, 0x34, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5e, 0x12, 0x5c, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0xda, 0x01, 0x0a, 0x09, 0x47, + 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5e, 0x12, 0x5c, 0x2f, 0x76, 0x31, 0x2f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, + 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x62, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0x95, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x14, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, + 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x92, 0x41, 0x3a, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, + 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, + 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x18, 0x0a, 0x16, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x20, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_raystack_optimus_core_v1beta1_backup_proto_rawDescOnce sync.Once + file_raystack_optimus_core_v1beta1_backup_proto_rawDescData = file_raystack_optimus_core_v1beta1_backup_proto_rawDesc +) + +func file_raystack_optimus_core_v1beta1_backup_proto_rawDescGZIP() []byte { + file_raystack_optimus_core_v1beta1_backup_proto_rawDescOnce.Do(func() { + file_raystack_optimus_core_v1beta1_backup_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_core_v1beta1_backup_proto_rawDescData) + }) + return file_raystack_optimus_core_v1beta1_backup_proto_rawDescData +} + +var file_raystack_optimus_core_v1beta1_backup_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_raystack_optimus_core_v1beta1_backup_proto_goTypes = []interface{}{ + (*IgnoredResource)(nil), // 0: raystack.optimus.core.v1beta1.IgnoredResource + (*CreateBackupRequest)(nil), // 1: raystack.optimus.core.v1beta1.CreateBackupRequest + (*CreateBackupResponse)(nil), // 2: raystack.optimus.core.v1beta1.CreateBackupResponse + (*ListBackupsRequest)(nil), // 3: raystack.optimus.core.v1beta1.ListBackupsRequest + (*ListBackupsResponse)(nil), // 4: raystack.optimus.core.v1beta1.ListBackupsResponse + (*BackupSpec)(nil), // 5: raystack.optimus.core.v1beta1.BackupSpec + (*GetBackupRequest)(nil), // 6: raystack.optimus.core.v1beta1.GetBackupRequest + (*GetBackupResponse)(nil), // 7: raystack.optimus.core.v1beta1.GetBackupResponse + nil, // 8: raystack.optimus.core.v1beta1.CreateBackupRequest.ConfigEntry + nil, // 9: raystack.optimus.core.v1beta1.BackupSpec.ConfigEntry + (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp +} +var file_raystack_optimus_core_v1beta1_backup_proto_depIdxs = []int32{ + 8, // 0: raystack.optimus.core.v1beta1.CreateBackupRequest.config:type_name -> raystack.optimus.core.v1beta1.CreateBackupRequest.ConfigEntry + 0, // 1: raystack.optimus.core.v1beta1.CreateBackupResponse.ignored_resources:type_name -> raystack.optimus.core.v1beta1.IgnoredResource + 5, // 2: raystack.optimus.core.v1beta1.ListBackupsResponse.backups:type_name -> raystack.optimus.core.v1beta1.BackupSpec + 10, // 3: raystack.optimus.core.v1beta1.BackupSpec.created_at:type_name -> google.protobuf.Timestamp + 9, // 4: raystack.optimus.core.v1beta1.BackupSpec.config:type_name -> raystack.optimus.core.v1beta1.BackupSpec.ConfigEntry + 5, // 5: raystack.optimus.core.v1beta1.GetBackupResponse.spec:type_name -> raystack.optimus.core.v1beta1.BackupSpec + 1, // 6: raystack.optimus.core.v1beta1.BackupService.CreateBackup:input_type -> raystack.optimus.core.v1beta1.CreateBackupRequest + 3, // 7: raystack.optimus.core.v1beta1.BackupService.ListBackups:input_type -> raystack.optimus.core.v1beta1.ListBackupsRequest + 6, // 8: raystack.optimus.core.v1beta1.BackupService.GetBackup:input_type -> raystack.optimus.core.v1beta1.GetBackupRequest + 2, // 9: raystack.optimus.core.v1beta1.BackupService.CreateBackup:output_type -> raystack.optimus.core.v1beta1.CreateBackupResponse + 4, // 10: raystack.optimus.core.v1beta1.BackupService.ListBackups:output_type -> raystack.optimus.core.v1beta1.ListBackupsResponse + 7, // 11: raystack.optimus.core.v1beta1.BackupService.GetBackup:output_type -> raystack.optimus.core.v1beta1.GetBackupResponse + 9, // [9:12] is the sub-list for method output_type + 6, // [6:9] 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_raystack_optimus_core_v1beta1_backup_proto_init() } +func file_raystack_optimus_core_v1beta1_backup_proto_init() { + if File_raystack_optimus_core_v1beta1_backup_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IgnoredResource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateBackupRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateBackupResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListBackupsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListBackupsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BackupSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBackupRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_backup_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBackupResponse); 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_raystack_optimus_core_v1beta1_backup_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_raystack_optimus_core_v1beta1_backup_proto_goTypes, + DependencyIndexes: file_raystack_optimus_core_v1beta1_backup_proto_depIdxs, + MessageInfos: file_raystack_optimus_core_v1beta1_backup_proto_msgTypes, + }.Build() + File_raystack_optimus_core_v1beta1_backup_proto = out.File + file_raystack_optimus_core_v1beta1_backup_proto_rawDesc = nil + file_raystack_optimus_core_v1beta1_backup_proto_goTypes = nil + file_raystack_optimus_core_v1beta1_backup_proto_depIdxs = nil +} diff --git a/protos/odpf/optimus/core/v1beta1/backup.pb.gw.go b/protos/raystack/optimus/core/v1beta1/backup.pb.gw.go similarity index 93% rename from protos/odpf/optimus/core/v1beta1/backup.pb.gw.go rename to protos/raystack/optimus/core/v1beta1/backup.pb.gw.go index d350f608d4..27d4907639 100644 --- a/protos/odpf/optimus/core/v1beta1/backup.pb.gw.go +++ b/protos/raystack/optimus/core/v1beta1/backup.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: odpf/optimus/core/v1beta1/backup.proto +// source: raystack/optimus/core/v1beta1/backup.proto /* Package optimus is a reverse proxy. @@ -355,7 +355,7 @@ func RegisterBackupServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.BackupService/CreateBackup", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.BackupService/CreateBackup", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -378,7 +378,7 @@ func RegisterBackupServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.BackupService/ListBackups", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.BackupService/ListBackups", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -401,7 +401,7 @@ func RegisterBackupServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.BackupService/GetBackup", runtime.WithHTTPPathPattern("/v1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup/{id}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.BackupService/GetBackup", runtime.WithHTTPPathPattern("/v1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -463,7 +463,7 @@ func RegisterBackupServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.BackupService/CreateBackup", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.BackupService/CreateBackup", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -483,7 +483,7 @@ func RegisterBackupServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.BackupService/ListBackups", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.BackupService/ListBackups", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -503,7 +503,7 @@ func RegisterBackupServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.BackupService/GetBackup", runtime.WithHTTPPathPattern("/v1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup/{id}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.BackupService/GetBackup", runtime.WithHTTPPathPattern("/v1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/backup/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/protos/odpf/optimus/core/v1beta1/backup.swagger.json b/protos/raystack/optimus/core/v1beta1/backup.swagger.json similarity index 94% rename from protos/odpf/optimus/core/v1beta1/backup.swagger.json rename to protos/raystack/optimus/core/v1beta1/backup.swagger.json index 45b1faa579..080073bd49 100644 --- a/protos/odpf/optimus/core/v1beta1/backup.swagger.json +++ b/protos/raystack/optimus/core/v1beta1/backup.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/core/v1beta1/backup.proto", + "title": "raystack/optimus/core/v1beta1/backup.proto", "version": "0.1" }, "tags": [ @@ -11,15 +11,9 @@ ], "host": "127.0.0.1:9100", "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { "/v1/project/{projectName}/namespace/{namespaceName}/datastore/{datastoreName}/backup/{id}": { "get": { @@ -64,9 +58,7 @@ "type": "string" } ], - "tags": [ - "BackupService" - ] + "tags": ["BackupService"] } }, "/v1beta1/project/{projectName}/namespace/{namespaceName}/datastore/{datastoreName}/backup": { @@ -106,9 +98,7 @@ "type": "string" } ], - "tags": [ - "BackupService" - ] + "tags": ["BackupService"] }, "post": { "operationId": "BackupService_CreateBackup", @@ -171,9 +161,7 @@ } } ], - "tags": [ - "BackupService" - ] + "tags": ["BackupService"] } } }, diff --git a/protos/odpf/optimus/core/v1beta1/backup_grpc.pb.go b/protos/raystack/optimus/core/v1beta1/backup_grpc.pb.go similarity index 89% rename from protos/odpf/optimus/core/v1beta1/backup_grpc.pb.go rename to protos/raystack/optimus/core/v1beta1/backup_grpc.pb.go index 5659deceee..55b4bc0168 100644 --- a/protos/odpf/optimus/core/v1beta1/backup_grpc.pb.go +++ b/protos/raystack/optimus/core/v1beta1/backup_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: odpf/optimus/core/v1beta1/backup.proto +// source: raystack/optimus/core/v1beta1/backup.proto package optimus @@ -37,7 +37,7 @@ func NewBackupServiceClient(cc grpc.ClientConnInterface) BackupServiceClient { func (c *backupServiceClient) CreateBackup(ctx context.Context, in *CreateBackupRequest, opts ...grpc.CallOption) (*CreateBackupResponse, error) { out := new(CreateBackupResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.BackupService/CreateBackup", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.BackupService/CreateBackup", in, out, opts...) if err != nil { return nil, err } @@ -46,7 +46,7 @@ func (c *backupServiceClient) CreateBackup(ctx context.Context, in *CreateBackup func (c *backupServiceClient) ListBackups(ctx context.Context, in *ListBackupsRequest, opts ...grpc.CallOption) (*ListBackupsResponse, error) { out := new(ListBackupsResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.BackupService/ListBackups", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.BackupService/ListBackups", in, out, opts...) if err != nil { return nil, err } @@ -55,7 +55,7 @@ func (c *backupServiceClient) ListBackups(ctx context.Context, in *ListBackupsRe func (c *backupServiceClient) GetBackup(ctx context.Context, in *GetBackupRequest, opts ...grpc.CallOption) (*GetBackupResponse, error) { out := new(GetBackupResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.BackupService/GetBackup", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.BackupService/GetBackup", in, out, opts...) if err != nil { return nil, err } @@ -108,7 +108,7 @@ func _BackupService_CreateBackup_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.BackupService/CreateBackup", + FullMethod: "/raystack.optimus.core.v1beta1.BackupService/CreateBackup", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BackupServiceServer).CreateBackup(ctx, req.(*CreateBackupRequest)) @@ -126,7 +126,7 @@ func _BackupService_ListBackups_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.BackupService/ListBackups", + FullMethod: "/raystack.optimus.core.v1beta1.BackupService/ListBackups", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BackupServiceServer).ListBackups(ctx, req.(*ListBackupsRequest)) @@ -144,7 +144,7 @@ func _BackupService_GetBackup_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.BackupService/GetBackup", + FullMethod: "/raystack.optimus.core.v1beta1.BackupService/GetBackup", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BackupServiceServer).GetBackup(ctx, req.(*GetBackupRequest)) @@ -156,7 +156,7 @@ func _BackupService_GetBackup_Handler(srv interface{}, ctx context.Context, dec // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var BackupService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "odpf.optimus.core.v1beta1.BackupService", + ServiceName: "raystack.optimus.core.v1beta1.BackupService", HandlerType: (*BackupServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -173,5 +173,5 @@ var BackupService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "odpf/optimus/core/v1beta1/backup.proto", + Metadata: "raystack/optimus/core/v1beta1/backup.proto", } diff --git a/protos/raystack/optimus/core/v1beta1/job_run.pb.go b/protos/raystack/optimus/core/v1beta1/job_run.pb.go new file mode 100644 index 0000000000..4ba1cf2d21 --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/job_run.pb.go @@ -0,0 +1,1277 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/core/v1beta1/job_run.proto + +package optimus + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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 InstanceSpec_Type int32 + +const ( + InstanceSpec_TYPE_UNSPECIFIED InstanceSpec_Type = 0 + InstanceSpec_TYPE_TASK InstanceSpec_Type = 1 + InstanceSpec_TYPE_HOOK InstanceSpec_Type = 2 +) + +// Enum value maps for InstanceSpec_Type. +var ( + InstanceSpec_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "TYPE_TASK", + 2: "TYPE_HOOK", + } + InstanceSpec_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "TYPE_TASK": 1, + "TYPE_HOOK": 2, + } +) + +func (x InstanceSpec_Type) Enum() *InstanceSpec_Type { + p := new(InstanceSpec_Type) + *p = x + return p +} + +func (x InstanceSpec_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InstanceSpec_Type) Descriptor() protoreflect.EnumDescriptor { + return file_raystack_optimus_core_v1beta1_job_run_proto_enumTypes[0].Descriptor() +} + +func (InstanceSpec_Type) Type() protoreflect.EnumType { + return &file_raystack_optimus_core_v1beta1_job_run_proto_enumTypes[0] +} + +func (x InstanceSpec_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InstanceSpec_Type.Descriptor instead. +func (InstanceSpec_Type) EnumDescriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{7, 0} +} + +// type of data, could be an env var or file +type InstanceSpecData_Type int32 + +const ( + InstanceSpecData_TYPE_UNSPECIFIED InstanceSpecData_Type = 0 + InstanceSpecData_TYPE_ENV InstanceSpecData_Type = 1 + InstanceSpecData_TYPE_FILE InstanceSpecData_Type = 2 +) + +// Enum value maps for InstanceSpecData_Type. +var ( + InstanceSpecData_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "TYPE_ENV", + 2: "TYPE_FILE", + } + InstanceSpecData_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "TYPE_ENV": 1, + "TYPE_FILE": 2, + } +) + +func (x InstanceSpecData_Type) Enum() *InstanceSpecData_Type { + p := new(InstanceSpecData_Type) + *p = x + return p +} + +func (x InstanceSpecData_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InstanceSpecData_Type) Descriptor() protoreflect.EnumDescriptor { + return file_raystack_optimus_core_v1beta1_job_run_proto_enumTypes[1].Descriptor() +} + +func (InstanceSpecData_Type) Type() protoreflect.EnumType { + return &file_raystack_optimus_core_v1beta1_job_run_proto_enumTypes[1] +} + +func (x InstanceSpecData_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InstanceSpecData_Type.Descriptor instead. +func (InstanceSpecData_Type) EnumDescriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{8, 0} +} + +type UploadToSchedulerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + NamespaceName *string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName,proto3,oneof" json:"namespace_name,omitempty"` +} + +func (x *UploadToSchedulerRequest) Reset() { + *x = UploadToSchedulerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadToSchedulerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadToSchedulerRequest) ProtoMessage() {} + +func (x *UploadToSchedulerRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 UploadToSchedulerRequest.ProtoReflect.Descriptor instead. +func (*UploadToSchedulerRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{0} +} + +func (x *UploadToSchedulerRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *UploadToSchedulerRequest) GetNamespaceName() string { + if x != nil && x.NamespaceName != nil { + return *x.NamespaceName + } + return "" +} + +type UploadToSchedulerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (x *UploadToSchedulerResponse) Reset() { + *x = UploadToSchedulerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadToSchedulerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadToSchedulerResponse) ProtoMessage() {} + +func (x *UploadToSchedulerResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 UploadToSchedulerResponse.ProtoReflect.Descriptor instead. +func (*UploadToSchedulerResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{1} +} + +func (x *UploadToSchedulerResponse) GetStatus() bool { + if x != nil { + return x.Status + } + return false +} + +func (x *UploadToSchedulerResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +type RegisterJobEventRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + Event *JobEvent `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"` +} + +func (x *RegisterJobEventRequest) Reset() { + *x = RegisterJobEventRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterJobEventRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterJobEventRequest) ProtoMessage() {} + +func (x *RegisterJobEventRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 RegisterJobEventRequest.ProtoReflect.Descriptor instead. +func (*RegisterJobEventRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{2} +} + +func (x *RegisterJobEventRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *RegisterJobEventRequest) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *RegisterJobEventRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *RegisterJobEventRequest) GetEvent() *JobEvent { + if x != nil { + return x.Event + } + return nil +} + +type RegisterJobEventResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RegisterJobEventResponse) Reset() { + *x = RegisterJobEventResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterJobEventResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterJobEventResponse) ProtoMessage() {} + +func (x *RegisterJobEventResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 RegisterJobEventResponse.ProtoReflect.Descriptor instead. +func (*RegisterJobEventResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{3} +} + +type JobRunInputRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + ScheduledAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=scheduled_at,json=scheduledAt,proto3" json:"scheduled_at,omitempty"` + InstanceName string `protobuf:"bytes,5,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` + InstanceType InstanceSpec_Type `protobuf:"varint,6,opt,name=instance_type,json=instanceType,proto3,enum=raystack.optimus.core.v1beta1.InstanceSpec_Type" json:"instance_type,omitempty"` + // either set job_name if this is a scheduled execution + // or set jobrun_id if this is a manual triggered execution + // and not really registered as a valid job + JobrunId string `protobuf:"bytes,7,opt,name=jobrun_id,json=jobrunId,proto3" json:"jobrun_id,omitempty"` +} + +func (x *JobRunInputRequest) Reset() { + *x = JobRunInputRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobRunInputRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobRunInputRequest) ProtoMessage() {} + +func (x *JobRunInputRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 JobRunInputRequest.ProtoReflect.Descriptor instead. +func (*JobRunInputRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{4} +} + +func (x *JobRunInputRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *JobRunInputRequest) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *JobRunInputRequest) GetScheduledAt() *timestamppb.Timestamp { + if x != nil { + return x.ScheduledAt + } + return nil +} + +func (x *JobRunInputRequest) GetInstanceName() string { + if x != nil { + return x.InstanceName + } + return "" +} + +func (x *JobRunInputRequest) GetInstanceType() InstanceSpec_Type { + if x != nil { + return x.InstanceType + } + return InstanceSpec_TYPE_UNSPECIFIED +} + +func (x *JobRunInputRequest) GetJobrunId() string { + if x != nil { + return x.JobrunId + } + return "" +} + +type JobRunRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + StartDate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` + EndDate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` + Filter []string `protobuf:"bytes,5,rep,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *JobRunRequest) Reset() { + *x = JobRunRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobRunRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobRunRequest) ProtoMessage() {} + +func (x *JobRunRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 JobRunRequest.ProtoReflect.Descriptor instead. +func (*JobRunRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{5} +} + +func (x *JobRunRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *JobRunRequest) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *JobRunRequest) GetStartDate() *timestamppb.Timestamp { + if x != nil { + return x.StartDate + } + return nil +} + +func (x *JobRunRequest) GetEndDate() *timestamppb.Timestamp { + if x != nil { + return x.EndDate + } + return nil +} + +func (x *JobRunRequest) GetFilter() []string { + if x != nil { + return x.Filter + } + return nil +} + +type JobRunResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + JobRuns []*JobRun `protobuf:"bytes,1,rep,name=job_runs,json=jobRuns,proto3" json:"job_runs,omitempty"` +} + +func (x *JobRunResponse) Reset() { + *x = JobRunResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobRunResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobRunResponse) ProtoMessage() {} + +func (x *JobRunResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 JobRunResponse.ProtoReflect.Descriptor instead. +func (*JobRunResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{6} +} + +func (x *JobRunResponse) GetJobRuns() []*JobRun { + if x != nil { + return x.JobRuns + } + return nil +} + +type InstanceSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State string `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` + Data []*InstanceSpecData `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"` + ExecutedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` + Type InstanceSpec_Type `protobuf:"varint,7,opt,name=type,proto3,enum=raystack.optimus.core.v1beta1.InstanceSpec_Type" json:"type,omitempty"` +} + +func (x *InstanceSpec) Reset() { + *x = InstanceSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstanceSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstanceSpec) ProtoMessage() {} + +func (x *InstanceSpec) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 InstanceSpec.ProtoReflect.Descriptor instead. +func (*InstanceSpec) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{7} +} + +func (x *InstanceSpec) GetState() string { + if x != nil { + return x.State + } + return "" +} + +func (x *InstanceSpec) GetData() []*InstanceSpecData { + if x != nil { + return x.Data + } + return nil +} + +func (x *InstanceSpec) GetExecutedAt() *timestamppb.Timestamp { + if x != nil { + return x.ExecutedAt + } + return nil +} + +func (x *InstanceSpec) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *InstanceSpec) GetType() InstanceSpec_Type { + if x != nil { + return x.Type + } + return InstanceSpec_TYPE_UNSPECIFIED +} + +type InstanceSpecData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Type InstanceSpecData_Type `protobuf:"varint,5,opt,name=type,proto3,enum=raystack.optimus.core.v1beta1.InstanceSpecData_Type" json:"type,omitempty"` +} + +func (x *InstanceSpecData) Reset() { + *x = InstanceSpecData{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstanceSpecData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstanceSpecData) ProtoMessage() {} + +func (x *InstanceSpecData) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 InstanceSpecData.ProtoReflect.Descriptor instead. +func (*InstanceSpecData) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{8} +} + +func (x *InstanceSpecData) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *InstanceSpecData) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *InstanceSpecData) GetType() InstanceSpecData_Type { + if x != nil { + return x.Type + } + return InstanceSpecData_TYPE_UNSPECIFIED +} + +type JobRunInputResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Envs map[string]string `protobuf:"bytes,1,rep,name=envs,proto3" json:"envs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Files map[string]string `protobuf:"bytes,2,rep,name=files,proto3" json:"files,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Secrets map[string]string `protobuf:"bytes,3,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *JobRunInputResponse) Reset() { + *x = JobRunInputResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobRunInputResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobRunInputResponse) ProtoMessage() {} + +func (x *JobRunInputResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 JobRunInputResponse.ProtoReflect.Descriptor instead. +func (*JobRunInputResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{9} +} + +func (x *JobRunInputResponse) GetEnvs() map[string]string { + if x != nil { + return x.Envs + } + return nil +} + +func (x *JobRunInputResponse) GetFiles() map[string]string { + if x != nil { + return x.Files + } + return nil +} + +func (x *JobRunInputResponse) GetSecrets() map[string]string { + if x != nil { + return x.Secrets + } + return nil +} + +type TaskWindow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Size *durationpb.Duration `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"` + Offset *durationpb.Duration `protobuf:"bytes,2,opt,name=offset,proto3" json:"offset,omitempty"` + TruncateTo string `protobuf:"bytes,3,opt,name=truncate_to,json=truncateTo,proto3" json:"truncate_to,omitempty"` +} + +func (x *TaskWindow) Reset() { + *x = TaskWindow{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskWindow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskWindow) ProtoMessage() {} + +func (x *TaskWindow) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_run_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 TaskWindow.ProtoReflect.Descriptor instead. +func (*TaskWindow) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP(), []int{10} +} + +func (x *TaskWindow) GetSize() *durationpb.Duration { + if x != nil { + return x.Size + } + return nil +} + +func (x *TaskWindow) GetOffset() *durationpb.Duration { + if x != nil { + return x.Offset + } + return nil +} + +func (x *TaskWindow) GetTruncateTo() string { + if x != nil { + return x.TruncateTo + } + return "" +} + +var File_raystack_optimus_core_v1beta1_job_run_proto protoreflect.FileDescriptor + +var file_raystack_optimus_core_v1beta1_job_run_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x75, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x20, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x18, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x6f, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, + 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x2a, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, + 0x0f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x58, 0x0a, 0x19, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x6f, 0x53, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xc0, 0x01, 0x0a, 0x17, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x05, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, + 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x1a, 0x0a, + 0x18, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb3, 0x02, 0x0a, 0x12, 0x4a, 0x6f, + 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3d, + 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x41, 0x74, 0x12, 0x23, 0x0a, + 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x58, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x6a, 0x6f, 0x62, 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6a, 0x6f, 0x62, 0x72, 0x75, 0x6e, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, + 0xd7, 0x01, 0x0a, 0x0d, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, + 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x55, 0x0a, 0x0e, 0x4a, 0x6f, 0x62, + 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x08, 0x6a, + 0x6f, 0x62, 0x5f, 0x72, 0x75, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x73, + 0x22, 0xce, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x70, 0x65, + 0x63, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x53, 0x70, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x3b, 0x0a, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x47, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x0a, 0x04, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x54, 0x41, 0x53, 0x4b, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, + 0x4f, 0x4f, 0x4b, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x04, 0x10, + 0x05, 0x22, 0xd0, 0x01, 0x0a, 0x10, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x70, + 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x4b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x39, 0x0a, + 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x56, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, + 0x08, 0x04, 0x10, 0x05, 0x22, 0xcf, 0x03, 0x0a, 0x13, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x04, + 0x65, 0x6e, 0x76, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, + 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x45, 0x6e, 0x76, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x76, + 0x73, 0x12, 0x56, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x40, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x07, 0x73, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, + 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, + 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x45, 0x6e, 0x76, 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, + 0x1a, 0x38, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 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, 0x1a, 0x3a, 0x0a, 0x0c, 0x53, 0x65, + 0x63, 0x72, 0x65, 0x74, 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, 0x8f, 0x01, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x57, + 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x2d, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, + 0x73, 0x69, 0x7a, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x75, 0x6e, 0x63, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, + 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x32, 0xa5, 0x06, 0x0a, 0x0d, 0x4a, 0x6f, 0x62, + 0x52, 0x75, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xbf, 0x01, 0x0a, 0x0b, 0x4a, + 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x34, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, + 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x35, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x22, + 0x38, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, + 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, + 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0xa7, 0x01, 0x0a, + 0x06, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x12, 0x2f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, + 0x75, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x34, 0x12, 0x32, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x2f, 0x72, 0x75, 0x6e, 0x12, 0xe5, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x5a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x54, 0x22, 0x4f, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0xbf, + 0x01, 0x0a, 0x11, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x6f, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x72, 0x12, 0x3a, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x6f, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x3b, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x6f, 0x53, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x1a, 0x26, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x01, 0x2a, + 0x42, 0x8f, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x42, 0x0d, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x92, 0x41, 0x3b, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, + 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, + 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x19, 0x0a, 0x17, 0x4f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x20, 0x4a, 0x6f, 0x62, 0x20, 0x52, 0x75, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_raystack_optimus_core_v1beta1_job_run_proto_rawDescOnce sync.Once + file_raystack_optimus_core_v1beta1_job_run_proto_rawDescData = file_raystack_optimus_core_v1beta1_job_run_proto_rawDesc +) + +func file_raystack_optimus_core_v1beta1_job_run_proto_rawDescGZIP() []byte { + file_raystack_optimus_core_v1beta1_job_run_proto_rawDescOnce.Do(func() { + file_raystack_optimus_core_v1beta1_job_run_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_core_v1beta1_job_run_proto_rawDescData) + }) + return file_raystack_optimus_core_v1beta1_job_run_proto_rawDescData +} + +var file_raystack_optimus_core_v1beta1_job_run_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_raystack_optimus_core_v1beta1_job_run_proto_goTypes = []interface{}{ + (InstanceSpec_Type)(0), // 0: raystack.optimus.core.v1beta1.InstanceSpec.Type + (InstanceSpecData_Type)(0), // 1: raystack.optimus.core.v1beta1.InstanceSpecData.Type + (*UploadToSchedulerRequest)(nil), // 2: raystack.optimus.core.v1beta1.UploadToSchedulerRequest + (*UploadToSchedulerResponse)(nil), // 3: raystack.optimus.core.v1beta1.UploadToSchedulerResponse + (*RegisterJobEventRequest)(nil), // 4: raystack.optimus.core.v1beta1.RegisterJobEventRequest + (*RegisterJobEventResponse)(nil), // 5: raystack.optimus.core.v1beta1.RegisterJobEventResponse + (*JobRunInputRequest)(nil), // 6: raystack.optimus.core.v1beta1.JobRunInputRequest + (*JobRunRequest)(nil), // 7: raystack.optimus.core.v1beta1.JobRunRequest + (*JobRunResponse)(nil), // 8: raystack.optimus.core.v1beta1.JobRunResponse + (*InstanceSpec)(nil), // 9: raystack.optimus.core.v1beta1.InstanceSpec + (*InstanceSpecData)(nil), // 10: raystack.optimus.core.v1beta1.InstanceSpecData + (*JobRunInputResponse)(nil), // 11: raystack.optimus.core.v1beta1.JobRunInputResponse + (*TaskWindow)(nil), // 12: raystack.optimus.core.v1beta1.TaskWindow + nil, // 13: raystack.optimus.core.v1beta1.JobRunInputResponse.EnvsEntry + nil, // 14: raystack.optimus.core.v1beta1.JobRunInputResponse.FilesEntry + nil, // 15: raystack.optimus.core.v1beta1.JobRunInputResponse.SecretsEntry + (*JobEvent)(nil), // 16: raystack.optimus.core.v1beta1.JobEvent + (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp + (*JobRun)(nil), // 18: raystack.optimus.core.v1beta1.JobRun + (*durationpb.Duration)(nil), // 19: google.protobuf.Duration +} +var file_raystack_optimus_core_v1beta1_job_run_proto_depIdxs = []int32{ + 16, // 0: raystack.optimus.core.v1beta1.RegisterJobEventRequest.event:type_name -> raystack.optimus.core.v1beta1.JobEvent + 17, // 1: raystack.optimus.core.v1beta1.JobRunInputRequest.scheduled_at:type_name -> google.protobuf.Timestamp + 0, // 2: raystack.optimus.core.v1beta1.JobRunInputRequest.instance_type:type_name -> raystack.optimus.core.v1beta1.InstanceSpec.Type + 17, // 3: raystack.optimus.core.v1beta1.JobRunRequest.start_date:type_name -> google.protobuf.Timestamp + 17, // 4: raystack.optimus.core.v1beta1.JobRunRequest.end_date:type_name -> google.protobuf.Timestamp + 18, // 5: raystack.optimus.core.v1beta1.JobRunResponse.job_runs:type_name -> raystack.optimus.core.v1beta1.JobRun + 10, // 6: raystack.optimus.core.v1beta1.InstanceSpec.data:type_name -> raystack.optimus.core.v1beta1.InstanceSpecData + 17, // 7: raystack.optimus.core.v1beta1.InstanceSpec.executed_at:type_name -> google.protobuf.Timestamp + 0, // 8: raystack.optimus.core.v1beta1.InstanceSpec.type:type_name -> raystack.optimus.core.v1beta1.InstanceSpec.Type + 1, // 9: raystack.optimus.core.v1beta1.InstanceSpecData.type:type_name -> raystack.optimus.core.v1beta1.InstanceSpecData.Type + 13, // 10: raystack.optimus.core.v1beta1.JobRunInputResponse.envs:type_name -> raystack.optimus.core.v1beta1.JobRunInputResponse.EnvsEntry + 14, // 11: raystack.optimus.core.v1beta1.JobRunInputResponse.files:type_name -> raystack.optimus.core.v1beta1.JobRunInputResponse.FilesEntry + 15, // 12: raystack.optimus.core.v1beta1.JobRunInputResponse.secrets:type_name -> raystack.optimus.core.v1beta1.JobRunInputResponse.SecretsEntry + 19, // 13: raystack.optimus.core.v1beta1.TaskWindow.size:type_name -> google.protobuf.Duration + 19, // 14: raystack.optimus.core.v1beta1.TaskWindow.offset:type_name -> google.protobuf.Duration + 6, // 15: raystack.optimus.core.v1beta1.JobRunService.JobRunInput:input_type -> raystack.optimus.core.v1beta1.JobRunInputRequest + 7, // 16: raystack.optimus.core.v1beta1.JobRunService.JobRun:input_type -> raystack.optimus.core.v1beta1.JobRunRequest + 4, // 17: raystack.optimus.core.v1beta1.JobRunService.RegisterJobEvent:input_type -> raystack.optimus.core.v1beta1.RegisterJobEventRequest + 2, // 18: raystack.optimus.core.v1beta1.JobRunService.UploadToScheduler:input_type -> raystack.optimus.core.v1beta1.UploadToSchedulerRequest + 11, // 19: raystack.optimus.core.v1beta1.JobRunService.JobRunInput:output_type -> raystack.optimus.core.v1beta1.JobRunInputResponse + 8, // 20: raystack.optimus.core.v1beta1.JobRunService.JobRun:output_type -> raystack.optimus.core.v1beta1.JobRunResponse + 5, // 21: raystack.optimus.core.v1beta1.JobRunService.RegisterJobEvent:output_type -> raystack.optimus.core.v1beta1.RegisterJobEventResponse + 3, // 22: raystack.optimus.core.v1beta1.JobRunService.UploadToScheduler:output_type -> raystack.optimus.core.v1beta1.UploadToSchedulerResponse + 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 +} + +func init() { file_raystack_optimus_core_v1beta1_job_run_proto_init() } +func file_raystack_optimus_core_v1beta1_job_run_proto_init() { + if File_raystack_optimus_core_v1beta1_job_run_proto != nil { + return + } + file_raystack_optimus_core_v1beta1_job_spec_proto_init() + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadToSchedulerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadToSchedulerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterJobEventRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterJobEventResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JobRunInputRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JobRunRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JobRunResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstanceSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstanceSpecData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JobRunInputResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskWindow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_raystack_optimus_core_v1beta1_job_run_proto_rawDesc, + NumEnums: 2, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_raystack_optimus_core_v1beta1_job_run_proto_goTypes, + DependencyIndexes: file_raystack_optimus_core_v1beta1_job_run_proto_depIdxs, + EnumInfos: file_raystack_optimus_core_v1beta1_job_run_proto_enumTypes, + MessageInfos: file_raystack_optimus_core_v1beta1_job_run_proto_msgTypes, + }.Build() + File_raystack_optimus_core_v1beta1_job_run_proto = out.File + file_raystack_optimus_core_v1beta1_job_run_proto_rawDesc = nil + file_raystack_optimus_core_v1beta1_job_run_proto_goTypes = nil + file_raystack_optimus_core_v1beta1_job_run_proto_depIdxs = nil +} diff --git a/protos/odpf/optimus/core/v1beta1/job_run.pb.gw.go b/protos/raystack/optimus/core/v1beta1/job_run.pb.gw.go similarity index 94% rename from protos/odpf/optimus/core/v1beta1/job_run.pb.gw.go rename to protos/raystack/optimus/core/v1beta1/job_run.pb.gw.go index e862b2b570..51c7c5ab20 100644 --- a/protos/odpf/optimus/core/v1beta1/job_run.pb.gw.go +++ b/protos/raystack/optimus/core/v1beta1/job_run.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: odpf/optimus/core/v1beta1/job_run.proto +// source: raystack/optimus/core/v1beta1/job_run.proto /* Package optimus is a reverse proxy. @@ -397,7 +397,7 @@ func RegisterJobRunServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobRunService/JobRunInput", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/{job_name}/run_input")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobRunService/JobRunInput", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/{job_name}/run_input")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -420,7 +420,7 @@ func RegisterJobRunServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobRunService/JobRun", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/{job_name}/run")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobRunService/JobRun", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/{job_name}/run")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -443,7 +443,7 @@ func RegisterJobRunServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobRunService/RegisterJobEvent", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}/event")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobRunService/RegisterJobEvent", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}/event")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -466,7 +466,7 @@ func RegisterJobRunServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobRunService/UploadToScheduler", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/upload")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobRunService/UploadToScheduler", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/upload")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -528,7 +528,7 @@ func RegisterJobRunServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobRunService/JobRunInput", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/{job_name}/run_input")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobRunService/JobRunInput", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/{job_name}/run_input")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -548,7 +548,7 @@ func RegisterJobRunServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobRunService/JobRun", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/{job_name}/run")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobRunService/JobRun", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/{job_name}/run")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -568,7 +568,7 @@ func RegisterJobRunServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobRunService/RegisterJobEvent", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}/event")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobRunService/RegisterJobEvent", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}/event")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -588,7 +588,7 @@ func RegisterJobRunServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobRunService/UploadToScheduler", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/upload")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobRunService/UploadToScheduler", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/upload")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/protos/odpf/optimus/core/v1beta1/job_run.swagger.json b/protos/raystack/optimus/core/v1beta1/job_run.swagger.json similarity index 94% rename from protos/odpf/optimus/core/v1beta1/job_run.swagger.json rename to protos/raystack/optimus/core/v1beta1/job_run.swagger.json index 0205dbf7ad..124f1198d4 100644 --- a/protos/odpf/optimus/core/v1beta1/job_run.swagger.json +++ b/protos/raystack/optimus/core/v1beta1/job_run.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/core/v1beta1/job_run.proto", + "title": "raystack/optimus/core/v1beta1/job_run.proto", "version": "0.1" }, "tags": [ @@ -11,15 +11,9 @@ ], "host": "127.0.0.1:9100", "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { "/v1beta1/project/{projectName}/job/{jobName}/run": { "get": { @@ -77,9 +71,7 @@ "collectionFormat": "multi" } ], - "tags": [ - "JobRunService" - ] + "tags": ["JobRunService"] } }, "/v1beta1/project/{projectName}/job/{jobName}/run_input": { @@ -138,9 +130,7 @@ } } ], - "tags": [ - "JobRunService" - ] + "tags": ["JobRunService"] } }, "/v1beta1/project/{projectName}/namespace/{namespaceName}/job/{jobName}/event": { @@ -194,9 +184,7 @@ } } ], - "tags": [ - "JobRunService" - ] + "tags": ["JobRunService"] } }, "/v1beta1/project/{projectName}/upload": { @@ -238,9 +226,7 @@ } } ], - "tags": [ - "JobRunService" - ] + "tags": ["JobRunService"] } } }, @@ -259,9 +245,7 @@ }, "protobufNullValue": { "type": "string", - "enum": [ - "NULL_VALUE" - ], + "enum": ["NULL_VALUE"], "default": "NULL_VALUE", "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." }, @@ -285,11 +269,7 @@ }, "v1beta1InstanceSpecType": { "type": "string", - "enum": [ - "TYPE_UNSPECIFIED", - "TYPE_TASK", - "TYPE_HOOK" - ], + "enum": ["TYPE_UNSPECIFIED", "TYPE_TASK", "TYPE_HOOK"], "default": "TYPE_UNSPECIFIED" }, "v1beta1JobEvent": { diff --git a/protos/odpf/optimus/core/v1beta1/job_run_grpc.pb.go b/protos/raystack/optimus/core/v1beta1/job_run_grpc.pb.go similarity index 90% rename from protos/odpf/optimus/core/v1beta1/job_run_grpc.pb.go rename to protos/raystack/optimus/core/v1beta1/job_run_grpc.pb.go index f2f716fce0..fca6b5646f 100644 --- a/protos/odpf/optimus/core/v1beta1/job_run_grpc.pb.go +++ b/protos/raystack/optimus/core/v1beta1/job_run_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: odpf/optimus/core/v1beta1/job_run.proto +// source: raystack/optimus/core/v1beta1/job_run.proto package optimus @@ -42,7 +42,7 @@ func NewJobRunServiceClient(cc grpc.ClientConnInterface) JobRunServiceClient { func (c *jobRunServiceClient) JobRunInput(ctx context.Context, in *JobRunInputRequest, opts ...grpc.CallOption) (*JobRunInputResponse, error) { out := new(JobRunInputResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobRunService/JobRunInput", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobRunService/JobRunInput", in, out, opts...) if err != nil { return nil, err } @@ -51,7 +51,7 @@ func (c *jobRunServiceClient) JobRunInput(ctx context.Context, in *JobRunInputRe func (c *jobRunServiceClient) JobRun(ctx context.Context, in *JobRunRequest, opts ...grpc.CallOption) (*JobRunResponse, error) { out := new(JobRunResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobRunService/JobRun", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobRunService/JobRun", in, out, opts...) if err != nil { return nil, err } @@ -60,7 +60,7 @@ func (c *jobRunServiceClient) JobRun(ctx context.Context, in *JobRunRequest, opt func (c *jobRunServiceClient) RegisterJobEvent(ctx context.Context, in *RegisterJobEventRequest, opts ...grpc.CallOption) (*RegisterJobEventResponse, error) { out := new(RegisterJobEventResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobRunService/RegisterJobEvent", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobRunService/RegisterJobEvent", in, out, opts...) if err != nil { return nil, err } @@ -69,7 +69,7 @@ func (c *jobRunServiceClient) RegisterJobEvent(ctx context.Context, in *Register func (c *jobRunServiceClient) UploadToScheduler(ctx context.Context, in *UploadToSchedulerRequest, opts ...grpc.CallOption) (*UploadToSchedulerResponse, error) { out := new(UploadToSchedulerResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobRunService/UploadToScheduler", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobRunService/UploadToScheduler", in, out, opts...) if err != nil { return nil, err } @@ -130,7 +130,7 @@ func _JobRunService_JobRunInput_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobRunService/JobRunInput", + FullMethod: "/raystack.optimus.core.v1beta1.JobRunService/JobRunInput", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobRunServiceServer).JobRunInput(ctx, req.(*JobRunInputRequest)) @@ -148,7 +148,7 @@ func _JobRunService_JobRun_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobRunService/JobRun", + FullMethod: "/raystack.optimus.core.v1beta1.JobRunService/JobRun", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobRunServiceServer).JobRun(ctx, req.(*JobRunRequest)) @@ -166,7 +166,7 @@ func _JobRunService_RegisterJobEvent_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobRunService/RegisterJobEvent", + FullMethod: "/raystack.optimus.core.v1beta1.JobRunService/RegisterJobEvent", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobRunServiceServer).RegisterJobEvent(ctx, req.(*RegisterJobEventRequest)) @@ -184,7 +184,7 @@ func _JobRunService_UploadToScheduler_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobRunService/UploadToScheduler", + FullMethod: "/raystack.optimus.core.v1beta1.JobRunService/UploadToScheduler", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobRunServiceServer).UploadToScheduler(ctx, req.(*UploadToSchedulerRequest)) @@ -196,7 +196,7 @@ func _JobRunService_UploadToScheduler_Handler(srv interface{}, ctx context.Conte // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var JobRunService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "odpf.optimus.core.v1beta1.JobRunService", + ServiceName: "raystack.optimus.core.v1beta1.JobRunService", HandlerType: (*JobRunServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -217,5 +217,5 @@ var JobRunService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "odpf/optimus/core/v1beta1/job_run.proto", + Metadata: "raystack/optimus/core/v1beta1/job_run.proto", } diff --git a/protos/odpf/optimus/core/v1beta1/job_spec.pb.go b/protos/raystack/optimus/core/v1beta1/job_spec.pb.go similarity index 51% rename from protos/odpf/optimus/core/v1beta1/job_spec.pb.go rename to protos/raystack/optimus/core/v1beta1/job_spec.pb.go index 4d73531d92..8ea2b1ee54 100644 --- a/protos/odpf/optimus/core/v1beta1/job_spec.pb.go +++ b/protos/raystack/optimus/core/v1beta1/job_spec.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.28.0 // protoc (unknown) -// source: odpf/optimus/core/v1beta1/job_spec.proto +// source: raystack/optimus/core/v1beta1/job_spec.proto package optimus @@ -25,6 +25,55 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type JobState int32 + +const ( + JobState_JOB_STATE_UNSPECIFIED JobState = 0 + JobState_JOB_STATE_ENABLED JobState = 1 + JobState_JOB_STATE_DISABLED JobState = 2 +) + +// Enum value maps for JobState. +var ( + JobState_name = map[int32]string{ + 0: "JOB_STATE_UNSPECIFIED", + 1: "JOB_STATE_ENABLED", + 2: "JOB_STATE_DISABLED", + } + JobState_value = map[string]int32{ + "JOB_STATE_UNSPECIFIED": 0, + "JOB_STATE_ENABLED": 1, + "JOB_STATE_DISABLED": 2, + } +) + +func (x JobState) Enum() *JobState { + p := new(JobState) + *p = x + return p +} + +func (x JobState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (JobState) Descriptor() protoreflect.EnumDescriptor { + return file_raystack_optimus_core_v1beta1_job_spec_proto_enumTypes[0].Descriptor() +} + +func (JobState) Type() protoreflect.EnumType { + return &file_raystack_optimus_core_v1beta1_job_spec_proto_enumTypes[0] +} + +func (x JobState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use JobState.Descriptor instead. +func (JobState) EnumDescriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{0} +} + type JobEvent_Type int32 const ( @@ -97,11 +146,11 @@ func (x JobEvent_Type) String() string { } func (JobEvent_Type) Descriptor() protoreflect.EnumDescriptor { - return file_odpf_optimus_core_v1beta1_job_spec_proto_enumTypes[0].Descriptor() + return file_raystack_optimus_core_v1beta1_job_spec_proto_enumTypes[1].Descriptor() } func (JobEvent_Type) Type() protoreflect.EnumType { - return &file_odpf_optimus_core_v1beta1_job_spec_proto_enumTypes[0] + return &file_raystack_optimus_core_v1beta1_job_spec_proto_enumTypes[1] } func (x JobEvent_Type) Number() protoreflect.EnumNumber { @@ -110,7 +159,7 @@ func (x JobEvent_Type) Number() protoreflect.EnumNumber { // Deprecated: Use JobEvent_Type.Descriptor instead. func (JobEvent_Type) EnumDescriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{26, 0} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{28, 0} } type DeployJobSpecificationRequest struct { @@ -126,7 +175,7 @@ type DeployJobSpecificationRequest struct { func (x *DeployJobSpecificationRequest) Reset() { *x = DeployJobSpecificationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[0] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -139,7 +188,7 @@ func (x *DeployJobSpecificationRequest) String() string { func (*DeployJobSpecificationRequest) ProtoMessage() {} func (x *DeployJobSpecificationRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[0] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -152,7 +201,7 @@ func (x *DeployJobSpecificationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeployJobSpecificationRequest.ProtoReflect.Descriptor instead. func (*DeployJobSpecificationRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{0} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{0} } func (x *DeployJobSpecificationRequest) GetProjectName() string { @@ -190,7 +239,7 @@ type DeployJobSpecificationResponse struct { func (x *DeployJobSpecificationResponse) Reset() { *x = DeployJobSpecificationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[1] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -203,7 +252,7 @@ func (x *DeployJobSpecificationResponse) String() string { func (*DeployJobSpecificationResponse) ProtoMessage() {} func (x *DeployJobSpecificationResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[1] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -216,7 +265,7 @@ func (x *DeployJobSpecificationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeployJobSpecificationResponse.ProtoReflect.Descriptor instead. func (*DeployJobSpecificationResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{1} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{1} } func (x *DeployJobSpecificationResponse) GetDeploymentId() string { @@ -246,7 +295,7 @@ type AddJobSpecificationsRequest struct { func (x *AddJobSpecificationsRequest) Reset() { *x = AddJobSpecificationsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[2] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -259,7 +308,7 @@ func (x *AddJobSpecificationsRequest) String() string { func (*AddJobSpecificationsRequest) ProtoMessage() {} func (x *AddJobSpecificationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[2] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -272,7 +321,7 @@ func (x *AddJobSpecificationsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddJobSpecificationsRequest.ProtoReflect.Descriptor instead. func (*AddJobSpecificationsRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{2} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{2} } func (x *AddJobSpecificationsRequest) GetProjectName() string { @@ -307,7 +356,7 @@ type AddJobSpecificationsResponse struct { func (x *AddJobSpecificationsResponse) Reset() { *x = AddJobSpecificationsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[3] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -320,7 +369,7 @@ func (x *AddJobSpecificationsResponse) String() string { func (*AddJobSpecificationsResponse) ProtoMessage() {} func (x *AddJobSpecificationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[3] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -333,7 +382,7 @@ func (x *AddJobSpecificationsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddJobSpecificationsResponse.ProtoReflect.Descriptor instead. func (*AddJobSpecificationsResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{3} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{3} } func (x *AddJobSpecificationsResponse) GetLog() string { @@ -356,7 +405,7 @@ type UpdateJobSpecificationsRequest struct { func (x *UpdateJobSpecificationsRequest) Reset() { *x = UpdateJobSpecificationsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[4] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -369,7 +418,7 @@ func (x *UpdateJobSpecificationsRequest) String() string { func (*UpdateJobSpecificationsRequest) ProtoMessage() {} func (x *UpdateJobSpecificationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[4] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -382,7 +431,7 @@ func (x *UpdateJobSpecificationsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateJobSpecificationsRequest.ProtoReflect.Descriptor instead. func (*UpdateJobSpecificationsRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{4} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{4} } func (x *UpdateJobSpecificationsRequest) GetProjectName() string { @@ -417,7 +466,7 @@ type UpdateJobSpecificationsResponse struct { func (x *UpdateJobSpecificationsResponse) Reset() { *x = UpdateJobSpecificationsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[5] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -430,7 +479,7 @@ func (x *UpdateJobSpecificationsResponse) String() string { func (*UpdateJobSpecificationsResponse) ProtoMessage() {} func (x *UpdateJobSpecificationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[5] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -443,7 +492,7 @@ func (x *UpdateJobSpecificationsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateJobSpecificationsResponse.ProtoReflect.Descriptor instead. func (*UpdateJobSpecificationsResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{5} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{5} } func (x *UpdateJobSpecificationsResponse) GetLog() string { @@ -468,7 +517,7 @@ type JobInspectRequest struct { func (x *JobInspectRequest) Reset() { *x = JobInspectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[6] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -481,7 +530,7 @@ func (x *JobInspectRequest) String() string { func (*JobInspectRequest) ProtoMessage() {} func (x *JobInspectRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[6] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -494,7 +543,7 @@ func (x *JobInspectRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use JobInspectRequest.ProtoReflect.Descriptor instead. func (*JobInspectRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{6} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{6} } func (x *JobInspectRequest) GetProjectName() string { @@ -544,7 +593,7 @@ type JobRun struct { func (x *JobRun) Reset() { *x = JobRun{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[7] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -557,7 +606,7 @@ func (x *JobRun) String() string { func (*JobRun) ProtoMessage() {} func (x *JobRun) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[7] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -570,7 +619,7 @@ func (x *JobRun) ProtoReflect() protoreflect.Message { // Deprecated: Use JobRun.ProtoReflect.Descriptor instead. func (*JobRun) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{7} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{7} } func (x *JobRun) GetState() string { @@ -600,7 +649,7 @@ type JobInspectResponse struct { func (x *JobInspectResponse) Reset() { *x = JobInspectResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[8] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -613,7 +662,7 @@ func (x *JobInspectResponse) String() string { func (*JobInspectResponse) ProtoMessage() {} func (x *JobInspectResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[8] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -626,7 +675,7 @@ func (x *JobInspectResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use JobInspectResponse.ProtoReflect.Descriptor instead. func (*JobInspectResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8} } func (x *JobInspectResponse) GetBasicInfo() *JobInspectResponse_BasicInfoSection { @@ -663,7 +712,7 @@ type CreateJobSpecificationRequest struct { func (x *CreateJobSpecificationRequest) Reset() { *x = CreateJobSpecificationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[9] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -676,7 +725,7 @@ func (x *CreateJobSpecificationRequest) String() string { func (*CreateJobSpecificationRequest) ProtoMessage() {} func (x *CreateJobSpecificationRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[9] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -689,7 +738,7 @@ func (x *CreateJobSpecificationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateJobSpecificationRequest.ProtoReflect.Descriptor instead. func (*CreateJobSpecificationRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{9} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{9} } func (x *CreateJobSpecificationRequest) GetProjectName() string { @@ -725,7 +774,7 @@ type CreateJobSpecificationResponse struct { func (x *CreateJobSpecificationResponse) Reset() { *x = CreateJobSpecificationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[10] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -738,7 +787,7 @@ func (x *CreateJobSpecificationResponse) String() string { func (*CreateJobSpecificationResponse) ProtoMessage() {} func (x *CreateJobSpecificationResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[10] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -751,7 +800,7 @@ func (x *CreateJobSpecificationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateJobSpecificationResponse.ProtoReflect.Descriptor instead. func (*CreateJobSpecificationResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{10} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{10} } func (x *CreateJobSpecificationResponse) GetSuccess() bool { @@ -781,7 +830,7 @@ type GetJobSpecificationRequest struct { func (x *GetJobSpecificationRequest) Reset() { *x = GetJobSpecificationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[11] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -794,7 +843,7 @@ func (x *GetJobSpecificationRequest) String() string { func (*GetJobSpecificationRequest) ProtoMessage() {} func (x *GetJobSpecificationRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[11] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -807,7 +856,7 @@ func (x *GetJobSpecificationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetJobSpecificationRequest.ProtoReflect.Descriptor instead. func (*GetJobSpecificationRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{11} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{11} } func (x *GetJobSpecificationRequest) GetProjectName() string { @@ -842,7 +891,7 @@ type GetJobSpecificationResponse struct { func (x *GetJobSpecificationResponse) Reset() { *x = GetJobSpecificationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[12] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -855,7 +904,7 @@ func (x *GetJobSpecificationResponse) String() string { func (*GetJobSpecificationResponse) ProtoMessage() {} func (x *GetJobSpecificationResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[12] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -868,7 +917,7 @@ func (x *GetJobSpecificationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetJobSpecificationResponse.ProtoReflect.Descriptor instead. func (*GetJobSpecificationResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{12} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{12} } func (x *GetJobSpecificationResponse) GetSpec() *JobSpecification { @@ -893,7 +942,7 @@ type DeleteJobSpecificationRequest struct { func (x *DeleteJobSpecificationRequest) Reset() { *x = DeleteJobSpecificationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[13] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -906,7 +955,7 @@ func (x *DeleteJobSpecificationRequest) String() string { func (*DeleteJobSpecificationRequest) ProtoMessage() {} func (x *DeleteJobSpecificationRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[13] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -919,7 +968,7 @@ func (x *DeleteJobSpecificationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteJobSpecificationRequest.ProtoReflect.Descriptor instead. func (*DeleteJobSpecificationRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{13} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{13} } func (x *DeleteJobSpecificationRequest) GetProjectName() string { @@ -969,7 +1018,7 @@ type DeleteJobSpecificationResponse struct { func (x *DeleteJobSpecificationResponse) Reset() { *x = DeleteJobSpecificationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[14] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -982,7 +1031,7 @@ func (x *DeleteJobSpecificationResponse) String() string { func (*DeleteJobSpecificationResponse) ProtoMessage() {} func (x *DeleteJobSpecificationResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[14] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -995,7 +1044,7 @@ func (x *DeleteJobSpecificationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteJobSpecificationResponse.ProtoReflect.Descriptor instead. func (*DeleteJobSpecificationResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{14} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{14} } func (x *DeleteJobSpecificationResponse) GetSuccess() bool { @@ -1012,6 +1061,115 @@ func (x *DeleteJobSpecificationResponse) GetMessage() string { return "" } +type ChangeJobNamespaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + JobName string `protobuf:"bytes,3,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + NewNamespaceName string `protobuf:"bytes,4,opt,name=new_namespace_name,json=newNamespaceName,proto3" json:"new_namespace_name,omitempty"` +} + +func (x *ChangeJobNamespaceRequest) Reset() { + *x = ChangeJobNamespaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeJobNamespaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeJobNamespaceRequest) ProtoMessage() {} + +func (x *ChangeJobNamespaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_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 ChangeJobNamespaceRequest.ProtoReflect.Descriptor instead. +func (*ChangeJobNamespaceRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{15} +} + +func (x *ChangeJobNamespaceRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *ChangeJobNamespaceRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *ChangeJobNamespaceRequest) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *ChangeJobNamespaceRequest) GetNewNamespaceName() string { + if x != nil { + return x.NewNamespaceName + } + return "" +} + +type ChangeJobNamespaceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChangeJobNamespaceResponse) Reset() { + *x = ChangeJobNamespaceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeJobNamespaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeJobNamespaceResponse) ProtoMessage() {} + +func (x *ChangeJobNamespaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_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 ChangeJobNamespaceResponse.ProtoReflect.Descriptor instead. +func (*ChangeJobNamespaceResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{16} +} + type ListJobSpecificationRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1024,7 +1182,7 @@ type ListJobSpecificationRequest struct { func (x *ListJobSpecificationRequest) Reset() { *x = ListJobSpecificationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[15] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1037,7 +1195,7 @@ func (x *ListJobSpecificationRequest) String() string { func (*ListJobSpecificationRequest) ProtoMessage() {} func (x *ListJobSpecificationRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[15] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1050,7 +1208,7 @@ func (x *ListJobSpecificationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListJobSpecificationRequest.ProtoReflect.Descriptor instead. func (*ListJobSpecificationRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{15} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{17} } func (x *ListJobSpecificationRequest) GetProjectName() string { @@ -1078,7 +1236,7 @@ type ListJobSpecificationResponse struct { func (x *ListJobSpecificationResponse) Reset() { *x = ListJobSpecificationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[16] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1091,7 +1249,7 @@ func (x *ListJobSpecificationResponse) String() string { func (*ListJobSpecificationResponse) ProtoMessage() {} func (x *ListJobSpecificationResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[16] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1104,7 +1262,7 @@ func (x *ListJobSpecificationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListJobSpecificationResponse.ProtoReflect.Descriptor instead. func (*ListJobSpecificationResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{16} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{18} } func (x *ListJobSpecificationResponse) GetJobs() []*JobSpecification { @@ -1127,7 +1285,7 @@ type CheckJobSpecificationRequest struct { func (x *CheckJobSpecificationRequest) Reset() { *x = CheckJobSpecificationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[17] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1140,7 +1298,7 @@ func (x *CheckJobSpecificationRequest) String() string { func (*CheckJobSpecificationRequest) ProtoMessage() {} func (x *CheckJobSpecificationRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[17] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1153,7 +1311,7 @@ func (x *CheckJobSpecificationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckJobSpecificationRequest.ProtoReflect.Descriptor instead. func (*CheckJobSpecificationRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{17} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{19} } func (x *CheckJobSpecificationRequest) GetProjectName() string { @@ -1188,7 +1346,7 @@ type CheckJobSpecificationResponse struct { func (x *CheckJobSpecificationResponse) Reset() { *x = CheckJobSpecificationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[18] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1201,7 +1359,7 @@ func (x *CheckJobSpecificationResponse) String() string { func (*CheckJobSpecificationResponse) ProtoMessage() {} func (x *CheckJobSpecificationResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[18] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1214,7 +1372,7 @@ func (x *CheckJobSpecificationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckJobSpecificationResponse.ProtoReflect.Descriptor instead. func (*CheckJobSpecificationResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{18} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{20} } func (x *CheckJobSpecificationResponse) GetSuccess() bool { @@ -1237,7 +1395,7 @@ type CheckJobSpecificationsRequest struct { func (x *CheckJobSpecificationsRequest) Reset() { *x = CheckJobSpecificationsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[19] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1250,7 +1408,7 @@ func (x *CheckJobSpecificationsRequest) String() string { func (*CheckJobSpecificationsRequest) ProtoMessage() {} func (x *CheckJobSpecificationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[19] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1263,7 +1421,7 @@ func (x *CheckJobSpecificationsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckJobSpecificationsRequest.ProtoReflect.Descriptor instead. func (*CheckJobSpecificationsRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{19} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{21} } func (x *CheckJobSpecificationsRequest) GetProjectName() string { @@ -1298,7 +1456,7 @@ type CheckJobSpecificationsResponse struct { func (x *CheckJobSpecificationsResponse) Reset() { *x = CheckJobSpecificationsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[20] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1311,7 +1469,7 @@ func (x *CheckJobSpecificationsResponse) String() string { func (*CheckJobSpecificationsResponse) ProtoMessage() {} func (x *CheckJobSpecificationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[20] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1324,7 +1482,7 @@ func (x *CheckJobSpecificationsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckJobSpecificationsResponse.ProtoReflect.Descriptor instead. func (*CheckJobSpecificationsResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{20} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{22} } func (x *CheckJobSpecificationsResponse) GetLogStatus() *Log { @@ -1339,14 +1497,15 @@ type JobSpecification struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - StartDate string `protobuf:"bytes,4,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` - EndDate string `protobuf:"bytes,5,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` // optional - Interval string `protobuf:"bytes,6,opt,name=interval,proto3" json:"interval,omitempty"` - DependsOnPast bool `protobuf:"varint,7,opt,name=depends_on_past,json=dependsOnPast,proto3" json:"depends_on_past,omitempty"` // should only execute today if yesterday was completed with success? - CatchUp bool `protobuf:"varint,8,opt,name=catch_up,json=catchUp,proto3" json:"catch_up,omitempty"` // should backfill till today? + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` + StartDate string `protobuf:"bytes,4,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` + EndDate string `protobuf:"bytes,5,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` // optional + Interval string `protobuf:"bytes,6,opt,name=interval,proto3" json:"interval,omitempty"` + DependsOnPast bool `protobuf:"varint,7,opt,name=depends_on_past,json=dependsOnPast,proto3" json:"depends_on_past,omitempty"` // should only execute today if yesterday was completed with success? + // Deprecated: Do not use. + CatchUp bool `protobuf:"varint,8,opt,name=catch_up,json=catchUp,proto3" json:"catch_up,omitempty"` // should backfill till today? TaskName string `protobuf:"bytes,9,opt,name=task_name,json=taskName,proto3" json:"task_name,omitempty"` Config []*JobConfigItem `protobuf:"bytes,10,rep,name=config,proto3" json:"config,omitempty"` WindowSize string `protobuf:"bytes,11,opt,name=window_size,json=windowSize,proto3" json:"window_size,omitempty"` @@ -1366,7 +1525,7 @@ type JobSpecification struct { func (x *JobSpecification) Reset() { *x = JobSpecification{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[21] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1379,7 +1538,7 @@ func (x *JobSpecification) String() string { func (*JobSpecification) ProtoMessage() {} func (x *JobSpecification) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[21] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1392,7 +1551,7 @@ func (x *JobSpecification) ProtoReflect() protoreflect.Message { // Deprecated: Use JobSpecification.ProtoReflect.Descriptor instead. func (*JobSpecification) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{21} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{23} } func (x *JobSpecification) GetVersion() int32 { @@ -1444,6 +1603,7 @@ func (x *JobSpecification) GetDependsOnPast() bool { return false } +// Deprecated: Do not use. func (x *JobSpecification) GetCatchUp() bool { if x != nil { return x.CatchUp @@ -1562,7 +1722,7 @@ type JobDependency struct { func (x *JobDependency) Reset() { *x = JobDependency{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[22] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1575,7 +1735,7 @@ func (x *JobDependency) String() string { func (*JobDependency) ProtoMessage() {} func (x *JobDependency) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[22] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1588,7 +1748,7 @@ func (x *JobDependency) ProtoReflect() protoreflect.Message { // Deprecated: Use JobDependency.ProtoReflect.Descriptor instead. func (*JobDependency) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{22} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{24} } func (x *JobDependency) GetName() string { @@ -1626,7 +1786,7 @@ type HttpDependency struct { func (x *HttpDependency) Reset() { *x = HttpDependency{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[23] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1639,7 +1799,7 @@ func (x *HttpDependency) String() string { func (*HttpDependency) ProtoMessage() {} func (x *HttpDependency) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[23] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1652,7 +1812,7 @@ func (x *HttpDependency) ProtoReflect() protoreflect.Message { // Deprecated: Use HttpDependency.ProtoReflect.Descriptor instead. func (*HttpDependency) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{23} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{25} } func (x *HttpDependency) GetName() string { @@ -1695,7 +1855,7 @@ type JobSpecHook struct { func (x *JobSpecHook) Reset() { *x = JobSpecHook{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[24] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1708,7 +1868,7 @@ func (x *JobSpecHook) String() string { func (*JobSpecHook) ProtoMessage() {} func (x *JobSpecHook) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[24] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1721,7 +1881,7 @@ func (x *JobSpecHook) ProtoReflect() protoreflect.Message { // Deprecated: Use JobSpecHook.ProtoReflect.Descriptor instead. func (*JobSpecHook) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{24} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{26} } func (x *JobSpecHook) GetName() string { @@ -1750,7 +1910,7 @@ type JobConfigItem struct { func (x *JobConfigItem) Reset() { *x = JobConfigItem{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[25] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1763,7 +1923,7 @@ func (x *JobConfigItem) String() string { func (*JobConfigItem) ProtoMessage() {} func (x *JobConfigItem) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[25] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1776,7 +1936,7 @@ func (x *JobConfigItem) ProtoReflect() protoreflect.Message { // Deprecated: Use JobConfigItem.ProtoReflect.Descriptor instead. func (*JobConfigItem) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{25} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{27} } func (x *JobConfigItem) GetName() string { @@ -1798,14 +1958,14 @@ type JobEvent struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type JobEvent_Type `protobuf:"varint,1,opt,name=type,proto3,enum=odpf.optimus.core.v1beta1.JobEvent_Type" json:"type,omitempty"` + Type JobEvent_Type `protobuf:"varint,1,opt,name=type,proto3,enum=raystack.optimus.core.v1beta1.JobEvent_Type" json:"type,omitempty"` Value *structpb.Struct `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *JobEvent) Reset() { *x = JobEvent{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[26] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1818,7 +1978,7 @@ func (x *JobEvent) String() string { func (*JobEvent) ProtoMessage() {} func (x *JobEvent) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[26] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1831,7 +1991,7 @@ func (x *JobEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use JobEvent.ProtoReflect.Descriptor instead. func (*JobEvent) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{26} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{28} } func (x *JobEvent) GetType() JobEvent_Type { @@ -1860,7 +2020,7 @@ type JobMetadata struct { func (x *JobMetadata) Reset() { *x = JobMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[27] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1873,7 +2033,7 @@ func (x *JobMetadata) String() string { func (*JobMetadata) ProtoMessage() {} func (x *JobMetadata) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[27] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1886,7 +2046,7 @@ func (x *JobMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use JobMetadata.ProtoReflect.Descriptor instead. func (*JobMetadata) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{27} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{29} } func (x *JobMetadata) GetResource() *JobSpecMetadataResource { @@ -1915,7 +2075,7 @@ type JobSpecMetadataResource struct { func (x *JobSpecMetadataResource) Reset() { *x = JobSpecMetadataResource{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[28] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1928,7 +2088,7 @@ func (x *JobSpecMetadataResource) String() string { func (*JobSpecMetadataResource) ProtoMessage() {} func (x *JobSpecMetadataResource) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[28] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1941,7 +2101,7 @@ func (x *JobSpecMetadataResource) ProtoReflect() protoreflect.Message { // Deprecated: Use JobSpecMetadataResource.ProtoReflect.Descriptor instead. func (*JobSpecMetadataResource) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{28} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{30} } func (x *JobSpecMetadataResource) GetRequest() *JobSpecMetadataResourceConfig { @@ -1970,7 +2130,7 @@ type JobSpecMetadataResourceConfig struct { func (x *JobSpecMetadataResourceConfig) Reset() { *x = JobSpecMetadataResourceConfig{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[29] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1983,7 +2143,7 @@ func (x *JobSpecMetadataResourceConfig) String() string { func (*JobSpecMetadataResourceConfig) ProtoMessage() {} func (x *JobSpecMetadataResourceConfig) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[29] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1996,7 +2156,7 @@ func (x *JobSpecMetadataResourceConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use JobSpecMetadataResourceConfig.ProtoReflect.Descriptor instead. func (*JobSpecMetadataResourceConfig) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{29} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{31} } func (x *JobSpecMetadataResourceConfig) GetCpu() string { @@ -2025,7 +2185,7 @@ type JobSpecMetadataAirflow struct { func (x *JobSpecMetadataAirflow) Reset() { *x = JobSpecMetadataAirflow{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[30] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2038,7 +2198,7 @@ func (x *JobSpecMetadataAirflow) String() string { func (*JobSpecMetadataAirflow) ProtoMessage() {} func (x *JobSpecMetadataAirflow) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[30] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2051,7 +2211,7 @@ func (x *JobSpecMetadataAirflow) ProtoReflect() protoreflect.Message { // Deprecated: Use JobSpecMetadataAirflow.ProtoReflect.Descriptor instead. func (*JobSpecMetadataAirflow) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{30} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{32} } func (x *JobSpecMetadataAirflow) GetPool() string { @@ -2081,7 +2241,7 @@ type RefreshJobsRequest struct { func (x *RefreshJobsRequest) Reset() { *x = RefreshJobsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[31] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2094,7 +2254,7 @@ func (x *RefreshJobsRequest) String() string { func (*RefreshJobsRequest) ProtoMessage() {} func (x *RefreshJobsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[31] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2107,7 +2267,7 @@ func (x *RefreshJobsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RefreshJobsRequest.ProtoReflect.Descriptor instead. func (*RefreshJobsRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{31} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{33} } func (x *RefreshJobsRequest) GetProjectName() string { @@ -2142,7 +2302,7 @@ type RefreshJobsResponse struct { func (x *RefreshJobsResponse) Reset() { *x = RefreshJobsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[32] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2155,7 +2315,7 @@ func (x *RefreshJobsResponse) String() string { func (*RefreshJobsResponse) ProtoMessage() {} func (x *RefreshJobsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[32] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2168,7 +2328,7 @@ func (x *RefreshJobsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RefreshJobsResponse.ProtoReflect.Descriptor instead. func (*RefreshJobsResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{32} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{34} } func (x *RefreshJobsResponse) GetLogStatus() *Log { @@ -2189,7 +2349,7 @@ type GetDeployJobsStatusRequest struct { func (x *GetDeployJobsStatusRequest) Reset() { *x = GetDeployJobsStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[33] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2202,7 +2362,7 @@ func (x *GetDeployJobsStatusRequest) String() string { func (*GetDeployJobsStatusRequest) ProtoMessage() {} func (x *GetDeployJobsStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[33] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2215,7 +2375,7 @@ func (x *GetDeployJobsStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDeployJobsStatusRequest.ProtoReflect.Descriptor instead. func (*GetDeployJobsStatusRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{33} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{35} } func (x *GetDeployJobsStatusRequest) GetDeployId() string { @@ -2240,7 +2400,7 @@ type GetDeployJobsStatusResponse struct { func (x *GetDeployJobsStatusResponse) Reset() { *x = GetDeployJobsStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[34] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2253,7 +2413,7 @@ func (x *GetDeployJobsStatusResponse) String() string { func (*GetDeployJobsStatusResponse) ProtoMessage() {} func (x *GetDeployJobsStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[34] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2266,7 +2426,7 @@ func (x *GetDeployJobsStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDeployJobsStatusResponse.ProtoReflect.Descriptor instead. func (*GetDeployJobsStatusResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{34} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{36} } func (x *GetDeployJobsStatusResponse) GetStatus() string { @@ -2316,7 +2476,7 @@ type DeployJobFailure struct { func (x *DeployJobFailure) Reset() { *x = DeployJobFailure{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[35] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2329,7 +2489,7 @@ func (x *DeployJobFailure) String() string { func (*DeployJobFailure) ProtoMessage() {} func (x *DeployJobFailure) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[35] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2342,7 +2502,7 @@ func (x *DeployJobFailure) ProtoReflect() protoreflect.Message { // Deprecated: Use DeployJobFailure.ProtoReflect.Descriptor instead. func (*DeployJobFailure) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{35} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{37} } func (x *DeployJobFailure) GetJobName() string { @@ -2373,7 +2533,7 @@ type GetJobSpecificationsRequest struct { func (x *GetJobSpecificationsRequest) Reset() { *x = GetJobSpecificationsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[36] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2386,7 +2546,7 @@ func (x *GetJobSpecificationsRequest) String() string { func (*GetJobSpecificationsRequest) ProtoMessage() {} func (x *GetJobSpecificationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[36] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2399,7 +2559,7 @@ func (x *GetJobSpecificationsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetJobSpecificationsRequest.ProtoReflect.Descriptor instead. func (*GetJobSpecificationsRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{36} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{38} } func (x *GetJobSpecificationsRequest) GetProjectName() string { @@ -2443,7 +2603,7 @@ type GetJobSpecificationsResponse struct { func (x *GetJobSpecificationsResponse) Reset() { *x = GetJobSpecificationsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[37] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2456,7 +2616,7 @@ func (x *GetJobSpecificationsResponse) String() string { func (*GetJobSpecificationsResponse) ProtoMessage() {} func (x *GetJobSpecificationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[37] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2469,7 +2629,7 @@ func (x *GetJobSpecificationsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetJobSpecificationsResponse.ProtoReflect.Descriptor instead. func (*GetJobSpecificationsResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{37} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{39} } // Deprecated: Do not use. @@ -2500,7 +2660,7 @@ type JobSpecificationResponse struct { func (x *JobSpecificationResponse) Reset() { *x = JobSpecificationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[38] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2513,7 +2673,7 @@ func (x *JobSpecificationResponse) String() string { func (*JobSpecificationResponse) ProtoMessage() {} func (x *JobSpecificationResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[38] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2526,7 +2686,7 @@ func (x *JobSpecificationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use JobSpecificationResponse.ProtoReflect.Descriptor instead. func (*JobSpecificationResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{38} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{40} } func (x *JobSpecificationResponse) GetProjectName() string { @@ -2563,7 +2723,7 @@ type ReplaceAllJobSpecificationsRequest struct { func (x *ReplaceAllJobSpecificationsRequest) Reset() { *x = ReplaceAllJobSpecificationsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[39] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2576,7 +2736,7 @@ func (x *ReplaceAllJobSpecificationsRequest) String() string { func (*ReplaceAllJobSpecificationsRequest) ProtoMessage() {} func (x *ReplaceAllJobSpecificationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[39] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2589,7 +2749,7 @@ func (x *ReplaceAllJobSpecificationsRequest) ProtoReflect() protoreflect.Message // Deprecated: Use ReplaceAllJobSpecificationsRequest.ProtoReflect.Descriptor instead. func (*ReplaceAllJobSpecificationsRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{39} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{41} } func (x *ReplaceAllJobSpecificationsRequest) GetProjectName() string { @@ -2624,7 +2784,7 @@ type ReplaceAllJobSpecificationsResponse struct { func (x *ReplaceAllJobSpecificationsResponse) Reset() { *x = ReplaceAllJobSpecificationsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[40] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2637,7 +2797,7 @@ func (x *ReplaceAllJobSpecificationsResponse) String() string { func (*ReplaceAllJobSpecificationsResponse) ProtoMessage() {} func (x *ReplaceAllJobSpecificationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[40] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2650,7 +2810,7 @@ func (x *ReplaceAllJobSpecificationsResponse) ProtoReflect() protoreflect.Messag // Deprecated: Use ReplaceAllJobSpecificationsResponse.ProtoReflect.Descriptor instead. func (*ReplaceAllJobSpecificationsResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{40} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{42} } func (x *ReplaceAllJobSpecificationsResponse) GetLogStatus() *Log { @@ -2673,7 +2833,7 @@ type GetJobTaskRequest struct { func (x *GetJobTaskRequest) Reset() { *x = GetJobTaskRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[41] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2686,7 +2846,7 @@ func (x *GetJobTaskRequest) String() string { func (*GetJobTaskRequest) ProtoMessage() {} func (x *GetJobTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[41] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2699,7 +2859,7 @@ func (x *GetJobTaskRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetJobTaskRequest.ProtoReflect.Descriptor instead. func (*GetJobTaskRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{41} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{43} } func (x *GetJobTaskRequest) GetProjectName() string { @@ -2734,7 +2894,7 @@ type GetJobTaskResponse struct { func (x *GetJobTaskResponse) Reset() { *x = GetJobTaskResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[42] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2747,7 +2907,7 @@ func (x *GetJobTaskResponse) String() string { func (*GetJobTaskResponse) ProtoMessage() {} func (x *GetJobTaskResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[42] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2760,7 +2920,7 @@ func (x *GetJobTaskResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetJobTaskResponse.ProtoReflect.Descriptor instead. func (*GetJobTaskResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{42} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{44} } func (x *GetJobTaskResponse) GetTask() *JobTask { @@ -2787,7 +2947,7 @@ type JobTask struct { func (x *JobTask) Reset() { *x = JobTask{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[43] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2800,7 +2960,7 @@ func (x *JobTask) String() string { func (*JobTask) ProtoMessage() {} func (x *JobTask) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[43] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2813,7 +2973,7 @@ func (x *JobTask) ProtoReflect() protoreflect.Message { // Deprecated: Use JobTask.ProtoReflect.Descriptor instead. func (*JobTask) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{43} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{45} } func (x *JobTask) GetName() string { @@ -2866,7 +3026,7 @@ type GetWindowRequest struct { func (x *GetWindowRequest) Reset() { *x = GetWindowRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[44] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2879,7 +3039,7 @@ func (x *GetWindowRequest) String() string { func (*GetWindowRequest) ProtoMessage() {} func (x *GetWindowRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[44] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2892,7 +3052,7 @@ func (x *GetWindowRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetWindowRequest.ProtoReflect.Descriptor instead. func (*GetWindowRequest) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{44} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{46} } func (x *GetWindowRequest) GetScheduledAt() *timestamppb.Timestamp { @@ -2942,7 +3102,7 @@ type GetWindowResponse struct { func (x *GetWindowResponse) Reset() { *x = GetWindowResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[45] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2955,7 +3115,7 @@ func (x *GetWindowResponse) String() string { func (*GetWindowResponse) ProtoMessage() {} func (x *GetWindowResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[45] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2968,7 +3128,7 @@ func (x *GetWindowResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetWindowResponse.ProtoReflect.Descriptor instead. func (*GetWindowResponse) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{45} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{47} } func (x *GetWindowResponse) GetStart() *timestamppb.Timestamp { @@ -2985,34 +3145,35 @@ func (x *GetWindowResponse) GetEnd() *timestamppb.Timestamp { return nil } -type JobInspectResponse_BasicInfoSection struct { +type UpdateJobsStateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Job *JobSpecification `protobuf:"bytes,1,opt,name=job,proto3" json:"job,omitempty"` - Source []string `protobuf:"bytes,2,rep,name=source,proto3" json:"source,omitempty"` - Destination string `protobuf:"bytes,3,opt,name=destination,proto3" json:"destination,omitempty"` - Notice []*Log `protobuf:"bytes,4,rep,name=notice,proto3" json:"notice,omitempty"` + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"` + State JobState `protobuf:"varint,4,opt,name=state,proto3,enum=raystack.optimus.core.v1beta1.JobState" json:"state,omitempty"` + JobNames []string `protobuf:"bytes,5,rep,name=job_names,json=jobNames,proto3" json:"job_names,omitempty"` } -func (x *JobInspectResponse_BasicInfoSection) Reset() { - *x = JobInspectResponse_BasicInfoSection{} +func (x *UpdateJobsStateRequest) Reset() { + *x = UpdateJobsStateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[46] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *JobInspectResponse_BasicInfoSection) String() string { +func (x *UpdateJobsStateRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*JobInspectResponse_BasicInfoSection) ProtoMessage() {} +func (*UpdateJobsStateRequest) ProtoMessage() {} -func (x *JobInspectResponse_BasicInfoSection) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[46] +func (x *UpdateJobsStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3023,69 +3184,69 @@ func (x *JobInspectResponse_BasicInfoSection) ProtoReflect() protoreflect.Messag return mi.MessageOf(x) } -// Deprecated: Use JobInspectResponse_BasicInfoSection.ProtoReflect.Descriptor instead. -func (*JobInspectResponse_BasicInfoSection) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8, 0} +// Deprecated: Use UpdateJobsStateRequest.ProtoReflect.Descriptor instead. +func (*UpdateJobsStateRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{48} } -func (x *JobInspectResponse_BasicInfoSection) GetJob() *JobSpecification { +func (x *UpdateJobsStateRequest) GetProjectName() string { if x != nil { - return x.Job + return x.ProjectName } - return nil + return "" } -func (x *JobInspectResponse_BasicInfoSection) GetSource() []string { +func (x *UpdateJobsStateRequest) GetNamespaceName() string { if x != nil { - return x.Source + return x.NamespaceName } - return nil + return "" } -func (x *JobInspectResponse_BasicInfoSection) GetDestination() string { +func (x *UpdateJobsStateRequest) GetRemark() string { if x != nil { - return x.Destination + return x.Remark } return "" } -func (x *JobInspectResponse_BasicInfoSection) GetNotice() []*Log { +func (x *UpdateJobsStateRequest) GetState() JobState { if x != nil { - return x.Notice + return x.State + } + return JobState_JOB_STATE_UNSPECIFIED +} + +func (x *UpdateJobsStateRequest) GetJobNames() []string { + if x != nil { + return x.JobNames } return nil } -type JobInspectResponse_JobDependency struct { +type UpdateJobsStateResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` - ProjectName string `protobuf:"bytes,3,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` - TaskName string `protobuf:"bytes,5,opt,name=task_name,json=taskName,proto3" json:"task_name,omitempty"` - Runs []*JobRun `protobuf:"bytes,6,rep,name=runs,proto3" json:"runs,omitempty"` } -func (x *JobInspectResponse_JobDependency) Reset() { - *x = JobInspectResponse_JobDependency{} +func (x *UpdateJobsStateResponse) Reset() { + *x = UpdateJobsStateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[47] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *JobInspectResponse_JobDependency) String() string { +func (x *UpdateJobsStateResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*JobInspectResponse_JobDependency) ProtoMessage() {} +func (*UpdateJobsStateResponse) ProtoMessage() {} -func (x *JobInspectResponse_JobDependency) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[47] +func (x *UpdateJobsStateResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3096,82 +3257,38 @@ func (x *JobInspectResponse_JobDependency) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use JobInspectResponse_JobDependency.ProtoReflect.Descriptor instead. -func (*JobInspectResponse_JobDependency) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8, 1} -} - -func (x *JobInspectResponse_JobDependency) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *JobInspectResponse_JobDependency) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *JobInspectResponse_JobDependency) GetProjectName() string { - if x != nil { - return x.ProjectName - } - return "" -} - -func (x *JobInspectResponse_JobDependency) GetNamespaceName() string { - if x != nil { - return x.NamespaceName - } - return "" -} - -func (x *JobInspectResponse_JobDependency) GetTaskName() string { - if x != nil { - return x.TaskName - } - return "" -} - -func (x *JobInspectResponse_JobDependency) GetRuns() []*JobRun { - if x != nil { - return x.Runs - } - return nil +// Deprecated: Use UpdateJobsStateResponse.ProtoReflect.Descriptor instead. +func (*UpdateJobsStateResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{49} } -type JobInspectResponse_UpstreamSection struct { +type SyncJobsStateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ExternalDependency []*JobInspectResponse_JobDependency `protobuf:"bytes,1,rep,name=external_dependency,json=externalDependency,proto3" json:"external_dependency,omitempty"` - InternalDependency []*JobInspectResponse_JobDependency `protobuf:"bytes,2,rep,name=internal_dependency,json=internalDependency,proto3" json:"internal_dependency,omitempty"` - HttpDependency []*HttpDependency `protobuf:"bytes,3,rep,name=http_dependency,json=httpDependency,proto3" json:"http_dependency,omitempty"` - UnknownDependencies []*JobInspectResponse_UpstreamSection_UnknownDependencies `protobuf:"bytes,4,rep,name=unknown_dependencies,json=unknownDependencies,proto3" json:"unknown_dependencies,omitempty"` - Notice []*Log `protobuf:"bytes,5,rep,name=notice,proto3" json:"notice,omitempty"` + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + JobStates []*SyncJobsStateRequest_JobStatePair `protobuf:"bytes,3,rep,name=job_states,json=jobStates,proto3" json:"job_states,omitempty"` } -func (x *JobInspectResponse_UpstreamSection) Reset() { - *x = JobInspectResponse_UpstreamSection{} +func (x *SyncJobsStateRequest) Reset() { + *x = SyncJobsStateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[48] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *JobInspectResponse_UpstreamSection) String() string { +func (x *SyncJobsStateRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*JobInspectResponse_UpstreamSection) ProtoMessage() {} +func (*SyncJobsStateRequest) ProtoMessage() {} -func (x *JobInspectResponse_UpstreamSection) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[48] +func (x *SyncJobsStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3182,72 +3299,55 @@ func (x *JobInspectResponse_UpstreamSection) ProtoReflect() protoreflect.Message return mi.MessageOf(x) } -// Deprecated: Use JobInspectResponse_UpstreamSection.ProtoReflect.Descriptor instead. -func (*JobInspectResponse_UpstreamSection) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8, 2} -} - -func (x *JobInspectResponse_UpstreamSection) GetExternalDependency() []*JobInspectResponse_JobDependency { - if x != nil { - return x.ExternalDependency - } - return nil -} - -func (x *JobInspectResponse_UpstreamSection) GetInternalDependency() []*JobInspectResponse_JobDependency { - if x != nil { - return x.InternalDependency - } - return nil +// Deprecated: Use SyncJobsStateRequest.ProtoReflect.Descriptor instead. +func (*SyncJobsStateRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{50} } -func (x *JobInspectResponse_UpstreamSection) GetHttpDependency() []*HttpDependency { +func (x *SyncJobsStateRequest) GetProjectName() string { if x != nil { - return x.HttpDependency + return x.ProjectName } - return nil + return "" } -func (x *JobInspectResponse_UpstreamSection) GetUnknownDependencies() []*JobInspectResponse_UpstreamSection_UnknownDependencies { +func (x *SyncJobsStateRequest) GetNamespaceName() string { if x != nil { - return x.UnknownDependencies + return x.NamespaceName } - return nil + return "" } -func (x *JobInspectResponse_UpstreamSection) GetNotice() []*Log { +func (x *SyncJobsStateRequest) GetJobStates() []*SyncJobsStateRequest_JobStatePair { if x != nil { - return x.Notice + return x.JobStates } return nil } -type JobInspectResponse_DownstreamSection struct { +type SyncJobsStateResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - DownstreamJobs []*JobInspectResponse_JobDependency `protobuf:"bytes,1,rep,name=downstream_jobs,json=downstreamJobs,proto3" json:"downstream_jobs,omitempty"` - Notice []*Log `protobuf:"bytes,2,rep,name=notice,proto3" json:"notice,omitempty"` } -func (x *JobInspectResponse_DownstreamSection) Reset() { - *x = JobInspectResponse_DownstreamSection{} +func (x *SyncJobsStateResponse) Reset() { + *x = SyncJobsStateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[49] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *JobInspectResponse_DownstreamSection) String() string { +func (x *SyncJobsStateResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*JobInspectResponse_DownstreamSection) ProtoMessage() {} +func (*SyncJobsStateResponse) ProtoMessage() {} -func (x *JobInspectResponse_DownstreamSection) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[49] +func (x *SyncJobsStateResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3258,20 +3358,298 @@ func (x *JobInspectResponse_DownstreamSection) ProtoReflect() protoreflect.Messa return mi.MessageOf(x) } -// Deprecated: Use JobInspectResponse_DownstreamSection.ProtoReflect.Descriptor instead. -func (*JobInspectResponse_DownstreamSection) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8, 3} +// Deprecated: Use SyncJobsStateResponse.ProtoReflect.Descriptor instead. +func (*SyncJobsStateResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{51} } -func (x *JobInspectResponse_DownstreamSection) GetDownstreamJobs() []*JobInspectResponse_JobDependency { - if x != nil { - return x.DownstreamJobs - } - return nil -} +type JobInspectResponse_BasicInfoSection struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (x *JobInspectResponse_DownstreamSection) GetNotice() []*Log { - if x != nil { + Job *JobSpecification `protobuf:"bytes,1,opt,name=job,proto3" json:"job,omitempty"` + Source []string `protobuf:"bytes,2,rep,name=source,proto3" json:"source,omitempty"` + Destination string `protobuf:"bytes,3,opt,name=destination,proto3" json:"destination,omitempty"` + Notice []*Log `protobuf:"bytes,4,rep,name=notice,proto3" json:"notice,omitempty"` +} + +func (x *JobInspectResponse_BasicInfoSection) Reset() { + *x = JobInspectResponse_BasicInfoSection{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobInspectResponse_BasicInfoSection) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobInspectResponse_BasicInfoSection) ProtoMessage() {} + +func (x *JobInspectResponse_BasicInfoSection) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[52] + 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 JobInspectResponse_BasicInfoSection.ProtoReflect.Descriptor instead. +func (*JobInspectResponse_BasicInfoSection) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *JobInspectResponse_BasicInfoSection) GetJob() *JobSpecification { + if x != nil { + return x.Job + } + return nil +} + +func (x *JobInspectResponse_BasicInfoSection) GetSource() []string { + if x != nil { + return x.Source + } + return nil +} + +func (x *JobInspectResponse_BasicInfoSection) GetDestination() string { + if x != nil { + return x.Destination + } + return "" +} + +func (x *JobInspectResponse_BasicInfoSection) GetNotice() []*Log { + if x != nil { + return x.Notice + } + return nil +} + +type JobInspectResponse_JobDependency struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` + ProjectName string `protobuf:"bytes,3,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + TaskName string `protobuf:"bytes,5,opt,name=task_name,json=taskName,proto3" json:"task_name,omitempty"` + Runs []*JobRun `protobuf:"bytes,6,rep,name=runs,proto3" json:"runs,omitempty"` +} + +func (x *JobInspectResponse_JobDependency) Reset() { + *x = JobInspectResponse_JobDependency{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobInspectResponse_JobDependency) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobInspectResponse_JobDependency) ProtoMessage() {} + +func (x *JobInspectResponse_JobDependency) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[53] + 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 JobInspectResponse_JobDependency.ProtoReflect.Descriptor instead. +func (*JobInspectResponse_JobDependency) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8, 1} +} + +func (x *JobInspectResponse_JobDependency) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *JobInspectResponse_JobDependency) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *JobInspectResponse_JobDependency) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *JobInspectResponse_JobDependency) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *JobInspectResponse_JobDependency) GetTaskName() string { + if x != nil { + return x.TaskName + } + return "" +} + +func (x *JobInspectResponse_JobDependency) GetRuns() []*JobRun { + if x != nil { + return x.Runs + } + return nil +} + +type JobInspectResponse_UpstreamSection struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExternalDependency []*JobInspectResponse_JobDependency `protobuf:"bytes,1,rep,name=external_dependency,json=externalDependency,proto3" json:"external_dependency,omitempty"` + InternalDependency []*JobInspectResponse_JobDependency `protobuf:"bytes,2,rep,name=internal_dependency,json=internalDependency,proto3" json:"internal_dependency,omitempty"` + HttpDependency []*HttpDependency `protobuf:"bytes,3,rep,name=http_dependency,json=httpDependency,proto3" json:"http_dependency,omitempty"` + UnknownDependencies []*JobInspectResponse_UpstreamSection_UnknownDependencies `protobuf:"bytes,4,rep,name=unknown_dependencies,json=unknownDependencies,proto3" json:"unknown_dependencies,omitempty"` + Notice []*Log `protobuf:"bytes,5,rep,name=notice,proto3" json:"notice,omitempty"` +} + +func (x *JobInspectResponse_UpstreamSection) Reset() { + *x = JobInspectResponse_UpstreamSection{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobInspectResponse_UpstreamSection) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobInspectResponse_UpstreamSection) ProtoMessage() {} + +func (x *JobInspectResponse_UpstreamSection) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[54] + 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 JobInspectResponse_UpstreamSection.ProtoReflect.Descriptor instead. +func (*JobInspectResponse_UpstreamSection) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8, 2} +} + +func (x *JobInspectResponse_UpstreamSection) GetExternalDependency() []*JobInspectResponse_JobDependency { + if x != nil { + return x.ExternalDependency + } + return nil +} + +func (x *JobInspectResponse_UpstreamSection) GetInternalDependency() []*JobInspectResponse_JobDependency { + if x != nil { + return x.InternalDependency + } + return nil +} + +func (x *JobInspectResponse_UpstreamSection) GetHttpDependency() []*HttpDependency { + if x != nil { + return x.HttpDependency + } + return nil +} + +func (x *JobInspectResponse_UpstreamSection) GetUnknownDependencies() []*JobInspectResponse_UpstreamSection_UnknownDependencies { + if x != nil { + return x.UnknownDependencies + } + return nil +} + +func (x *JobInspectResponse_UpstreamSection) GetNotice() []*Log { + if x != nil { + return x.Notice + } + return nil +} + +type JobInspectResponse_DownstreamSection struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DownstreamJobs []*JobInspectResponse_JobDependency `protobuf:"bytes,1,rep,name=downstream_jobs,json=downstreamJobs,proto3" json:"downstream_jobs,omitempty"` + Notice []*Log `protobuf:"bytes,2,rep,name=notice,proto3" json:"notice,omitempty"` +} + +func (x *JobInspectResponse_DownstreamSection) Reset() { + *x = JobInspectResponse_DownstreamSection{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobInspectResponse_DownstreamSection) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobInspectResponse_DownstreamSection) ProtoMessage() {} + +func (x *JobInspectResponse_DownstreamSection) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[55] + 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 JobInspectResponse_DownstreamSection.ProtoReflect.Descriptor instead. +func (*JobInspectResponse_DownstreamSection) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8, 3} +} + +func (x *JobInspectResponse_DownstreamSection) GetDownstreamJobs() []*JobInspectResponse_JobDependency { + if x != nil { + return x.DownstreamJobs + } + return nil +} + +func (x *JobInspectResponse_DownstreamSection) GetNotice() []*Log { + if x != nil { return x.Notice } return nil @@ -3290,7 +3668,7 @@ type JobInspectResponse_UpstreamSection_UnknownDependencies struct { func (x *JobInspectResponse_UpstreamSection_UnknownDependencies) Reset() { *x = JobInspectResponse_UpstreamSection_UnknownDependencies{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[50] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3303,7 +3681,7 @@ func (x *JobInspectResponse_UpstreamSection_UnknownDependencies) String() string func (*JobInspectResponse_UpstreamSection_UnknownDependencies) ProtoMessage() {} func (x *JobInspectResponse_UpstreamSection_UnknownDependencies) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[50] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3316,7 +3694,7 @@ func (x *JobInspectResponse_UpstreamSection_UnknownDependencies) ProtoReflect() // Deprecated: Use JobInspectResponse_UpstreamSection_UnknownDependencies.ProtoReflect.Descriptor instead. func (*JobInspectResponse_UpstreamSection_UnknownDependencies) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8, 2, 0} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{8, 2, 0} } func (x *JobInspectResponse_UpstreamSection_UnknownDependencies) GetJobName() string { @@ -3352,7 +3730,7 @@ type JobSpecification_Behavior struct { func (x *JobSpecification_Behavior) Reset() { *x = JobSpecification_Behavior{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[53] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3365,7 +3743,7 @@ func (x *JobSpecification_Behavior) String() string { func (*JobSpecification_Behavior) ProtoMessage() {} func (x *JobSpecification_Behavior) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[53] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3378,7 +3756,7 @@ func (x *JobSpecification_Behavior) ProtoReflect() protoreflect.Message { // Deprecated: Use JobSpecification_Behavior.ProtoReflect.Descriptor instead. func (*JobSpecification_Behavior) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{21, 2} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{23, 2} } func (x *JobSpecification_Behavior) GetRetry() *JobSpecification_Behavior_Retry { @@ -3409,7 +3787,7 @@ type JobSpecification_Behavior_Retry struct { func (x *JobSpecification_Behavior_Retry) Reset() { *x = JobSpecification_Behavior_Retry{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[54] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3422,7 +3800,7 @@ func (x *JobSpecification_Behavior_Retry) String() string { func (*JobSpecification_Behavior_Retry) ProtoMessage() {} func (x *JobSpecification_Behavior_Retry) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[54] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3435,7 +3813,7 @@ func (x *JobSpecification_Behavior_Retry) ProtoReflect() protoreflect.Message { // Deprecated: Use JobSpecification_Behavior_Retry.ProtoReflect.Descriptor instead. func (*JobSpecification_Behavior_Retry) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{21, 2, 0} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{23, 2, 0} } func (x *JobSpecification_Behavior_Retry) GetCount() int32 { @@ -3465,7 +3843,7 @@ type JobSpecification_Behavior_Notifiers struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - On JobEvent_Type `protobuf:"varint,1,opt,name=on,proto3,enum=odpf.optimus.core.v1beta1.JobEvent_Type" json:"on,omitempty"` + On JobEvent_Type `protobuf:"varint,1,opt,name=on,proto3,enum=raystack.optimus.core.v1beta1.JobEvent_Type" json:"on,omitempty"` Channels []string `protobuf:"bytes,2,rep,name=channels,proto3" json:"channels,omitempty"` Config map[string]string `protobuf:"bytes,3,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } @@ -3473,7 +3851,7 @@ type JobSpecification_Behavior_Notifiers struct { func (x *JobSpecification_Behavior_Notifiers) Reset() { *x = JobSpecification_Behavior_Notifiers{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[55] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3486,7 +3864,7 @@ func (x *JobSpecification_Behavior_Notifiers) String() string { func (*JobSpecification_Behavior_Notifiers) ProtoMessage() {} func (x *JobSpecification_Behavior_Notifiers) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[55] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3499,7 +3877,7 @@ func (x *JobSpecification_Behavior_Notifiers) ProtoReflect() protoreflect.Messag // Deprecated: Use JobSpecification_Behavior_Notifiers.ProtoReflect.Descriptor instead. func (*JobSpecification_Behavior_Notifiers) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{21, 2, 1} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{23, 2, 1} } func (x *JobSpecification_Behavior_Notifiers) GetOn() JobEvent_Type { @@ -3535,7 +3913,7 @@ type JobTask_Destination struct { func (x *JobTask_Destination) Reset() { *x = JobTask_Destination{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[60] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3548,7 +3926,7 @@ func (x *JobTask_Destination) String() string { func (*JobTask_Destination) ProtoMessage() {} func (x *JobTask_Destination) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[60] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3561,7 +3939,7 @@ func (x *JobTask_Destination) ProtoReflect() protoreflect.Message { // Deprecated: Use JobTask_Destination.ProtoReflect.Descriptor instead. func (*JobTask_Destination) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{43, 0} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{45, 0} } func (x *JobTask_Destination) GetDestination() string { @@ -3589,7 +3967,7 @@ type JobTask_Dependency struct { func (x *JobTask_Dependency) Reset() { *x = JobTask_Dependency{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[61] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3602,7 +3980,7 @@ func (x *JobTask_Dependency) String() string { func (*JobTask_Dependency) ProtoMessage() {} func (x *JobTask_Dependency) ProtoReflect() protoreflect.Message { - mi := &file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[61] + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3615,7 +3993,7 @@ func (x *JobTask_Dependency) ProtoReflect() protoreflect.Message { // Deprecated: Use JobTask_Dependency.ProtoReflect.Descriptor instead. func (*JobTask_Dependency) Descriptor() ([]byte, []int) { - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{43, 1} + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{45, 1} } func (x *JobTask_Dependency) GetDependency() string { @@ -3625,434 +4003,521 @@ func (x *JobTask_Dependency) GetDependency() string { return "" } -var File_odpf_optimus_core_v1beta1_job_spec_proto protoreflect.FileDescriptor +type SyncJobsStateRequest_JobStatePair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -var file_odpf_optimus_core_v1beta1_job_spec_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6a, 0x6f, 0x62, 0x5f, - 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x64, 0x70, 0x66, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x26, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, - 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x01, 0x0a, 0x1d, 0x44, - 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x3f, 0x0a, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6a, 0x6f, 0x62, 0x73, - 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x8a, 0x01, 0x0a, 0x1e, 0x44, 0x65, 0x70, 0x6c, - 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, - 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, - 0x3d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4c, 0x6f, 0x67, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x04, - 0x08, 0x01, 0x10, 0x07, 0x22, 0xaa, 0x01, 0x0a, 0x1b, 0x41, 0x64, 0x64, 0x4a, 0x6f, 0x62, 0x53, - 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x41, - 0x0a, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x73, 0x70, 0x65, 0x63, - 0x73, 0x22, 0x36, 0x0a, 0x1c, 0x41, 0x64, 0x64, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6c, 0x6f, 0x67, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xad, 0x01, 0x0a, 0x1e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x22, 0x33, 0x0a, 0x1f, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x22, 0xf8, - 0x01, 0x0a, 0x11, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, - 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x73, 0x70, 0x65, - 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x3d, 0x0a, 0x0c, 0x73, 0x63, - 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x63, - 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x41, 0x74, 0x22, 0x5d, 0x0a, 0x06, 0x4a, 0x6f, 0x62, - 0x52, 0x75, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x73, 0x63, 0x68, - 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x63, 0x68, - 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x41, 0x74, 0x22, 0x91, 0x0c, 0x0a, 0x12, 0x4a, 0x6f, 0x62, - 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5d, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x62, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x5b, - 0x0a, 0x09, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x3d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, - 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x09, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x61, 0x0a, 0x0b, 0x64, - 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x3f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, - 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0xc3, - 0x01, 0x0a, 0x10, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, - 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x6a, - 0x6f, 0x62, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x06, - 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x06, 0x6e, 0x6f, - 0x74, 0x69, 0x63, 0x65, 0x1a, 0xd5, 0x01, 0x0a, 0x0d, 0x4a, 0x6f, 0x62, 0x44, 0x65, 0x70, 0x65, - 0x6e, 0x64, 0x65, 0x6e, 0x63, 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, 0x68, 0x6f, - 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x73, - 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x72, 0x75, 0x6e, 0x73, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x52, 0x04, 0x72, 0x75, 0x6e, 0x73, 0x1a, 0x89, 0x05, 0x0a, - 0x0f, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x6c, 0x0a, 0x13, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, - 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, - 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4a, 0x6f, 0x62, - 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x12, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x6c, - 0x0a, 0x13, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, - 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x44, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x12, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x52, 0x0a, 0x0f, - 0x68, 0x74, 0x74, 0x70, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, - 0x52, 0x0e, 0x68, 0x74, 0x74, 0x70, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, - 0x12, 0x84, 0x01, 0x0a, 0x14, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x64, 0x65, 0x70, - 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x51, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x49, - 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x55, - 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, - 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, - 0x65, 0x73, 0x52, 0x13, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, - 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, + JobName string `protobuf:"bytes,1,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + State JobState `protobuf:"varint,2,opt,name=state,proto3,enum=raystack.optimus.core.v1beta1.JobState" json:"state,omitempty"` +} + +func (x *SyncJobsStateRequest_JobStatePair) Reset() { + *x = SyncJobsStateRequest_JobStatePair{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncJobsStateRequest_JobStatePair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncJobsStateRequest_JobStatePair) ProtoMessage() {} + +func (x *SyncJobsStateRequest_JobStatePair) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[68] + 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 SyncJobsStateRequest_JobStatePair.ProtoReflect.Descriptor instead. +func (*SyncJobsStateRequest_JobStatePair) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP(), []int{50, 0} +} + +func (x *SyncJobsStateRequest_JobStatePair) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *SyncJobsStateRequest_JobStatePair) GetState() JobState { + if x != nil { + return x.State + } + return JobState_JOB_STATE_UNSPECIFIED +} + +var File_raystack_optimus_core_v1beta1_job_spec_proto protoreflect.FileDescriptor + +var file_raystack_optimus_core_v1beta1_job_spec_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x20, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x1a, - 0x86, 0x01, 0x0a, 0x13, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xb1, 0x01, 0x0a, 0x11, 0x44, 0x6f, 0x77, - 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x64, - 0x0a, 0x0f, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x6a, 0x6f, 0x62, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, + 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x2d, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xb1, 0x01, 0x0a, 0x1d, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x12, 0x25, 0x0a, 0x0e, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x22, 0x91, 0x01, 0x0a, 0x1e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, + 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x0a, 0x6c, + 0x6f, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x07, 0x22, 0xb1, 0x01, 0x0a, 0x1b, 0x41, 0x64, 0x64, 0x4a, + 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, - 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0e, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x36, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x22, 0xaa, 0x01, 0x0a, - 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, + 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x22, 0x36, 0x0a, 0x1c, 0x41, + 0x64, 0x64, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6c, + 0x6f, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x4a, 0x04, 0x08, + 0x01, 0x10, 0x02, 0x22, 0xb4, 0x01, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, + 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x48, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x54, 0x0a, 0x1e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0x81, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, - 0x61, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, - 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73, - 0x70, 0x65, 0x63, 0x22, 0xbf, 0x01, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, - 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x73, 0x70, 0x65, 0x63, 0x73, 0x22, 0x33, 0x0a, 0x1f, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x22, + 0xff, 0x01, 0x0a, 0x11, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, - 0x65, 0x61, 0x6e, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0c, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x54, 0x0a, 0x1e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, + 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x12, 0x3d, 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x41, + 0x74, 0x22, 0x5d, 0x0a, 0x06, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x41, 0x74, + 0x22, 0xec, 0x0c, 0x0a, 0x12, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x69, 0x63, + 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, + 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x09, 0x62, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x62, 0x0a, + 0x09, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x44, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x73, 0x12, 0x68, 0x0a, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, + 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x6f, 0x77, + 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, + 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0xd1, 0x01, 0x0a, 0x10, + 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x44, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x03, 0x6a, 0x6f, 0x62, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x3d, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x1a, + 0xdc, 0x01, 0x0a, 0x0d, 0x4a, 0x6f, 0x62, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, + 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, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x3c, 0x0a, 0x04, 0x72, 0x75, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x52, 0x04, 0x72, 0x75, 0x6e, 0x73, 0x1a, 0xac, + 0x05, 0x0a, 0x0f, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x73, 0x0a, 0x13, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x42, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, + 0x6e, 0x63, 0x79, 0x52, 0x12, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x65, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x73, 0x0a, 0x13, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x44, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x12, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x59, 0x0a, 0x0f, + 0x68, 0x74, 0x74, 0x70, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x44, 0x65, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0e, 0x68, 0x74, 0x74, 0x70, 0x44, 0x65, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x8b, 0x01, 0x0a, 0x14, 0x75, 0x6e, 0x6b, 0x6e, + 0x6f, 0x77, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x58, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, + 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x55, 0x70, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x6e, 0x6b, + 0x6e, 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, + 0x52, 0x13, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, + 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x06, 0x6e, 0x6f, + 0x74, 0x69, 0x63, 0x65, 0x1a, 0x86, 0x01, 0x0a, 0x13, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, + 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, + 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xbf, 0x01, + 0x0a, 0x11, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x6b, 0x0a, 0x0f, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, + 0x52, 0x0e, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4a, 0x6f, 0x62, 0x73, + 0x12, 0x3d, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x22, + 0xb1, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x73, + 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73, + 0x70, 0x65, 0x63, 0x22, 0x54, 0x0a, 0x1e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x1a, 0x47, 0x65, + 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x65, 0x0a, + 0x1b, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, + 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x22, 0xbf, 0x01, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x67, 0x0a, 0x1b, 0x4c, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, + 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0c, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x54, 0x0a, 0x1e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xae, 0x01, 0x0a, + 0x19, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, + 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6e, 0x65, 0x77, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1c, 0x0a, + 0x1a, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x67, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x5f, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x53, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x66, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x22, 0xae, 0x01, 0x0a, + 0x1c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, + 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x44, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x03, 0x6a, 0x6f, 0x62, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, + 0x1d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x22, 0xb1, 0x01, 0x0a, 0x1d, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, + 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x1c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, - 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x03, 0x6a, 0x6f, 0x62, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, + 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x6c, 0x0a, 0x1e, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, + 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x05, 0x22, 0xe6, 0x0d, 0x0a, 0x10, 0x4a, + 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, + 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x26, 0x0a, 0x0f, 0x64, 0x65, 0x70, + 0x65, 0x6e, 0x64, 0x73, 0x5f, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x73, 0x4f, 0x6e, 0x50, 0x61, 0x73, + 0x74, 0x12, 0x1d, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x75, 0x70, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x63, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4a, 0x6f, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x69, 0x6e, + 0x64, 0x6f, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, + 0x77, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x12, + 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x5f, + 0x74, 0x6f, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, + 0x54, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x12, 0x53, 0x0a, 0x0c, 0x64, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, + 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, + 0x56, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3e, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x6a, 0x6f, 0x62, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, - 0x39, 0x0a, 0x1d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 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, 0x22, 0xaa, 0x01, 0x0a, 0x1d, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x3f, 0x0a, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x43, 0x0a, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, + 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6a, 0x6f, 0x62, 0x73, - 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x65, 0x0a, 0x1e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x09, 0x6c, - 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x05, 0x22, 0x95, - 0x0d, 0x0a, 0x10, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x64, 0x61, - 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x26, 0x0a, - 0x0f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x73, 0x5f, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x73, 0x74, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x73, 0x4f, - 0x6e, 0x50, 0x61, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x75, - 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, - 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, - 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x1f, 0x0a, 0x0b, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x23, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, - 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x18, 0x0d, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x10, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x54, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, - 0x65, 0x54, 0x6f, 0x12, 0x4c, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x69, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x64, 0x70, 0x66, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, - 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, - 0x73, 0x12, 0x4f, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x37, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, - 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, - 0x73, 0x73, 0x65, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x73, 0x12, 0x3c, 0x0a, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, - 0x62, 0x53, 0x70, 0x65, 0x63, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, - 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x12, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, - 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x12, 0x50, 0x0a, 0x08, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x18, - 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, + 0x63, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x56, + 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x52, 0x08, 0x62, 0x65, 0x68, - 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x42, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, - 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x16, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x41, 0x73, 0x73, 0x65, 0x74, 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, - 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x1a, 0xb8, 0x04, 0x0a, 0x08, - 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x50, 0x0a, 0x05, 0x72, 0x65, 0x74, 0x72, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x52, 0x65, - 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x65, 0x74, 0x72, 0x79, 0x12, 0x56, 0x0a, 0x06, 0x6e, 0x6f, - 0x74, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, - 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, - 0x66, 0x79, 0x1a, 0x7f, 0x0a, 0x05, 0x52, 0x65, 0x74, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x64, 0x65, 0x6c, - 0x61, 0x79, 0x12, 0x2f, 0x0a, 0x13, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x12, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x63, 0x6b, - 0x6f, 0x66, 0x66, 0x1a, 0x80, 0x02, 0x0a, 0x09, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x73, 0x12, 0x38, 0x0a, 0x02, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x02, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, 0x62, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, - 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8b, 0x01, 0x0a, 0x0d, 0x4a, 0x6f, 0x62, 0x44, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 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, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x52, 0x0a, 0x0f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, - 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6f, 0x64, 0x70, 0x66, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, - 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0e, 0x68, 0x74, 0x74, 0x70, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, - 0x65, 0x6e, 0x63, 0x79, 0x22, 0xce, 0x02, 0x0a, 0x0e, 0x48, 0x74, 0x74, 0x70, 0x44, 0x65, 0x70, - 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, - 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x50, 0x0a, - 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x44, - 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, - 0x4d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x35, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x74, 0x74, 0x70, - 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x3a, - 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x61, - 0x72, 0x61, 0x6d, 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, 0x63, 0x0a, 0x0b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, - 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, + 0x6f, 0x6e, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x57, 0x0a, 0x08, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, + 0x6f, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x65, 0x68, + 0x61, 0x76, 0x69, 0x6f, 0x72, 0x52, 0x08, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, + 0x49, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x14, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, - 0x65, 0x6d, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x39, 0x0a, 0x0d, 0x4a, 0x6f, - 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x16, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x41, 0x73, 0x73, 0x65, 0x74, 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, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x1a, 0xd4, 0x04, 0x0a, + 0x08, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x57, 0x0a, 0x05, 0x72, 0x65, 0x74, + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x65, 0x68, + 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x65, 0x74, + 0x72, 0x79, 0x12, 0x5d, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, + 0x79, 0x1a, 0x7f, 0x0a, 0x05, 0x52, 0x65, 0x74, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x2f, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, + 0x79, 0x12, 0x2f, 0x0a, 0x13, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, + 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x6f, + 0x66, 0x66, 0x1a, 0x8e, 0x02, 0x0a, 0x09, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, + 0x12, 0x3f, 0x0a, 0x02, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x02, 0x6f, + 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, 0x69, 0x0a, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x51, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x92, 0x01, 0x0a, 0x0d, 0x4a, 0x6f, 0x62, 0x44, 0x65, 0x70, 0x65, 0x6e, + 0x64, 0x65, 0x6e, 0x63, 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, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x59, 0x0a, + 0x0f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x44, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0e, 0x68, 0x74, 0x74, 0x70, 0x44, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x22, 0xdc, 0x02, 0x0a, 0x0e, 0x48, 0x74, 0x74, + 0x70, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xde, 0x03, 0x0a, 0x08, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x28, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, + 0x6c, 0x12, 0x57, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, + 0x65, 0x6e, 0x63, 0x79, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x54, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x74, + 0x74, 0x70, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x1a, 0x39, 0x0a, 0x0b, + 0x50, 0x61, 0x72, 0x61, 0x6d, 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, 0x6a, 0x0a, 0x0b, 0x4a, 0x6f, 0x62, 0x53, 0x70, + 0x65, 0x63, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, + 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x22, 0x39, 0x0a, 0x0d, 0x4a, 0x6f, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xe5, + 0x03, 0x0a, 0x08, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, @@ -4080,582 +4545,703 @@ var file_odpf_optimus_core_v1beta1_job_spec_proto_rawDesc = []byte{ 0x54, 0x52, 0x59, 0x10, 0x11, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x12, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x13, - 0x22, 0x04, 0x08, 0x02, 0x10, 0x05, 0x22, 0xaa, 0x01, 0x0a, 0x0b, 0x4a, 0x6f, 0x62, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x4e, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, + 0x22, 0x04, 0x08, 0x02, 0x10, 0x05, 0x22, 0xb8, 0x01, 0x0a, 0x0b, 0x4a, 0x6f, 0x62, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x55, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, + 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x52, 0x0a, + 0x07, 0x61, 0x69, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x41, 0x69, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x07, 0x61, 0x69, 0x72, 0x66, 0x6c, 0x6f, + 0x77, 0x22, 0xcb, 0x01, 0x0a, 0x17, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x59, 0x0a, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, + 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, + 0x49, 0x0a, 0x1d, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, + 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x42, 0x0a, 0x16, 0x4a, 0x6f, + 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x41, 0x69, 0x72, + 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x75, 0x65, 0x22, 0x7d, + 0x0a, 0x12, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x61, 0x0a, + 0x13, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, + 0x09, 0x6c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x06, + 0x22, 0x39, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, + 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x64, 0x22, 0xa3, 0x03, 0x0a, 0x1b, + 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x4e, 0x0a, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, + 0x6f, 0x62, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x75, + 0x72, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x61, 0x69, 0x6c, + 0x75, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0c, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x89, 0x01, + 0x0a, 0x14, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, + 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x56, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x55, 0x6e, 0x6b, 0x6e, + 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x13, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x1a, 0x46, 0x0a, 0x18, 0x55, 0x6e, 0x6b, + 0x6e, 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 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, 0x22, 0x47, 0x0a, 0x10, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x46, 0x61, + 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb5, 0x01, 0x0a, 0x1b, 0x47, + 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, + 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x22, 0xe6, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x07, 0x61, 0x69, 0x72, 0x66, 0x6c, 0x6f, - 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x41, 0x69, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x07, 0x61, 0x69, 0x72, 0x66, - 0x6c, 0x6f, 0x77, 0x22, 0xbd, 0x01, 0x0a, 0x17, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x52, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x38, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, - 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, - 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x05, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x22, 0x49, 0x0a, 0x1d, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x42, - 0x0a, 0x16, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x41, 0x69, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x6f, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, - 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, - 0x75, 0x65, 0x22, 0x7d, 0x0a, 0x12, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4a, 0x6f, 0x62, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x12, + 0x7a, 0x0a, 0x1b, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x19, 0x6a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0xaa, 0x01, 0x0a, 0x18, + 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x22, 0x5a, 0x0a, 0x13, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4a, 0x6f, 0x62, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x09, 0x6c, 0x6f, - 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x06, 0x22, 0x39, 0x0a, - 0x1a, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64, - 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x64, 0x22, 0x95, 0x03, 0x0a, 0x1b, 0x47, 0x65, 0x74, - 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x47, 0x0a, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, - 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, - 0x08, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0c, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, - 0x0a, 0x0d, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x82, 0x01, 0x0a, 0x14, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, - 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, - 0x77, 0x6e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x13, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x70, 0x65, - 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x1a, 0x46, 0x0a, 0x18, 0x55, 0x6e, 0x6b, 0x6e, - 0x6f, 0x77, 0x6e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 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, - 0x22, 0x47, 0x0a, 0x10, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x46, 0x61, 0x69, - 0x6c, 0x75, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb5, 0x01, 0x0a, 0x1b, 0x47, 0x65, - 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x14, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0xd8, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, - 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x02, 0x18, - 0x01, 0x52, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x12, 0x73, 0x0a, 0x1b, 0x6a, 0x6f, 0x62, 0x5f, 0x73, - 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x52, 0x19, 0x6a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0xa3, 0x01, 0x0a, - 0x18, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, - 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x6a, - 0x6f, 0x62, 0x22, 0xaf, 0x01, 0x0a, 0x22, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, 0x6c, - 0x6c, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, - 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, - 0x6a, 0x6f, 0x62, 0x73, 0x22, 0x64, 0x0a, 0x23, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, - 0x6c, 0x6c, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6c, - 0x6f, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, - 0x09, 0x6c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x78, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x6a, 0x6f, 0x62, 0x22, 0xb6, 0x01, 0x0a, 0x22, 0x52, 0x65, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x41, 0x6c, 0x6c, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, - 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x54, 0x61, - 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x61, - 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x04, 0x74, 0x61, - 0x73, 0x6b, 0x22, 0xed, 0x02, 0x0a, 0x07, 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x50, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x54, - 0x61, 0x73, 0x6b, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x0c, - 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, - 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x1a, - 0x43, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x1a, 0x2c, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, - 0x63, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, - 0x63, 0x79, 0x22, 0xb8, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x74, - 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, - 0x65, 0x54, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x73, 0x0a, - 0x11, 0x47, 0x65, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x03, 0x65, - 0x6e, 0x64, 0x32, 0xe7, 0x16, 0x0a, 0x17, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x93, - 0x01, 0x0a, 0x16, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x2e, 0x6f, 0x64, 0x70, 0x66, - 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x53, - 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x6a, 0x6f, 0x62, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6a, 0x6f, 0x62, + 0x73, 0x22, 0x6b, 0x0a, 0x23, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, 0x6c, 0x6c, 0x4a, + 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x28, 0x01, 0x30, 0x01, 0x12, 0xbc, 0x01, 0x0a, 0x0a, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, - 0x65, 0x63, 0x74, 0x12, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x4c, 0x6f, 0x67, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x78, + 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4a, + 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, + 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x22, 0xfb, 0x02, + 0x0a, 0x07, 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x57, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, - 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x51, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4b, 0x22, 0x46, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x62, 0x54, 0x61, 0x73, 0x6b, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x58, + 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x2e, + 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x1a, 0x43, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x2c, 0x0a, + 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x64, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x22, 0xb8, 0x01, 0x0a, 0x10, + 0x47, 0x65, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x3d, 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, + 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, + 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x73, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x57, 0x69, 0x6e, + 0x64, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, + 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0xd9, 0x01, 0x0a, 0x16, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x40, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x6f, + 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x6a, + 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0xb1, 0x02, 0x0a, 0x14, 0x53, 0x79, 0x6e, 0x63, 0x4a, 0x6f, 0x62, 0x73, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, + 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x62, 0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, + 0x63, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x09, + 0x6a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x1a, 0x6b, 0x0a, 0x0c, 0x4a, 0x6f, 0x62, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x61, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x53, 0x79, 0x6e, 0x63, 0x4a, 0x6f, + 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, + 0x54, 0x0a, 0x08, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x4a, + 0x4f, 0x42, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x4a, 0x4f, 0x42, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x45, 0x5f, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x16, 0x0a, + 0x12, 0x4a, 0x4f, 0x42, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x42, + 0x4c, 0x45, 0x44, 0x10, 0x02, 0x32, 0xd5, 0x1d, 0x0a, 0x17, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0xa1, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x53, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0xca, 0x01, 0x0a, 0x0a, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, + 0x70, 0x65, 0x63, 0x74, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x49, 0x6e, 0x73, 0x70, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, + 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x51, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4b, 0x22, 0x46, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x69, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x3a, + 0x01, 0x2a, 0x12, 0xe6, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x49, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x43, 0x22, 0x3e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x69, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, - 0x3a, 0x01, 0x2a, 0x12, 0xd8, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4a, 0x6f, - 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x49, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x43, 0x22, 0x3e, 0x2f, 0x76, 0x31, + 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x3a, 0x01, 0x2a, 0x12, 0xe1, 0x01, 0x0a, 0x14, + 0x41, 0x64, 0x64, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4a, 0x6f, 0x62, 0x53, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x22, 0x3f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x3a, 0x01, 0x2a, 0x12, 0xd3, - 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x36, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x37, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4a, - 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, - 0x22, 0x3f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, - 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xdc, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, - 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x39, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, - 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x1a, - 0x3f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x73, - 0x3a, 0x01, 0x2a, 0x12, 0xd7, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x73, 0x3a, 0x01, 0x2a, 0x12, + 0xea, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x40, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x1a, 0x3f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xe5, 0x01, 0x0a, + 0x13, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x4b, 0x12, 0x49, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, - 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x9e, 0x01, - 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x36, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, - 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, - 0x0d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6a, 0x6f, 0x62, 0x73, 0x12, 0xe0, - 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x2e, 0x6f, 0x64, 0x70, 0x66, + 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, - 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x51, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4b, 0x12, 0x49, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x12, 0xac, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3d, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4b, 0x2a, 0x49, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x7d, 0x12, 0xcf, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x46, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x40, 0x12, 0x3e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, - 0x6a, 0x6f, 0x62, 0x12, 0xbd, 0x01, 0x0a, 0x15, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, - 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, - 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, + 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6a, + 0x6f, 0x62, 0x73, 0x12, 0xee, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, + 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x40, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x12, 0x91, 0x01, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, - 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x51, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4b, 0x2a, 0x49, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x12, 0xd0, 0x01, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4a, + 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x3b, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x22, 0x34, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2d, 0x6a, 0x6f, 0x62, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0xdd, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, + 0x12, 0x3d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x3e, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x46, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x40, 0x12, 0x3e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x12, 0xcb, 0x01, 0x0a, 0x15, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x3e, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x70, 0x0a, 0x0b, 0x52, 0x65, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x86, 0x01, 0x0a, 0x13, 0x47, 0x65, - 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x35, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x3f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, - 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0xa2, 0x01, 0x0a, 0x1b, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, 0x6c, - 0x6c, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x3d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, - 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, 0x6c, 0x6c, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x9f, 0x01, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, + 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x3f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x3e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, 0x6c, 0x6c, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0xc1, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4a, - 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, + 0x74, 0x1a, 0x40, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x7e, 0x0a, 0x0b, 0x52, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x34, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, + 0x68, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x94, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x3c, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x73, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x56, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x50, 0x12, 0x4e, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6a, 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x7f, 0x0a, 0x09, 0x47, - 0x65, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, + 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0xb0, + 0x01, 0x0a, 0x1b, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, 0x6c, 0x6c, 0x4a, 0x6f, 0x62, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x44, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, 0x6c, 0x6c, 0x4a, 0x6f, 0x62, 0x53, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x45, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, + 0x6c, 0x6c, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, + 0x01, 0x12, 0xcf, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, + 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x62, 0x54, + 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x50, 0x12, 0x4e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, + 0x6a, 0x6f, 0x62, 0x2f, 0x7b, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x74, + 0x61, 0x73, 0x6b, 0x12, 0x8d, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, + 0x77, 0x12, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x6f, 0x70, 0x74, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x69, 0x6e, 0x64, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x77, 0x69, 0x6e, + 0x64, 0x6f, 0x77, 0x12, 0xde, 0x01, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, + 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x39, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x73, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x50, 0x32, 0x4b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, + 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2d, 0x6a, 0x6f, 0x62, 0x2d, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x3a, 0x01, 0x2a, 0x12, 0xd6, 0x01, 0x0a, 0x0d, 0x53, 0x79, 0x6e, 0x63, 0x4a, 0x6f, 0x62, + 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4a, 0x6f, + 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x42, 0xa2, 0x01, 0x0a, - 0x16, 0x69, 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x1e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, 0x41, 0x45, 0x12, 0x05, 0x32, 0x03, - 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, - 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x23, 0x0a, 0x21, - 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x4a, 0x6f, 0x62, 0x20, 0x53, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4a, 0x6f, 0x62, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x54, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4e, 0x32, + 0x49, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, + 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x73, 0x79, 0x6e, 0x63, + 0x2d, 0x6a, 0x6f, 0x62, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x42, 0xaa, 0x01, + 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x42, 0x1e, 0x4a, 0x6f, 0x62, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, + 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x92, 0x41, 0x45, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, + 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, + 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x23, 0x0a, 0x21, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x20, 0x4a, 0x6f, 0x62, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( - file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescOnce sync.Once - file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescData = file_odpf_optimus_core_v1beta1_job_spec_proto_rawDesc + file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescOnce sync.Once + file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescData = file_raystack_optimus_core_v1beta1_job_spec_proto_rawDesc ) -func file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescGZIP() []byte { - file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescOnce.Do(func() { - file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescData) +func file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescGZIP() []byte { + file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescOnce.Do(func() { + file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescData) }) - return file_odpf_optimus_core_v1beta1_job_spec_proto_rawDescData -} - -var file_odpf_optimus_core_v1beta1_job_spec_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 62) -var file_odpf_optimus_core_v1beta1_job_spec_proto_goTypes = []interface{}{ - (JobEvent_Type)(0), // 0: odpf.optimus.core.v1beta1.JobEvent.Type - (*DeployJobSpecificationRequest)(nil), // 1: odpf.optimus.core.v1beta1.DeployJobSpecificationRequest - (*DeployJobSpecificationResponse)(nil), // 2: odpf.optimus.core.v1beta1.DeployJobSpecificationResponse - (*AddJobSpecificationsRequest)(nil), // 3: odpf.optimus.core.v1beta1.AddJobSpecificationsRequest - (*AddJobSpecificationsResponse)(nil), // 4: odpf.optimus.core.v1beta1.AddJobSpecificationsResponse - (*UpdateJobSpecificationsRequest)(nil), // 5: odpf.optimus.core.v1beta1.UpdateJobSpecificationsRequest - (*UpdateJobSpecificationsResponse)(nil), // 6: odpf.optimus.core.v1beta1.UpdateJobSpecificationsResponse - (*JobInspectRequest)(nil), // 7: odpf.optimus.core.v1beta1.JobInspectRequest - (*JobRun)(nil), // 8: odpf.optimus.core.v1beta1.JobRun - (*JobInspectResponse)(nil), // 9: odpf.optimus.core.v1beta1.JobInspectResponse - (*CreateJobSpecificationRequest)(nil), // 10: odpf.optimus.core.v1beta1.CreateJobSpecificationRequest - (*CreateJobSpecificationResponse)(nil), // 11: odpf.optimus.core.v1beta1.CreateJobSpecificationResponse - (*GetJobSpecificationRequest)(nil), // 12: odpf.optimus.core.v1beta1.GetJobSpecificationRequest - (*GetJobSpecificationResponse)(nil), // 13: odpf.optimus.core.v1beta1.GetJobSpecificationResponse - (*DeleteJobSpecificationRequest)(nil), // 14: odpf.optimus.core.v1beta1.DeleteJobSpecificationRequest - (*DeleteJobSpecificationResponse)(nil), // 15: odpf.optimus.core.v1beta1.DeleteJobSpecificationResponse - (*ListJobSpecificationRequest)(nil), // 16: odpf.optimus.core.v1beta1.ListJobSpecificationRequest - (*ListJobSpecificationResponse)(nil), // 17: odpf.optimus.core.v1beta1.ListJobSpecificationResponse - (*CheckJobSpecificationRequest)(nil), // 18: odpf.optimus.core.v1beta1.CheckJobSpecificationRequest - (*CheckJobSpecificationResponse)(nil), // 19: odpf.optimus.core.v1beta1.CheckJobSpecificationResponse - (*CheckJobSpecificationsRequest)(nil), // 20: odpf.optimus.core.v1beta1.CheckJobSpecificationsRequest - (*CheckJobSpecificationsResponse)(nil), // 21: odpf.optimus.core.v1beta1.CheckJobSpecificationsResponse - (*JobSpecification)(nil), // 22: odpf.optimus.core.v1beta1.JobSpecification - (*JobDependency)(nil), // 23: odpf.optimus.core.v1beta1.JobDependency - (*HttpDependency)(nil), // 24: odpf.optimus.core.v1beta1.HttpDependency - (*JobSpecHook)(nil), // 25: odpf.optimus.core.v1beta1.JobSpecHook - (*JobConfigItem)(nil), // 26: odpf.optimus.core.v1beta1.JobConfigItem - (*JobEvent)(nil), // 27: odpf.optimus.core.v1beta1.JobEvent - (*JobMetadata)(nil), // 28: odpf.optimus.core.v1beta1.JobMetadata - (*JobSpecMetadataResource)(nil), // 29: odpf.optimus.core.v1beta1.JobSpecMetadataResource - (*JobSpecMetadataResourceConfig)(nil), // 30: odpf.optimus.core.v1beta1.JobSpecMetadataResourceConfig - (*JobSpecMetadataAirflow)(nil), // 31: odpf.optimus.core.v1beta1.JobSpecMetadataAirflow - (*RefreshJobsRequest)(nil), // 32: odpf.optimus.core.v1beta1.RefreshJobsRequest - (*RefreshJobsResponse)(nil), // 33: odpf.optimus.core.v1beta1.RefreshJobsResponse - (*GetDeployJobsStatusRequest)(nil), // 34: odpf.optimus.core.v1beta1.GetDeployJobsStatusRequest - (*GetDeployJobsStatusResponse)(nil), // 35: odpf.optimus.core.v1beta1.GetDeployJobsStatusResponse - (*DeployJobFailure)(nil), // 36: odpf.optimus.core.v1beta1.DeployJobFailure - (*GetJobSpecificationsRequest)(nil), // 37: odpf.optimus.core.v1beta1.GetJobSpecificationsRequest - (*GetJobSpecificationsResponse)(nil), // 38: odpf.optimus.core.v1beta1.GetJobSpecificationsResponse - (*JobSpecificationResponse)(nil), // 39: odpf.optimus.core.v1beta1.JobSpecificationResponse - (*ReplaceAllJobSpecificationsRequest)(nil), // 40: odpf.optimus.core.v1beta1.ReplaceAllJobSpecificationsRequest - (*ReplaceAllJobSpecificationsResponse)(nil), // 41: odpf.optimus.core.v1beta1.ReplaceAllJobSpecificationsResponse - (*GetJobTaskRequest)(nil), // 42: odpf.optimus.core.v1beta1.GetJobTaskRequest - (*GetJobTaskResponse)(nil), // 43: odpf.optimus.core.v1beta1.GetJobTaskResponse - (*JobTask)(nil), // 44: odpf.optimus.core.v1beta1.JobTask - (*GetWindowRequest)(nil), // 45: odpf.optimus.core.v1beta1.GetWindowRequest - (*GetWindowResponse)(nil), // 46: odpf.optimus.core.v1beta1.GetWindowResponse - (*JobInspectResponse_BasicInfoSection)(nil), // 47: odpf.optimus.core.v1beta1.JobInspectResponse.BasicInfoSection - (*JobInspectResponse_JobDependency)(nil), // 48: odpf.optimus.core.v1beta1.JobInspectResponse.JobDependency - (*JobInspectResponse_UpstreamSection)(nil), // 49: odpf.optimus.core.v1beta1.JobInspectResponse.UpstreamSection - (*JobInspectResponse_DownstreamSection)(nil), // 50: odpf.optimus.core.v1beta1.JobInspectResponse.DownstreamSection - (*JobInspectResponse_UpstreamSection_UnknownDependencies)(nil), // 51: odpf.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.UnknownDependencies - nil, // 52: odpf.optimus.core.v1beta1.JobSpecification.AssetsEntry - nil, // 53: odpf.optimus.core.v1beta1.JobSpecification.LabelsEntry - (*JobSpecification_Behavior)(nil), // 54: odpf.optimus.core.v1beta1.JobSpecification.Behavior - (*JobSpecification_Behavior_Retry)(nil), // 55: odpf.optimus.core.v1beta1.JobSpecification.Behavior.Retry - (*JobSpecification_Behavior_Notifiers)(nil), // 56: odpf.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers - nil, // 57: odpf.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers.ConfigEntry - nil, // 58: odpf.optimus.core.v1beta1.HttpDependency.HeadersEntry - nil, // 59: odpf.optimus.core.v1beta1.HttpDependency.ParamsEntry - nil, // 60: odpf.optimus.core.v1beta1.GetDeployJobsStatusResponse.UnknownDependenciesEntry - (*JobTask_Destination)(nil), // 61: odpf.optimus.core.v1beta1.JobTask.Destination - (*JobTask_Dependency)(nil), // 62: odpf.optimus.core.v1beta1.JobTask.Dependency - (*Log)(nil), // 63: odpf.optimus.core.v1beta1.Log - (*timestamppb.Timestamp)(nil), // 64: google.protobuf.Timestamp - (*structpb.Struct)(nil), // 65: google.protobuf.Struct - (*durationpb.Duration)(nil), // 66: google.protobuf.Duration -} -var file_odpf_optimus_core_v1beta1_job_spec_proto_depIdxs = []int32{ - 22, // 0: odpf.optimus.core.v1beta1.DeployJobSpecificationRequest.jobs:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 63, // 1: odpf.optimus.core.v1beta1.DeployJobSpecificationResponse.log_status:type_name -> odpf.optimus.core.v1beta1.Log - 22, // 2: odpf.optimus.core.v1beta1.AddJobSpecificationsRequest.specs:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 22, // 3: odpf.optimus.core.v1beta1.UpdateJobSpecificationsRequest.specs:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 22, // 4: odpf.optimus.core.v1beta1.JobInspectRequest.spec:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 64, // 5: odpf.optimus.core.v1beta1.JobInspectRequest.scheduled_at:type_name -> google.protobuf.Timestamp - 64, // 6: odpf.optimus.core.v1beta1.JobRun.scheduled_at:type_name -> google.protobuf.Timestamp - 47, // 7: odpf.optimus.core.v1beta1.JobInspectResponse.basic_info:type_name -> odpf.optimus.core.v1beta1.JobInspectResponse.BasicInfoSection - 49, // 8: odpf.optimus.core.v1beta1.JobInspectResponse.upstreams:type_name -> odpf.optimus.core.v1beta1.JobInspectResponse.UpstreamSection - 50, // 9: odpf.optimus.core.v1beta1.JobInspectResponse.downstreams:type_name -> odpf.optimus.core.v1beta1.JobInspectResponse.DownstreamSection - 22, // 10: odpf.optimus.core.v1beta1.CreateJobSpecificationRequest.spec:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 22, // 11: odpf.optimus.core.v1beta1.GetJobSpecificationResponse.spec:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 22, // 12: odpf.optimus.core.v1beta1.ListJobSpecificationResponse.jobs:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 22, // 13: odpf.optimus.core.v1beta1.CheckJobSpecificationRequest.job:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 22, // 14: odpf.optimus.core.v1beta1.CheckJobSpecificationsRequest.jobs:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 63, // 15: odpf.optimus.core.v1beta1.CheckJobSpecificationsResponse.log_status:type_name -> odpf.optimus.core.v1beta1.Log - 26, // 16: odpf.optimus.core.v1beta1.JobSpecification.config:type_name -> odpf.optimus.core.v1beta1.JobConfigItem - 23, // 17: odpf.optimus.core.v1beta1.JobSpecification.dependencies:type_name -> odpf.optimus.core.v1beta1.JobDependency - 52, // 18: odpf.optimus.core.v1beta1.JobSpecification.assets:type_name -> odpf.optimus.core.v1beta1.JobSpecification.AssetsEntry - 25, // 19: odpf.optimus.core.v1beta1.JobSpecification.hooks:type_name -> odpf.optimus.core.v1beta1.JobSpecHook - 53, // 20: odpf.optimus.core.v1beta1.JobSpecification.labels:type_name -> odpf.optimus.core.v1beta1.JobSpecification.LabelsEntry - 54, // 21: odpf.optimus.core.v1beta1.JobSpecification.behavior:type_name -> odpf.optimus.core.v1beta1.JobSpecification.Behavior - 28, // 22: odpf.optimus.core.v1beta1.JobSpecification.metadata:type_name -> odpf.optimus.core.v1beta1.JobMetadata - 24, // 23: odpf.optimus.core.v1beta1.JobDependency.http_dependency:type_name -> odpf.optimus.core.v1beta1.HttpDependency - 58, // 24: odpf.optimus.core.v1beta1.HttpDependency.headers:type_name -> odpf.optimus.core.v1beta1.HttpDependency.HeadersEntry - 59, // 25: odpf.optimus.core.v1beta1.HttpDependency.params:type_name -> odpf.optimus.core.v1beta1.HttpDependency.ParamsEntry - 26, // 26: odpf.optimus.core.v1beta1.JobSpecHook.config:type_name -> odpf.optimus.core.v1beta1.JobConfigItem - 0, // 27: odpf.optimus.core.v1beta1.JobEvent.type:type_name -> odpf.optimus.core.v1beta1.JobEvent.Type - 65, // 28: odpf.optimus.core.v1beta1.JobEvent.value:type_name -> google.protobuf.Struct - 29, // 29: odpf.optimus.core.v1beta1.JobMetadata.resource:type_name -> odpf.optimus.core.v1beta1.JobSpecMetadataResource - 31, // 30: odpf.optimus.core.v1beta1.JobMetadata.airflow:type_name -> odpf.optimus.core.v1beta1.JobSpecMetadataAirflow - 30, // 31: odpf.optimus.core.v1beta1.JobSpecMetadataResource.request:type_name -> odpf.optimus.core.v1beta1.JobSpecMetadataResourceConfig - 30, // 32: odpf.optimus.core.v1beta1.JobSpecMetadataResource.limit:type_name -> odpf.optimus.core.v1beta1.JobSpecMetadataResourceConfig - 63, // 33: odpf.optimus.core.v1beta1.RefreshJobsResponse.log_status:type_name -> odpf.optimus.core.v1beta1.Log - 36, // 34: odpf.optimus.core.v1beta1.GetDeployJobsStatusResponse.failures:type_name -> odpf.optimus.core.v1beta1.DeployJobFailure - 60, // 35: odpf.optimus.core.v1beta1.GetDeployJobsStatusResponse.unknown_dependencies:type_name -> odpf.optimus.core.v1beta1.GetDeployJobsStatusResponse.UnknownDependenciesEntry - 22, // 36: odpf.optimus.core.v1beta1.GetJobSpecificationsResponse.jobs:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 39, // 37: odpf.optimus.core.v1beta1.GetJobSpecificationsResponse.job_specification_responses:type_name -> odpf.optimus.core.v1beta1.JobSpecificationResponse - 22, // 38: odpf.optimus.core.v1beta1.JobSpecificationResponse.job:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 22, // 39: odpf.optimus.core.v1beta1.ReplaceAllJobSpecificationsRequest.jobs:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 63, // 40: odpf.optimus.core.v1beta1.ReplaceAllJobSpecificationsResponse.log_status:type_name -> odpf.optimus.core.v1beta1.Log - 44, // 41: odpf.optimus.core.v1beta1.GetJobTaskResponse.task:type_name -> odpf.optimus.core.v1beta1.JobTask - 61, // 42: odpf.optimus.core.v1beta1.JobTask.destination:type_name -> odpf.optimus.core.v1beta1.JobTask.Destination - 62, // 43: odpf.optimus.core.v1beta1.JobTask.dependencies:type_name -> odpf.optimus.core.v1beta1.JobTask.Dependency - 64, // 44: odpf.optimus.core.v1beta1.GetWindowRequest.scheduled_at:type_name -> google.protobuf.Timestamp - 64, // 45: odpf.optimus.core.v1beta1.GetWindowResponse.start:type_name -> google.protobuf.Timestamp - 64, // 46: odpf.optimus.core.v1beta1.GetWindowResponse.end:type_name -> google.protobuf.Timestamp - 22, // 47: odpf.optimus.core.v1beta1.JobInspectResponse.BasicInfoSection.job:type_name -> odpf.optimus.core.v1beta1.JobSpecification - 63, // 48: odpf.optimus.core.v1beta1.JobInspectResponse.BasicInfoSection.notice:type_name -> odpf.optimus.core.v1beta1.Log - 8, // 49: odpf.optimus.core.v1beta1.JobInspectResponse.JobDependency.runs:type_name -> odpf.optimus.core.v1beta1.JobRun - 48, // 50: odpf.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.external_dependency:type_name -> odpf.optimus.core.v1beta1.JobInspectResponse.JobDependency - 48, // 51: odpf.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.internal_dependency:type_name -> odpf.optimus.core.v1beta1.JobInspectResponse.JobDependency - 24, // 52: odpf.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.http_dependency:type_name -> odpf.optimus.core.v1beta1.HttpDependency - 51, // 53: odpf.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.unknown_dependencies:type_name -> odpf.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.UnknownDependencies - 63, // 54: odpf.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.notice:type_name -> odpf.optimus.core.v1beta1.Log - 48, // 55: odpf.optimus.core.v1beta1.JobInspectResponse.DownstreamSection.downstream_jobs:type_name -> odpf.optimus.core.v1beta1.JobInspectResponse.JobDependency - 63, // 56: odpf.optimus.core.v1beta1.JobInspectResponse.DownstreamSection.notice:type_name -> odpf.optimus.core.v1beta1.Log - 55, // 57: odpf.optimus.core.v1beta1.JobSpecification.Behavior.retry:type_name -> odpf.optimus.core.v1beta1.JobSpecification.Behavior.Retry - 56, // 58: odpf.optimus.core.v1beta1.JobSpecification.Behavior.notify:type_name -> odpf.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers - 66, // 59: odpf.optimus.core.v1beta1.JobSpecification.Behavior.Retry.delay:type_name -> google.protobuf.Duration - 0, // 60: odpf.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers.on:type_name -> odpf.optimus.core.v1beta1.JobEvent.Type - 57, // 61: odpf.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers.config:type_name -> odpf.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers.ConfigEntry - 1, // 62: odpf.optimus.core.v1beta1.JobSpecificationService.DeployJobSpecification:input_type -> odpf.optimus.core.v1beta1.DeployJobSpecificationRequest - 7, // 63: odpf.optimus.core.v1beta1.JobSpecificationService.JobInspect:input_type -> odpf.optimus.core.v1beta1.JobInspectRequest - 10, // 64: odpf.optimus.core.v1beta1.JobSpecificationService.CreateJobSpecification:input_type -> odpf.optimus.core.v1beta1.CreateJobSpecificationRequest - 3, // 65: odpf.optimus.core.v1beta1.JobSpecificationService.AddJobSpecifications:input_type -> odpf.optimus.core.v1beta1.AddJobSpecificationsRequest - 5, // 66: odpf.optimus.core.v1beta1.JobSpecificationService.UpdateJobSpecifications:input_type -> odpf.optimus.core.v1beta1.UpdateJobSpecificationsRequest - 12, // 67: odpf.optimus.core.v1beta1.JobSpecificationService.GetJobSpecification:input_type -> odpf.optimus.core.v1beta1.GetJobSpecificationRequest - 37, // 68: odpf.optimus.core.v1beta1.JobSpecificationService.GetJobSpecifications:input_type -> odpf.optimus.core.v1beta1.GetJobSpecificationsRequest - 14, // 69: odpf.optimus.core.v1beta1.JobSpecificationService.DeleteJobSpecification:input_type -> odpf.optimus.core.v1beta1.DeleteJobSpecificationRequest - 16, // 70: odpf.optimus.core.v1beta1.JobSpecificationService.ListJobSpecification:input_type -> odpf.optimus.core.v1beta1.ListJobSpecificationRequest - 18, // 71: odpf.optimus.core.v1beta1.JobSpecificationService.CheckJobSpecification:input_type -> odpf.optimus.core.v1beta1.CheckJobSpecificationRequest - 20, // 72: odpf.optimus.core.v1beta1.JobSpecificationService.CheckJobSpecifications:input_type -> odpf.optimus.core.v1beta1.CheckJobSpecificationsRequest - 32, // 73: odpf.optimus.core.v1beta1.JobSpecificationService.RefreshJobs:input_type -> odpf.optimus.core.v1beta1.RefreshJobsRequest - 34, // 74: odpf.optimus.core.v1beta1.JobSpecificationService.GetDeployJobsStatus:input_type -> odpf.optimus.core.v1beta1.GetDeployJobsStatusRequest - 40, // 75: odpf.optimus.core.v1beta1.JobSpecificationService.ReplaceAllJobSpecifications:input_type -> odpf.optimus.core.v1beta1.ReplaceAllJobSpecificationsRequest - 42, // 76: odpf.optimus.core.v1beta1.JobSpecificationService.GetJobTask:input_type -> odpf.optimus.core.v1beta1.GetJobTaskRequest - 45, // 77: odpf.optimus.core.v1beta1.JobSpecificationService.GetWindow:input_type -> odpf.optimus.core.v1beta1.GetWindowRequest - 2, // 78: odpf.optimus.core.v1beta1.JobSpecificationService.DeployJobSpecification:output_type -> odpf.optimus.core.v1beta1.DeployJobSpecificationResponse - 9, // 79: odpf.optimus.core.v1beta1.JobSpecificationService.JobInspect:output_type -> odpf.optimus.core.v1beta1.JobInspectResponse - 11, // 80: odpf.optimus.core.v1beta1.JobSpecificationService.CreateJobSpecification:output_type -> odpf.optimus.core.v1beta1.CreateJobSpecificationResponse - 4, // 81: odpf.optimus.core.v1beta1.JobSpecificationService.AddJobSpecifications:output_type -> odpf.optimus.core.v1beta1.AddJobSpecificationsResponse - 6, // 82: odpf.optimus.core.v1beta1.JobSpecificationService.UpdateJobSpecifications:output_type -> odpf.optimus.core.v1beta1.UpdateJobSpecificationsResponse - 13, // 83: odpf.optimus.core.v1beta1.JobSpecificationService.GetJobSpecification:output_type -> odpf.optimus.core.v1beta1.GetJobSpecificationResponse - 38, // 84: odpf.optimus.core.v1beta1.JobSpecificationService.GetJobSpecifications:output_type -> odpf.optimus.core.v1beta1.GetJobSpecificationsResponse - 15, // 85: odpf.optimus.core.v1beta1.JobSpecificationService.DeleteJobSpecification:output_type -> odpf.optimus.core.v1beta1.DeleteJobSpecificationResponse - 17, // 86: odpf.optimus.core.v1beta1.JobSpecificationService.ListJobSpecification:output_type -> odpf.optimus.core.v1beta1.ListJobSpecificationResponse - 19, // 87: odpf.optimus.core.v1beta1.JobSpecificationService.CheckJobSpecification:output_type -> odpf.optimus.core.v1beta1.CheckJobSpecificationResponse - 21, // 88: odpf.optimus.core.v1beta1.JobSpecificationService.CheckJobSpecifications:output_type -> odpf.optimus.core.v1beta1.CheckJobSpecificationsResponse - 33, // 89: odpf.optimus.core.v1beta1.JobSpecificationService.RefreshJobs:output_type -> odpf.optimus.core.v1beta1.RefreshJobsResponse - 35, // 90: odpf.optimus.core.v1beta1.JobSpecificationService.GetDeployJobsStatus:output_type -> odpf.optimus.core.v1beta1.GetDeployJobsStatusResponse - 41, // 91: odpf.optimus.core.v1beta1.JobSpecificationService.ReplaceAllJobSpecifications:output_type -> odpf.optimus.core.v1beta1.ReplaceAllJobSpecificationsResponse - 43, // 92: odpf.optimus.core.v1beta1.JobSpecificationService.GetJobTask:output_type -> odpf.optimus.core.v1beta1.GetJobTaskResponse - 46, // 93: odpf.optimus.core.v1beta1.JobSpecificationService.GetWindow:output_type -> odpf.optimus.core.v1beta1.GetWindowResponse - 78, // [78:94] is the sub-list for method output_type - 62, // [62:78] is the sub-list for method input_type - 62, // [62:62] is the sub-list for extension type_name - 62, // [62:62] is the sub-list for extension extendee - 0, // [0:62] is the sub-list for field type_name -} - -func init() { file_odpf_optimus_core_v1beta1_job_spec_proto_init() } -func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { - if File_odpf_optimus_core_v1beta1_job_spec_proto != nil { + return file_raystack_optimus_core_v1beta1_job_spec_proto_rawDescData +} + +var file_raystack_optimus_core_v1beta1_job_spec_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 69) +var file_raystack_optimus_core_v1beta1_job_spec_proto_goTypes = []interface{}{ + (JobState)(0), // 0: raystack.optimus.core.v1beta1.JobState + (JobEvent_Type)(0), // 1: raystack.optimus.core.v1beta1.JobEvent.Type + (*DeployJobSpecificationRequest)(nil), // 2: raystack.optimus.core.v1beta1.DeployJobSpecificationRequest + (*DeployJobSpecificationResponse)(nil), // 3: raystack.optimus.core.v1beta1.DeployJobSpecificationResponse + (*AddJobSpecificationsRequest)(nil), // 4: raystack.optimus.core.v1beta1.AddJobSpecificationsRequest + (*AddJobSpecificationsResponse)(nil), // 5: raystack.optimus.core.v1beta1.AddJobSpecificationsResponse + (*UpdateJobSpecificationsRequest)(nil), // 6: raystack.optimus.core.v1beta1.UpdateJobSpecificationsRequest + (*UpdateJobSpecificationsResponse)(nil), // 7: raystack.optimus.core.v1beta1.UpdateJobSpecificationsResponse + (*JobInspectRequest)(nil), // 8: raystack.optimus.core.v1beta1.JobInspectRequest + (*JobRun)(nil), // 9: raystack.optimus.core.v1beta1.JobRun + (*JobInspectResponse)(nil), // 10: raystack.optimus.core.v1beta1.JobInspectResponse + (*CreateJobSpecificationRequest)(nil), // 11: raystack.optimus.core.v1beta1.CreateJobSpecificationRequest + (*CreateJobSpecificationResponse)(nil), // 12: raystack.optimus.core.v1beta1.CreateJobSpecificationResponse + (*GetJobSpecificationRequest)(nil), // 13: raystack.optimus.core.v1beta1.GetJobSpecificationRequest + (*GetJobSpecificationResponse)(nil), // 14: raystack.optimus.core.v1beta1.GetJobSpecificationResponse + (*DeleteJobSpecificationRequest)(nil), // 15: raystack.optimus.core.v1beta1.DeleteJobSpecificationRequest + (*DeleteJobSpecificationResponse)(nil), // 16: raystack.optimus.core.v1beta1.DeleteJobSpecificationResponse + (*ChangeJobNamespaceRequest)(nil), // 17: raystack.optimus.core.v1beta1.ChangeJobNamespaceRequest + (*ChangeJobNamespaceResponse)(nil), // 18: raystack.optimus.core.v1beta1.ChangeJobNamespaceResponse + (*ListJobSpecificationRequest)(nil), // 19: raystack.optimus.core.v1beta1.ListJobSpecificationRequest + (*ListJobSpecificationResponse)(nil), // 20: raystack.optimus.core.v1beta1.ListJobSpecificationResponse + (*CheckJobSpecificationRequest)(nil), // 21: raystack.optimus.core.v1beta1.CheckJobSpecificationRequest + (*CheckJobSpecificationResponse)(nil), // 22: raystack.optimus.core.v1beta1.CheckJobSpecificationResponse + (*CheckJobSpecificationsRequest)(nil), // 23: raystack.optimus.core.v1beta1.CheckJobSpecificationsRequest + (*CheckJobSpecificationsResponse)(nil), // 24: raystack.optimus.core.v1beta1.CheckJobSpecificationsResponse + (*JobSpecification)(nil), // 25: raystack.optimus.core.v1beta1.JobSpecification + (*JobDependency)(nil), // 26: raystack.optimus.core.v1beta1.JobDependency + (*HttpDependency)(nil), // 27: raystack.optimus.core.v1beta1.HttpDependency + (*JobSpecHook)(nil), // 28: raystack.optimus.core.v1beta1.JobSpecHook + (*JobConfigItem)(nil), // 29: raystack.optimus.core.v1beta1.JobConfigItem + (*JobEvent)(nil), // 30: raystack.optimus.core.v1beta1.JobEvent + (*JobMetadata)(nil), // 31: raystack.optimus.core.v1beta1.JobMetadata + (*JobSpecMetadataResource)(nil), // 32: raystack.optimus.core.v1beta1.JobSpecMetadataResource + (*JobSpecMetadataResourceConfig)(nil), // 33: raystack.optimus.core.v1beta1.JobSpecMetadataResourceConfig + (*JobSpecMetadataAirflow)(nil), // 34: raystack.optimus.core.v1beta1.JobSpecMetadataAirflow + (*RefreshJobsRequest)(nil), // 35: raystack.optimus.core.v1beta1.RefreshJobsRequest + (*RefreshJobsResponse)(nil), // 36: raystack.optimus.core.v1beta1.RefreshJobsResponse + (*GetDeployJobsStatusRequest)(nil), // 37: raystack.optimus.core.v1beta1.GetDeployJobsStatusRequest + (*GetDeployJobsStatusResponse)(nil), // 38: raystack.optimus.core.v1beta1.GetDeployJobsStatusResponse + (*DeployJobFailure)(nil), // 39: raystack.optimus.core.v1beta1.DeployJobFailure + (*GetJobSpecificationsRequest)(nil), // 40: raystack.optimus.core.v1beta1.GetJobSpecificationsRequest + (*GetJobSpecificationsResponse)(nil), // 41: raystack.optimus.core.v1beta1.GetJobSpecificationsResponse + (*JobSpecificationResponse)(nil), // 42: raystack.optimus.core.v1beta1.JobSpecificationResponse + (*ReplaceAllJobSpecificationsRequest)(nil), // 43: raystack.optimus.core.v1beta1.ReplaceAllJobSpecificationsRequest + (*ReplaceAllJobSpecificationsResponse)(nil), // 44: raystack.optimus.core.v1beta1.ReplaceAllJobSpecificationsResponse + (*GetJobTaskRequest)(nil), // 45: raystack.optimus.core.v1beta1.GetJobTaskRequest + (*GetJobTaskResponse)(nil), // 46: raystack.optimus.core.v1beta1.GetJobTaskResponse + (*JobTask)(nil), // 47: raystack.optimus.core.v1beta1.JobTask + (*GetWindowRequest)(nil), // 48: raystack.optimus.core.v1beta1.GetWindowRequest + (*GetWindowResponse)(nil), // 49: raystack.optimus.core.v1beta1.GetWindowResponse + (*UpdateJobsStateRequest)(nil), // 50: raystack.optimus.core.v1beta1.UpdateJobsStateRequest + (*UpdateJobsStateResponse)(nil), // 51: raystack.optimus.core.v1beta1.UpdateJobsStateResponse + (*SyncJobsStateRequest)(nil), // 52: raystack.optimus.core.v1beta1.SyncJobsStateRequest + (*SyncJobsStateResponse)(nil), // 53: raystack.optimus.core.v1beta1.SyncJobsStateResponse + (*JobInspectResponse_BasicInfoSection)(nil), // 54: raystack.optimus.core.v1beta1.JobInspectResponse.BasicInfoSection + (*JobInspectResponse_JobDependency)(nil), // 55: raystack.optimus.core.v1beta1.JobInspectResponse.JobDependency + (*JobInspectResponse_UpstreamSection)(nil), // 56: raystack.optimus.core.v1beta1.JobInspectResponse.UpstreamSection + (*JobInspectResponse_DownstreamSection)(nil), // 57: raystack.optimus.core.v1beta1.JobInspectResponse.DownstreamSection + (*JobInspectResponse_UpstreamSection_UnknownDependencies)(nil), // 58: raystack.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.UnknownDependencies + nil, // 59: raystack.optimus.core.v1beta1.JobSpecification.AssetsEntry + nil, // 60: raystack.optimus.core.v1beta1.JobSpecification.LabelsEntry + (*JobSpecification_Behavior)(nil), // 61: raystack.optimus.core.v1beta1.JobSpecification.Behavior + (*JobSpecification_Behavior_Retry)(nil), // 62: raystack.optimus.core.v1beta1.JobSpecification.Behavior.Retry + (*JobSpecification_Behavior_Notifiers)(nil), // 63: raystack.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers + nil, // 64: raystack.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers.ConfigEntry + nil, // 65: raystack.optimus.core.v1beta1.HttpDependency.HeadersEntry + nil, // 66: raystack.optimus.core.v1beta1.HttpDependency.ParamsEntry + nil, // 67: raystack.optimus.core.v1beta1.GetDeployJobsStatusResponse.UnknownDependenciesEntry + (*JobTask_Destination)(nil), // 68: raystack.optimus.core.v1beta1.JobTask.Destination + (*JobTask_Dependency)(nil), // 69: raystack.optimus.core.v1beta1.JobTask.Dependency + (*SyncJobsStateRequest_JobStatePair)(nil), // 70: raystack.optimus.core.v1beta1.SyncJobsStateRequest.JobStatePair + (*Log)(nil), // 71: raystack.optimus.core.v1beta1.Log + (*timestamppb.Timestamp)(nil), // 72: google.protobuf.Timestamp + (*structpb.Struct)(nil), // 73: google.protobuf.Struct + (*durationpb.Duration)(nil), // 74: google.protobuf.Duration +} +var file_raystack_optimus_core_v1beta1_job_spec_proto_depIdxs = []int32{ + 25, // 0: raystack.optimus.core.v1beta1.DeployJobSpecificationRequest.jobs:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 71, // 1: raystack.optimus.core.v1beta1.DeployJobSpecificationResponse.log_status:type_name -> raystack.optimus.core.v1beta1.Log + 25, // 2: raystack.optimus.core.v1beta1.AddJobSpecificationsRequest.specs:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 25, // 3: raystack.optimus.core.v1beta1.UpdateJobSpecificationsRequest.specs:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 25, // 4: raystack.optimus.core.v1beta1.JobInspectRequest.spec:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 72, // 5: raystack.optimus.core.v1beta1.JobInspectRequest.scheduled_at:type_name -> google.protobuf.Timestamp + 72, // 6: raystack.optimus.core.v1beta1.JobRun.scheduled_at:type_name -> google.protobuf.Timestamp + 54, // 7: raystack.optimus.core.v1beta1.JobInspectResponse.basic_info:type_name -> raystack.optimus.core.v1beta1.JobInspectResponse.BasicInfoSection + 56, // 8: raystack.optimus.core.v1beta1.JobInspectResponse.upstreams:type_name -> raystack.optimus.core.v1beta1.JobInspectResponse.UpstreamSection + 57, // 9: raystack.optimus.core.v1beta1.JobInspectResponse.downstreams:type_name -> raystack.optimus.core.v1beta1.JobInspectResponse.DownstreamSection + 25, // 10: raystack.optimus.core.v1beta1.CreateJobSpecificationRequest.spec:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 25, // 11: raystack.optimus.core.v1beta1.GetJobSpecificationResponse.spec:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 25, // 12: raystack.optimus.core.v1beta1.ListJobSpecificationResponse.jobs:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 25, // 13: raystack.optimus.core.v1beta1.CheckJobSpecificationRequest.job:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 25, // 14: raystack.optimus.core.v1beta1.CheckJobSpecificationsRequest.jobs:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 71, // 15: raystack.optimus.core.v1beta1.CheckJobSpecificationsResponse.log_status:type_name -> raystack.optimus.core.v1beta1.Log + 29, // 16: raystack.optimus.core.v1beta1.JobSpecification.config:type_name -> raystack.optimus.core.v1beta1.JobConfigItem + 26, // 17: raystack.optimus.core.v1beta1.JobSpecification.dependencies:type_name -> raystack.optimus.core.v1beta1.JobDependency + 59, // 18: raystack.optimus.core.v1beta1.JobSpecification.assets:type_name -> raystack.optimus.core.v1beta1.JobSpecification.AssetsEntry + 28, // 19: raystack.optimus.core.v1beta1.JobSpecification.hooks:type_name -> raystack.optimus.core.v1beta1.JobSpecHook + 60, // 20: raystack.optimus.core.v1beta1.JobSpecification.labels:type_name -> raystack.optimus.core.v1beta1.JobSpecification.LabelsEntry + 61, // 21: raystack.optimus.core.v1beta1.JobSpecification.behavior:type_name -> raystack.optimus.core.v1beta1.JobSpecification.Behavior + 31, // 22: raystack.optimus.core.v1beta1.JobSpecification.metadata:type_name -> raystack.optimus.core.v1beta1.JobMetadata + 27, // 23: raystack.optimus.core.v1beta1.JobDependency.http_dependency:type_name -> raystack.optimus.core.v1beta1.HttpDependency + 65, // 24: raystack.optimus.core.v1beta1.HttpDependency.headers:type_name -> raystack.optimus.core.v1beta1.HttpDependency.HeadersEntry + 66, // 25: raystack.optimus.core.v1beta1.HttpDependency.params:type_name -> raystack.optimus.core.v1beta1.HttpDependency.ParamsEntry + 29, // 26: raystack.optimus.core.v1beta1.JobSpecHook.config:type_name -> raystack.optimus.core.v1beta1.JobConfigItem + 1, // 27: raystack.optimus.core.v1beta1.JobEvent.type:type_name -> raystack.optimus.core.v1beta1.JobEvent.Type + 73, // 28: raystack.optimus.core.v1beta1.JobEvent.value:type_name -> google.protobuf.Struct + 32, // 29: raystack.optimus.core.v1beta1.JobMetadata.resource:type_name -> raystack.optimus.core.v1beta1.JobSpecMetadataResource + 34, // 30: raystack.optimus.core.v1beta1.JobMetadata.airflow:type_name -> raystack.optimus.core.v1beta1.JobSpecMetadataAirflow + 33, // 31: raystack.optimus.core.v1beta1.JobSpecMetadataResource.request:type_name -> raystack.optimus.core.v1beta1.JobSpecMetadataResourceConfig + 33, // 32: raystack.optimus.core.v1beta1.JobSpecMetadataResource.limit:type_name -> raystack.optimus.core.v1beta1.JobSpecMetadataResourceConfig + 71, // 33: raystack.optimus.core.v1beta1.RefreshJobsResponse.log_status:type_name -> raystack.optimus.core.v1beta1.Log + 39, // 34: raystack.optimus.core.v1beta1.GetDeployJobsStatusResponse.failures:type_name -> raystack.optimus.core.v1beta1.DeployJobFailure + 67, // 35: raystack.optimus.core.v1beta1.GetDeployJobsStatusResponse.unknown_dependencies:type_name -> raystack.optimus.core.v1beta1.GetDeployJobsStatusResponse.UnknownDependenciesEntry + 25, // 36: raystack.optimus.core.v1beta1.GetJobSpecificationsResponse.jobs:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 42, // 37: raystack.optimus.core.v1beta1.GetJobSpecificationsResponse.job_specification_responses:type_name -> raystack.optimus.core.v1beta1.JobSpecificationResponse + 25, // 38: raystack.optimus.core.v1beta1.JobSpecificationResponse.job:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 25, // 39: raystack.optimus.core.v1beta1.ReplaceAllJobSpecificationsRequest.jobs:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 71, // 40: raystack.optimus.core.v1beta1.ReplaceAllJobSpecificationsResponse.log_status:type_name -> raystack.optimus.core.v1beta1.Log + 47, // 41: raystack.optimus.core.v1beta1.GetJobTaskResponse.task:type_name -> raystack.optimus.core.v1beta1.JobTask + 68, // 42: raystack.optimus.core.v1beta1.JobTask.destination:type_name -> raystack.optimus.core.v1beta1.JobTask.Destination + 69, // 43: raystack.optimus.core.v1beta1.JobTask.dependencies:type_name -> raystack.optimus.core.v1beta1.JobTask.Dependency + 72, // 44: raystack.optimus.core.v1beta1.GetWindowRequest.scheduled_at:type_name -> google.protobuf.Timestamp + 72, // 45: raystack.optimus.core.v1beta1.GetWindowResponse.start:type_name -> google.protobuf.Timestamp + 72, // 46: raystack.optimus.core.v1beta1.GetWindowResponse.end:type_name -> google.protobuf.Timestamp + 0, // 47: raystack.optimus.core.v1beta1.UpdateJobsStateRequest.state:type_name -> raystack.optimus.core.v1beta1.JobState + 70, // 48: raystack.optimus.core.v1beta1.SyncJobsStateRequest.job_states:type_name -> raystack.optimus.core.v1beta1.SyncJobsStateRequest.JobStatePair + 25, // 49: raystack.optimus.core.v1beta1.JobInspectResponse.BasicInfoSection.job:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 71, // 50: raystack.optimus.core.v1beta1.JobInspectResponse.BasicInfoSection.notice:type_name -> raystack.optimus.core.v1beta1.Log + 9, // 51: raystack.optimus.core.v1beta1.JobInspectResponse.JobDependency.runs:type_name -> raystack.optimus.core.v1beta1.JobRun + 55, // 52: raystack.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.external_dependency:type_name -> raystack.optimus.core.v1beta1.JobInspectResponse.JobDependency + 55, // 53: raystack.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.internal_dependency:type_name -> raystack.optimus.core.v1beta1.JobInspectResponse.JobDependency + 27, // 54: raystack.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.http_dependency:type_name -> raystack.optimus.core.v1beta1.HttpDependency + 58, // 55: raystack.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.unknown_dependencies:type_name -> raystack.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.UnknownDependencies + 71, // 56: raystack.optimus.core.v1beta1.JobInspectResponse.UpstreamSection.notice:type_name -> raystack.optimus.core.v1beta1.Log + 55, // 57: raystack.optimus.core.v1beta1.JobInspectResponse.DownstreamSection.downstream_jobs:type_name -> raystack.optimus.core.v1beta1.JobInspectResponse.JobDependency + 71, // 58: raystack.optimus.core.v1beta1.JobInspectResponse.DownstreamSection.notice:type_name -> raystack.optimus.core.v1beta1.Log + 62, // 59: raystack.optimus.core.v1beta1.JobSpecification.Behavior.retry:type_name -> raystack.optimus.core.v1beta1.JobSpecification.Behavior.Retry + 63, // 60: raystack.optimus.core.v1beta1.JobSpecification.Behavior.notify:type_name -> raystack.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers + 74, // 61: raystack.optimus.core.v1beta1.JobSpecification.Behavior.Retry.delay:type_name -> google.protobuf.Duration + 1, // 62: raystack.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers.on:type_name -> raystack.optimus.core.v1beta1.JobEvent.Type + 64, // 63: raystack.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers.config:type_name -> raystack.optimus.core.v1beta1.JobSpecification.Behavior.Notifiers.ConfigEntry + 0, // 64: raystack.optimus.core.v1beta1.SyncJobsStateRequest.JobStatePair.state:type_name -> raystack.optimus.core.v1beta1.JobState + 2, // 65: raystack.optimus.core.v1beta1.JobSpecificationService.DeployJobSpecification:input_type -> raystack.optimus.core.v1beta1.DeployJobSpecificationRequest + 8, // 66: raystack.optimus.core.v1beta1.JobSpecificationService.JobInspect:input_type -> raystack.optimus.core.v1beta1.JobInspectRequest + 11, // 67: raystack.optimus.core.v1beta1.JobSpecificationService.CreateJobSpecification:input_type -> raystack.optimus.core.v1beta1.CreateJobSpecificationRequest + 4, // 68: raystack.optimus.core.v1beta1.JobSpecificationService.AddJobSpecifications:input_type -> raystack.optimus.core.v1beta1.AddJobSpecificationsRequest + 6, // 69: raystack.optimus.core.v1beta1.JobSpecificationService.UpdateJobSpecifications:input_type -> raystack.optimus.core.v1beta1.UpdateJobSpecificationsRequest + 13, // 70: raystack.optimus.core.v1beta1.JobSpecificationService.GetJobSpecification:input_type -> raystack.optimus.core.v1beta1.GetJobSpecificationRequest + 40, // 71: raystack.optimus.core.v1beta1.JobSpecificationService.GetJobSpecifications:input_type -> raystack.optimus.core.v1beta1.GetJobSpecificationsRequest + 15, // 72: raystack.optimus.core.v1beta1.JobSpecificationService.DeleteJobSpecification:input_type -> raystack.optimus.core.v1beta1.DeleteJobSpecificationRequest + 17, // 73: raystack.optimus.core.v1beta1.JobSpecificationService.ChangeJobNamespace:input_type -> raystack.optimus.core.v1beta1.ChangeJobNamespaceRequest + 19, // 74: raystack.optimus.core.v1beta1.JobSpecificationService.ListJobSpecification:input_type -> raystack.optimus.core.v1beta1.ListJobSpecificationRequest + 21, // 75: raystack.optimus.core.v1beta1.JobSpecificationService.CheckJobSpecification:input_type -> raystack.optimus.core.v1beta1.CheckJobSpecificationRequest + 23, // 76: raystack.optimus.core.v1beta1.JobSpecificationService.CheckJobSpecifications:input_type -> raystack.optimus.core.v1beta1.CheckJobSpecificationsRequest + 35, // 77: raystack.optimus.core.v1beta1.JobSpecificationService.RefreshJobs:input_type -> raystack.optimus.core.v1beta1.RefreshJobsRequest + 37, // 78: raystack.optimus.core.v1beta1.JobSpecificationService.GetDeployJobsStatus:input_type -> raystack.optimus.core.v1beta1.GetDeployJobsStatusRequest + 43, // 79: raystack.optimus.core.v1beta1.JobSpecificationService.ReplaceAllJobSpecifications:input_type -> raystack.optimus.core.v1beta1.ReplaceAllJobSpecificationsRequest + 45, // 80: raystack.optimus.core.v1beta1.JobSpecificationService.GetJobTask:input_type -> raystack.optimus.core.v1beta1.GetJobTaskRequest + 48, // 81: raystack.optimus.core.v1beta1.JobSpecificationService.GetWindow:input_type -> raystack.optimus.core.v1beta1.GetWindowRequest + 50, // 82: raystack.optimus.core.v1beta1.JobSpecificationService.UpdateJobsState:input_type -> raystack.optimus.core.v1beta1.UpdateJobsStateRequest + 52, // 83: raystack.optimus.core.v1beta1.JobSpecificationService.SyncJobsState:input_type -> raystack.optimus.core.v1beta1.SyncJobsStateRequest + 3, // 84: raystack.optimus.core.v1beta1.JobSpecificationService.DeployJobSpecification:output_type -> raystack.optimus.core.v1beta1.DeployJobSpecificationResponse + 10, // 85: raystack.optimus.core.v1beta1.JobSpecificationService.JobInspect:output_type -> raystack.optimus.core.v1beta1.JobInspectResponse + 12, // 86: raystack.optimus.core.v1beta1.JobSpecificationService.CreateJobSpecification:output_type -> raystack.optimus.core.v1beta1.CreateJobSpecificationResponse + 5, // 87: raystack.optimus.core.v1beta1.JobSpecificationService.AddJobSpecifications:output_type -> raystack.optimus.core.v1beta1.AddJobSpecificationsResponse + 7, // 88: raystack.optimus.core.v1beta1.JobSpecificationService.UpdateJobSpecifications:output_type -> raystack.optimus.core.v1beta1.UpdateJobSpecificationsResponse + 14, // 89: raystack.optimus.core.v1beta1.JobSpecificationService.GetJobSpecification:output_type -> raystack.optimus.core.v1beta1.GetJobSpecificationResponse + 41, // 90: raystack.optimus.core.v1beta1.JobSpecificationService.GetJobSpecifications:output_type -> raystack.optimus.core.v1beta1.GetJobSpecificationsResponse + 16, // 91: raystack.optimus.core.v1beta1.JobSpecificationService.DeleteJobSpecification:output_type -> raystack.optimus.core.v1beta1.DeleteJobSpecificationResponse + 18, // 92: raystack.optimus.core.v1beta1.JobSpecificationService.ChangeJobNamespace:output_type -> raystack.optimus.core.v1beta1.ChangeJobNamespaceResponse + 20, // 93: raystack.optimus.core.v1beta1.JobSpecificationService.ListJobSpecification:output_type -> raystack.optimus.core.v1beta1.ListJobSpecificationResponse + 22, // 94: raystack.optimus.core.v1beta1.JobSpecificationService.CheckJobSpecification:output_type -> raystack.optimus.core.v1beta1.CheckJobSpecificationResponse + 24, // 95: raystack.optimus.core.v1beta1.JobSpecificationService.CheckJobSpecifications:output_type -> raystack.optimus.core.v1beta1.CheckJobSpecificationsResponse + 36, // 96: raystack.optimus.core.v1beta1.JobSpecificationService.RefreshJobs:output_type -> raystack.optimus.core.v1beta1.RefreshJobsResponse + 38, // 97: raystack.optimus.core.v1beta1.JobSpecificationService.GetDeployJobsStatus:output_type -> raystack.optimus.core.v1beta1.GetDeployJobsStatusResponse + 44, // 98: raystack.optimus.core.v1beta1.JobSpecificationService.ReplaceAllJobSpecifications:output_type -> raystack.optimus.core.v1beta1.ReplaceAllJobSpecificationsResponse + 46, // 99: raystack.optimus.core.v1beta1.JobSpecificationService.GetJobTask:output_type -> raystack.optimus.core.v1beta1.GetJobTaskResponse + 49, // 100: raystack.optimus.core.v1beta1.JobSpecificationService.GetWindow:output_type -> raystack.optimus.core.v1beta1.GetWindowResponse + 51, // 101: raystack.optimus.core.v1beta1.JobSpecificationService.UpdateJobsState:output_type -> raystack.optimus.core.v1beta1.UpdateJobsStateResponse + 53, // 102: raystack.optimus.core.v1beta1.JobSpecificationService.SyncJobsState:output_type -> raystack.optimus.core.v1beta1.SyncJobsStateResponse + 84, // [84:103] is the sub-list for method output_type + 65, // [65:84] is the sub-list for method input_type + 65, // [65:65] is the sub-list for extension type_name + 65, // [65:65] is the sub-list for extension extendee + 0, // [0:65] is the sub-list for field type_name +} + +func init() { file_raystack_optimus_core_v1beta1_job_spec_proto_init() } +func file_raystack_optimus_core_v1beta1_job_spec_proto_init() { + if File_raystack_optimus_core_v1beta1_job_spec_proto != nil { return } - file_odpf_optimus_core_v1beta1_status_proto_init() + file_raystack_optimus_core_v1beta1_status_proto_init() if !protoimpl.UnsafeEnabled { - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeployJobSpecificationRequest); i { case 0: return &v.state @@ -4667,7 +5253,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeployJobSpecificationResponse); i { case 0: return &v.state @@ -4679,7 +5265,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddJobSpecificationsRequest); i { case 0: return &v.state @@ -4691,7 +5277,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddJobSpecificationsResponse); i { case 0: return &v.state @@ -4703,7 +5289,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateJobSpecificationsRequest); i { case 0: return &v.state @@ -4715,7 +5301,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateJobSpecificationsResponse); i { case 0: return &v.state @@ -4727,7 +5313,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobInspectRequest); i { case 0: return &v.state @@ -4739,7 +5325,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobRun); i { case 0: return &v.state @@ -4751,7 +5337,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobInspectResponse); i { case 0: return &v.state @@ -4763,7 +5349,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateJobSpecificationRequest); i { case 0: return &v.state @@ -4775,7 +5361,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateJobSpecificationResponse); i { case 0: return &v.state @@ -4787,7 +5373,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetJobSpecificationRequest); i { case 0: return &v.state @@ -4799,7 +5385,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetJobSpecificationResponse); i { case 0: return &v.state @@ -4811,7 +5397,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteJobSpecificationRequest); i { case 0: return &v.state @@ -4823,7 +5409,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteJobSpecificationResponse); i { case 0: return &v.state @@ -4835,7 +5421,31 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeJobNamespaceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeJobNamespaceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListJobSpecificationRequest); i { case 0: return &v.state @@ -4847,7 +5457,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListJobSpecificationResponse); i { case 0: return &v.state @@ -4859,7 +5469,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckJobSpecificationRequest); i { case 0: return &v.state @@ -4871,7 +5481,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckJobSpecificationResponse); i { case 0: return &v.state @@ -4883,7 +5493,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckJobSpecificationsRequest); i { case 0: return &v.state @@ -4895,7 +5505,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckJobSpecificationsResponse); i { case 0: return &v.state @@ -4907,7 +5517,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobSpecification); i { case 0: return &v.state @@ -4919,7 +5529,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobDependency); i { case 0: return &v.state @@ -4931,7 +5541,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HttpDependency); i { case 0: return &v.state @@ -4943,7 +5553,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobSpecHook); i { case 0: return &v.state @@ -4955,7 +5565,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobConfigItem); i { case 0: return &v.state @@ -4967,7 +5577,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobEvent); i { case 0: return &v.state @@ -4979,7 +5589,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobMetadata); i { case 0: return &v.state @@ -4991,7 +5601,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobSpecMetadataResource); i { case 0: return &v.state @@ -5003,7 +5613,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobSpecMetadataResourceConfig); i { case 0: return &v.state @@ -5015,7 +5625,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobSpecMetadataAirflow); i { case 0: return &v.state @@ -5027,7 +5637,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RefreshJobsRequest); i { case 0: return &v.state @@ -5039,7 +5649,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RefreshJobsResponse); i { case 0: return &v.state @@ -5051,7 +5661,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetDeployJobsStatusRequest); i { case 0: return &v.state @@ -5063,7 +5673,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetDeployJobsStatusResponse); i { case 0: return &v.state @@ -5075,7 +5685,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeployJobFailure); i { case 0: return &v.state @@ -5087,7 +5697,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetJobSpecificationsRequest); i { case 0: return &v.state @@ -5099,7 +5709,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetJobSpecificationsResponse); i { case 0: return &v.state @@ -5111,7 +5721,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobSpecificationResponse); i { case 0: return &v.state @@ -5123,7 +5733,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReplaceAllJobSpecificationsRequest); i { case 0: return &v.state @@ -5135,7 +5745,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReplaceAllJobSpecificationsResponse); i { case 0: return &v.state @@ -5147,7 +5757,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetJobTaskRequest); i { case 0: return &v.state @@ -5159,7 +5769,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetJobTaskResponse); i { case 0: return &v.state @@ -5171,7 +5781,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobTask); i { case 0: return &v.state @@ -5183,7 +5793,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetWindowRequest); i { case 0: return &v.state @@ -5195,7 +5805,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetWindowResponse); i { case 0: return &v.state @@ -5207,7 +5817,55 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateJobsStateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateJobsStateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncJobsStateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncJobsStateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobInspectResponse_BasicInfoSection); i { case 0: return &v.state @@ -5219,7 +5877,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobInspectResponse_JobDependency); i { case 0: return &v.state @@ -5231,7 +5889,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobInspectResponse_UpstreamSection); i { case 0: return &v.state @@ -5243,7 +5901,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobInspectResponse_DownstreamSection); i { case 0: return &v.state @@ -5255,7 +5913,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobInspectResponse_UpstreamSection_UnknownDependencies); i { case 0: return &v.state @@ -5267,7 +5925,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobSpecification_Behavior); i { case 0: return &v.state @@ -5279,7 +5937,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobSpecification_Behavior_Retry); i { case 0: return &v.state @@ -5291,7 +5949,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobSpecification_Behavior_Notifiers); i { case 0: return &v.state @@ -5303,7 +5961,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobTask_Destination); i { case 0: return &v.state @@ -5315,7 +5973,7 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } - file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobTask_Dependency); i { case 0: return &v.state @@ -5327,24 +5985,36 @@ func file_odpf_optimus_core_v1beta1_job_spec_proto_init() { return nil } } + file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncJobsStateRequest_JobStatePair); 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_odpf_optimus_core_v1beta1_job_spec_proto_rawDesc, - NumEnums: 1, - NumMessages: 62, + RawDescriptor: file_raystack_optimus_core_v1beta1_job_spec_proto_rawDesc, + NumEnums: 2, + NumMessages: 69, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_odpf_optimus_core_v1beta1_job_spec_proto_goTypes, - DependencyIndexes: file_odpf_optimus_core_v1beta1_job_spec_proto_depIdxs, - EnumInfos: file_odpf_optimus_core_v1beta1_job_spec_proto_enumTypes, - MessageInfos: file_odpf_optimus_core_v1beta1_job_spec_proto_msgTypes, + GoTypes: file_raystack_optimus_core_v1beta1_job_spec_proto_goTypes, + DependencyIndexes: file_raystack_optimus_core_v1beta1_job_spec_proto_depIdxs, + EnumInfos: file_raystack_optimus_core_v1beta1_job_spec_proto_enumTypes, + MessageInfos: file_raystack_optimus_core_v1beta1_job_spec_proto_msgTypes, }.Build() - File_odpf_optimus_core_v1beta1_job_spec_proto = out.File - file_odpf_optimus_core_v1beta1_job_spec_proto_rawDesc = nil - file_odpf_optimus_core_v1beta1_job_spec_proto_goTypes = nil - file_odpf_optimus_core_v1beta1_job_spec_proto_depIdxs = nil + File_raystack_optimus_core_v1beta1_job_spec_proto = out.File + file_raystack_optimus_core_v1beta1_job_spec_proto_rawDesc = nil + file_raystack_optimus_core_v1beta1_job_spec_proto_goTypes = nil + file_raystack_optimus_core_v1beta1_job_spec_proto_depIdxs = nil } diff --git a/protos/odpf/optimus/core/v1beta1/job_spec.pb.gw.go b/protos/raystack/optimus/core/v1beta1/job_spec.pb.gw.go similarity index 74% rename from protos/odpf/optimus/core/v1beta1/job_spec.pb.gw.go rename to protos/raystack/optimus/core/v1beta1/job_spec.pb.gw.go index 1215cd1787..5c05a89515 100644 --- a/protos/odpf/optimus/core/v1beta1/job_spec.pb.gw.go +++ b/protos/raystack/optimus/core/v1beta1/job_spec.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: odpf/optimus/core/v1beta1/job_spec.proto +// source: raystack/optimus/core/v1beta1/job_spec.proto /* Package optimus is a reverse proxy. @@ -621,6 +621,74 @@ func local_request_JobSpecificationService_DeleteJobSpecification_0(ctx context. } +func request_JobSpecificationService_ChangeJobNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client JobSpecificationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ChangeJobNamespaceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + msg, err := client.ChangeJobNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_JobSpecificationService_ChangeJobNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server JobSpecificationServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ChangeJobNamespaceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + msg, err := server.ChangeJobNamespace(ctx, &protoReq) + return msg, metadata, err + +} + func request_JobSpecificationService_ListJobSpecification_0(ctx context.Context, marshaler runtime.Marshaler, client JobSpecificationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ListJobSpecificationRequest var metadata runtime.ServerMetadata @@ -891,6 +959,182 @@ func local_request_JobSpecificationService_GetWindow_0(ctx context.Context, mars } +func request_JobSpecificationService_UpdateJobsState_0(ctx context.Context, marshaler runtime.Marshaler, client JobSpecificationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateJobsStateRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + val, ok = pathParams["namespace_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace_name") + } + + protoReq.NamespaceName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace_name", err) + } + + msg, err := client.UpdateJobsState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_JobSpecificationService_UpdateJobsState_0(ctx context.Context, marshaler runtime.Marshaler, server JobSpecificationServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateJobsStateRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + val, ok = pathParams["namespace_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace_name") + } + + protoReq.NamespaceName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace_name", err) + } + + msg, err := server.UpdateJobsState(ctx, &protoReq) + return msg, metadata, err + +} + +func request_JobSpecificationService_SyncJobsState_0(ctx context.Context, marshaler runtime.Marshaler, client JobSpecificationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SyncJobsStateRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + val, ok = pathParams["namespace_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace_name") + } + + protoReq.NamespaceName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace_name", err) + } + + msg, err := client.SyncJobsState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_JobSpecificationService_SyncJobsState_0(ctx context.Context, marshaler runtime.Marshaler, server JobSpecificationServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SyncJobsStateRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + val, ok = pathParams["namespace_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace_name") + } + + protoReq.NamespaceName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace_name", err) + } + + msg, err := server.SyncJobsState(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterJobSpecificationServiceHandlerServer registers the http handlers for service JobSpecificationService to "mux". // UnaryRPC :call JobSpecificationServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -903,7 +1147,7 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/JobInspect", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/inspect")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/JobInspect", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/inspect")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -926,7 +1170,7 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/CreateJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/CreateJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -949,7 +1193,7 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/AddJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/jobs")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/AddJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/jobs")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -972,7 +1216,7 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/UpdateJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/jobs")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/UpdateJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/jobs")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -995,7 +1239,7 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1018,7 +1262,7 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/jobs")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/jobs")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1041,7 +1285,7 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/DeleteJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/DeleteJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1058,13 +1302,36 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt }) + mux.Handle("POST", pattern_JobSpecificationService_ChangeJobNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/ChangeJobNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/change-job-namespace")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_JobSpecificationService_ChangeJobNamespace_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_JobSpecificationService_ChangeJobNamespace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_JobSpecificationService_ListJobSpecification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/ListJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/ListJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1087,7 +1354,7 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/CheckJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/check")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/CheckJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/check")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1110,7 +1377,7 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobTask", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}/task")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobTask", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}/task")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1133,7 +1400,7 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetWindow", runtime.WithHTTPPathPattern("/v1beta1/window")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetWindow", runtime.WithHTTPPathPattern("/v1beta1/window")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1150,6 +1417,52 @@ func RegisterJobSpecificationServiceHandlerServer(ctx context.Context, mux *runt }) + mux.Handle("PATCH", pattern_JobSpecificationService_UpdateJobsState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/UpdateJobsState", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/update-job-state")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_JobSpecificationService_UpdateJobsState_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_JobSpecificationService_UpdateJobsState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_JobSpecificationService_SyncJobsState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/SyncJobsState", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/sync-job-state")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_JobSpecificationService_SyncJobsState_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_JobSpecificationService_SyncJobsState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1195,7 +1508,7 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/JobInspect", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/inspect")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/JobInspect", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/inspect")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1215,7 +1528,7 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/CreateJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/CreateJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1235,7 +1548,7 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/AddJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/jobs")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/AddJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/jobs")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1255,7 +1568,7 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/UpdateJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/jobs")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/UpdateJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/jobs")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1275,7 +1588,7 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1295,7 +1608,7 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/jobs")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobSpecifications", runtime.WithHTTPPathPattern("/v1beta1/jobs")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1315,7 +1628,7 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/DeleteJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/DeleteJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1331,11 +1644,31 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt }) + mux.Handle("POST", pattern_JobSpecificationService_ChangeJobNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/ChangeJobNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/change-job-namespace")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_JobSpecificationService_ChangeJobNamespace_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_JobSpecificationService_ChangeJobNamespace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_JobSpecificationService_ListJobSpecification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/ListJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/ListJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1355,7 +1688,7 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/CheckJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/check")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/CheckJobSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/job/check")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1375,7 +1708,7 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobTask", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}/task")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobTask", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/job/{job_name}/task")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1395,7 +1728,7 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetWindow", runtime.WithHTTPPathPattern("/v1beta1/window")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetWindow", runtime.WithHTTPPathPattern("/v1beta1/window")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1411,6 +1744,46 @@ func RegisterJobSpecificationServiceHandlerClient(ctx context.Context, mux *runt }) + mux.Handle("PATCH", pattern_JobSpecificationService_UpdateJobsState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/UpdateJobsState", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/update-job-state")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_JobSpecificationService_UpdateJobsState_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_JobSpecificationService_UpdateJobsState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_JobSpecificationService_SyncJobsState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.JobSpecificationService/SyncJobsState", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/sync-job-state")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_JobSpecificationService_SyncJobsState_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_JobSpecificationService_SyncJobsState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1429,6 +1802,8 @@ var ( pattern_JobSpecificationService_DeleteJobSpecification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"v1beta1", "project", "project_name", "namespace", "namespace_name", "job", "job_name"}, "")) + pattern_JobSpecificationService_ChangeJobNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "project", "project_name", "change-job-namespace"}, "")) + pattern_JobSpecificationService_ListJobSpecification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"v1beta1", "project", "project_name", "namespace", "namespace_name", "job"}, "")) pattern_JobSpecificationService_CheckJobSpecification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1beta1", "project", "project_name", "job", "check"}, "")) @@ -1436,6 +1811,10 @@ var ( pattern_JobSpecificationService_GetJobTask_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"v1beta1", "project", "project_name", "namespace", "namespace_name", "job", "job_name", "task"}, "")) pattern_JobSpecificationService_GetWindow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1beta1", "window"}, "")) + + pattern_JobSpecificationService_UpdateJobsState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"v1beta1", "project", "project_name", "namespace", "namespace_name", "update-job-state"}, "")) + + pattern_JobSpecificationService_SyncJobsState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"v1beta1", "project", "project_name", "namespace", "namespace_name", "sync-job-state"}, "")) ) var ( @@ -1453,6 +1832,8 @@ var ( forward_JobSpecificationService_DeleteJobSpecification_0 = runtime.ForwardResponseMessage + forward_JobSpecificationService_ChangeJobNamespace_0 = runtime.ForwardResponseMessage + forward_JobSpecificationService_ListJobSpecification_0 = runtime.ForwardResponseMessage forward_JobSpecificationService_CheckJobSpecification_0 = runtime.ForwardResponseMessage @@ -1460,4 +1841,8 @@ var ( forward_JobSpecificationService_GetJobTask_0 = runtime.ForwardResponseMessage forward_JobSpecificationService_GetWindow_0 = runtime.ForwardResponseMessage + + forward_JobSpecificationService_UpdateJobsState_0 = runtime.ForwardResponseMessage + + forward_JobSpecificationService_SyncJobsState_0 = runtime.ForwardResponseMessage ) diff --git a/protos/odpf/optimus/core/v1beta1/job_spec.swagger.json b/protos/raystack/optimus/core/v1beta1/job_spec.swagger.json similarity index 83% rename from protos/odpf/optimus/core/v1beta1/job_spec.swagger.json rename to protos/raystack/optimus/core/v1beta1/job_spec.swagger.json index 24f606e5e2..75e5912731 100644 --- a/protos/odpf/optimus/core/v1beta1/job_spec.swagger.json +++ b/protos/raystack/optimus/core/v1beta1/job_spec.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/core/v1beta1/job_spec.proto", + "title": "raystack/optimus/core/v1beta1/job_spec.proto", "version": "0.1" }, "tags": [ @@ -11,15 +11,9 @@ ], "host": "127.0.0.1:9100", "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { "/v1beta1/jobs": { "get": { @@ -65,9 +59,55 @@ "type": "string" } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] + } + }, + "/v1beta1/project/{projectName}/change-job-namespace": { + "post": { + "summary": "ChangeJobNamespace move a job spec from one namespace to another", + "operationId": "JobSpecificationService_ChangeJobNamespace", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1ChangeJobNamespaceResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "projectName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "namespaceName": { + "type": "string" + }, + "jobName": { + "type": "string" + }, + "newNamespaceName": { + "type": "string" + } + } + } + } + ], + "tags": ["JobSpecificationService"] } }, "/v1beta1/project/{projectName}/job/check": { @@ -96,9 +136,7 @@ "type": "string" } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] } }, "/v1beta1/project/{projectName}/namespace/{namespaceName}/job": { @@ -133,9 +171,7 @@ "type": "string" } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] }, "post": { "summary": "CreateJobSpecification registers a new job for a namespace which belongs to a project", @@ -181,9 +217,7 @@ } } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] } }, "/v1beta1/project/{projectName}/namespace/{namespaceName}/job/inspect": { @@ -238,9 +272,7 @@ } } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] } }, "/v1beta1/project/{projectName}/namespace/{namespaceName}/job/{jobName}": { @@ -281,9 +313,7 @@ "type": "string" } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] }, "delete": { "summary": "DeleteJobSpecification deletes a job spec of a namespace", @@ -334,9 +364,7 @@ "type": "boolean" } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] } }, "/v1beta1/project/{projectName}/namespace/{namespaceName}/job/{jobName}/task": { @@ -377,9 +405,7 @@ "type": "string" } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] } }, "/v1beta1/project/{projectName}/namespace/{namespaceName}/jobs": { @@ -430,9 +456,7 @@ } } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] }, "put": { "summary": "UpdateJobSpecifications modify jobs for a namespace which belongs to the given project", @@ -481,9 +505,115 @@ } } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] + } + }, + "/v1beta1/project/{projectName}/namespace/{namespaceName}/sync-job-state": { + "patch": { + "summary": "SyncJobsState enable / disable job on scheuler", + "operationId": "JobSpecificationService_SyncJobsState", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1SyncJobsStateResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "projectName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "namespaceName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "jobStates": { + "type": "array", + "items": { + "$ref": "#/definitions/SyncJobsStateRequestJobStatePair" + } + } + } + } + } + ], + "tags": ["JobSpecificationService"] + } + }, + "/v1beta1/project/{projectName}/namespace/{namespaceName}/update-job-state": { + "patch": { + "summary": "UpdateJobState enable / disable job on scheuler", + "operationId": "JobSpecificationService_UpdateJobsState", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1UpdateJobsStateResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "projectName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "namespaceName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "remark": { + "type": "string" + }, + "state": { + "$ref": "#/definitions/v1beta1JobState" + }, + "jobNames": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ], + "tags": ["JobSpecificationService"] } }, "/v1beta1/window": { @@ -538,9 +668,7 @@ "format": "int32" } ], - "tags": [ - "JobSpecificationService" - ] + "tags": ["JobSpecificationService"] } } }, @@ -690,6 +818,17 @@ } } }, + "SyncJobsStateRequestJobStatePair": { + "type": "object", + "properties": { + "jobName": { + "type": "string" + }, + "state": { + "$ref": "#/definitions/v1beta1JobState" + } + } + }, "UpstreamSectionUnknownDependencies": { "type": "object", "properties": { @@ -756,6 +895,9 @@ } } }, + "v1beta1ChangeJobNamespaceResponse": { + "type": "object" + }, "v1beta1CheckJobSpecificationResponse": { "type": "object", "properties": { @@ -1161,6 +1303,15 @@ } } }, + "v1beta1JobState": { + "type": "string", + "enum": [ + "JOB_STATE_UNSPECIFIED", + "JOB_STATE_ENABLED", + "JOB_STATE_DISABLED" + ], + "default": "JOB_STATE_UNSPECIFIED" + }, "v1beta1JobTask": { "type": "object", "properties": { @@ -1236,6 +1387,9 @@ } } }, + "v1beta1SyncJobsStateResponse": { + "type": "object" + }, "v1beta1UpdateJobSpecificationsResponse": { "type": "object", "properties": { @@ -1243,6 +1397,9 @@ "type": "string" } } + }, + "v1beta1UpdateJobsStateResponse": { + "type": "object" } }, "externalDocs": { diff --git a/protos/odpf/optimus/core/v1beta1/job_spec_grpc.pb.go b/protos/raystack/optimus/core/v1beta1/job_spec_grpc.pb.go similarity index 79% rename from protos/odpf/optimus/core/v1beta1/job_spec_grpc.pb.go rename to protos/raystack/optimus/core/v1beta1/job_spec_grpc.pb.go index deb6fec560..0b9d121034 100644 --- a/protos/odpf/optimus/core/v1beta1/job_spec_grpc.pb.go +++ b/protos/raystack/optimus/core/v1beta1/job_spec_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: odpf/optimus/core/v1beta1/job_spec.proto +// source: raystack/optimus/core/v1beta1/job_spec.proto package optimus @@ -42,6 +42,8 @@ type JobSpecificationServiceClient interface { GetJobSpecifications(ctx context.Context, in *GetJobSpecificationsRequest, opts ...grpc.CallOption) (*GetJobSpecificationsResponse, error) // DeleteJobSpecification deletes a job spec of a namespace DeleteJobSpecification(ctx context.Context, in *DeleteJobSpecificationRequest, opts ...grpc.CallOption) (*DeleteJobSpecificationResponse, error) + // ChangeJobNamespace move a job spec from one namespace to another + ChangeJobNamespace(ctx context.Context, in *ChangeJobNamespaceRequest, opts ...grpc.CallOption) (*ChangeJobNamespaceResponse, error) // ListJobSpecification returns list of jobs created in a project ListJobSpecification(ctx context.Context, in *ListJobSpecificationRequest, opts ...grpc.CallOption) (*ListJobSpecificationResponse, error) // CheckJobSpecification checks if a job specification is valid @@ -61,6 +63,10 @@ type JobSpecificationServiceClient interface { // GetWindow provides the start and end dates provided a scheduled date // of the execution window GetWindow(ctx context.Context, in *GetWindowRequest, opts ...grpc.CallOption) (*GetWindowResponse, error) + // UpdateJobState enable / disable job on scheuler + UpdateJobsState(ctx context.Context, in *UpdateJobsStateRequest, opts ...grpc.CallOption) (*UpdateJobsStateResponse, error) + // SyncJobsState enable / disable job on scheuler + SyncJobsState(ctx context.Context, in *SyncJobsStateRequest, opts ...grpc.CallOption) (*SyncJobsStateResponse, error) } type jobSpecificationServiceClient struct { @@ -72,7 +78,7 @@ func NewJobSpecificationServiceClient(cc grpc.ClientConnInterface) JobSpecificat } func (c *jobSpecificationServiceClient) DeployJobSpecification(ctx context.Context, opts ...grpc.CallOption) (JobSpecificationService_DeployJobSpecificationClient, error) { - stream, err := c.cc.NewStream(ctx, &JobSpecificationService_ServiceDesc.Streams[0], "/odpf.optimus.core.v1beta1.JobSpecificationService/DeployJobSpecification", opts...) + stream, err := c.cc.NewStream(ctx, &JobSpecificationService_ServiceDesc.Streams[0], "/raystack.optimus.core.v1beta1.JobSpecificationService/DeployJobSpecification", opts...) if err != nil { return nil, err } @@ -104,7 +110,7 @@ func (x *jobSpecificationServiceDeployJobSpecificationClient) Recv() (*DeployJob func (c *jobSpecificationServiceClient) JobInspect(ctx context.Context, in *JobInspectRequest, opts ...grpc.CallOption) (*JobInspectResponse, error) { out := new(JobInspectResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/JobInspect", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/JobInspect", in, out, opts...) if err != nil { return nil, err } @@ -113,7 +119,7 @@ func (c *jobSpecificationServiceClient) JobInspect(ctx context.Context, in *JobI func (c *jobSpecificationServiceClient) CreateJobSpecification(ctx context.Context, in *CreateJobSpecificationRequest, opts ...grpc.CallOption) (*CreateJobSpecificationResponse, error) { out := new(CreateJobSpecificationResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/CreateJobSpecification", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/CreateJobSpecification", in, out, opts...) if err != nil { return nil, err } @@ -122,7 +128,7 @@ func (c *jobSpecificationServiceClient) CreateJobSpecification(ctx context.Conte func (c *jobSpecificationServiceClient) AddJobSpecifications(ctx context.Context, in *AddJobSpecificationsRequest, opts ...grpc.CallOption) (*AddJobSpecificationsResponse, error) { out := new(AddJobSpecificationsResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/AddJobSpecifications", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/AddJobSpecifications", in, out, opts...) if err != nil { return nil, err } @@ -131,7 +137,7 @@ func (c *jobSpecificationServiceClient) AddJobSpecifications(ctx context.Context func (c *jobSpecificationServiceClient) UpdateJobSpecifications(ctx context.Context, in *UpdateJobSpecificationsRequest, opts ...grpc.CallOption) (*UpdateJobSpecificationsResponse, error) { out := new(UpdateJobSpecificationsResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/UpdateJobSpecifications", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/UpdateJobSpecifications", in, out, opts...) if err != nil { return nil, err } @@ -140,7 +146,7 @@ func (c *jobSpecificationServiceClient) UpdateJobSpecifications(ctx context.Cont func (c *jobSpecificationServiceClient) GetJobSpecification(ctx context.Context, in *GetJobSpecificationRequest, opts ...grpc.CallOption) (*GetJobSpecificationResponse, error) { out := new(GetJobSpecificationResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobSpecification", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobSpecification", in, out, opts...) if err != nil { return nil, err } @@ -149,7 +155,7 @@ func (c *jobSpecificationServiceClient) GetJobSpecification(ctx context.Context, func (c *jobSpecificationServiceClient) GetJobSpecifications(ctx context.Context, in *GetJobSpecificationsRequest, opts ...grpc.CallOption) (*GetJobSpecificationsResponse, error) { out := new(GetJobSpecificationsResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobSpecifications", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobSpecifications", in, out, opts...) if err != nil { return nil, err } @@ -158,7 +164,16 @@ func (c *jobSpecificationServiceClient) GetJobSpecifications(ctx context.Context func (c *jobSpecificationServiceClient) DeleteJobSpecification(ctx context.Context, in *DeleteJobSpecificationRequest, opts ...grpc.CallOption) (*DeleteJobSpecificationResponse, error) { out := new(DeleteJobSpecificationResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/DeleteJobSpecification", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/DeleteJobSpecification", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobSpecificationServiceClient) ChangeJobNamespace(ctx context.Context, in *ChangeJobNamespaceRequest, opts ...grpc.CallOption) (*ChangeJobNamespaceResponse, error) { + out := new(ChangeJobNamespaceResponse) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/ChangeJobNamespace", in, out, opts...) if err != nil { return nil, err } @@ -167,7 +182,7 @@ func (c *jobSpecificationServiceClient) DeleteJobSpecification(ctx context.Conte func (c *jobSpecificationServiceClient) ListJobSpecification(ctx context.Context, in *ListJobSpecificationRequest, opts ...grpc.CallOption) (*ListJobSpecificationResponse, error) { out := new(ListJobSpecificationResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/ListJobSpecification", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/ListJobSpecification", in, out, opts...) if err != nil { return nil, err } @@ -176,7 +191,7 @@ func (c *jobSpecificationServiceClient) ListJobSpecification(ctx context.Context func (c *jobSpecificationServiceClient) CheckJobSpecification(ctx context.Context, in *CheckJobSpecificationRequest, opts ...grpc.CallOption) (*CheckJobSpecificationResponse, error) { out := new(CheckJobSpecificationResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/CheckJobSpecification", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/CheckJobSpecification", in, out, opts...) if err != nil { return nil, err } @@ -184,7 +199,7 @@ func (c *jobSpecificationServiceClient) CheckJobSpecification(ctx context.Contex } func (c *jobSpecificationServiceClient) CheckJobSpecifications(ctx context.Context, in *CheckJobSpecificationsRequest, opts ...grpc.CallOption) (JobSpecificationService_CheckJobSpecificationsClient, error) { - stream, err := c.cc.NewStream(ctx, &JobSpecificationService_ServiceDesc.Streams[1], "/odpf.optimus.core.v1beta1.JobSpecificationService/CheckJobSpecifications", opts...) + stream, err := c.cc.NewStream(ctx, &JobSpecificationService_ServiceDesc.Streams[1], "/raystack.optimus.core.v1beta1.JobSpecificationService/CheckJobSpecifications", opts...) if err != nil { return nil, err } @@ -216,7 +231,7 @@ func (x *jobSpecificationServiceCheckJobSpecificationsClient) Recv() (*CheckJobS } func (c *jobSpecificationServiceClient) RefreshJobs(ctx context.Context, in *RefreshJobsRequest, opts ...grpc.CallOption) (JobSpecificationService_RefreshJobsClient, error) { - stream, err := c.cc.NewStream(ctx, &JobSpecificationService_ServiceDesc.Streams[2], "/odpf.optimus.core.v1beta1.JobSpecificationService/RefreshJobs", opts...) + stream, err := c.cc.NewStream(ctx, &JobSpecificationService_ServiceDesc.Streams[2], "/raystack.optimus.core.v1beta1.JobSpecificationService/RefreshJobs", opts...) if err != nil { return nil, err } @@ -249,7 +264,7 @@ func (x *jobSpecificationServiceRefreshJobsClient) Recv() (*RefreshJobsResponse, func (c *jobSpecificationServiceClient) GetDeployJobsStatus(ctx context.Context, in *GetDeployJobsStatusRequest, opts ...grpc.CallOption) (*GetDeployJobsStatusResponse, error) { out := new(GetDeployJobsStatusResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetDeployJobsStatus", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetDeployJobsStatus", in, out, opts...) if err != nil { return nil, err } @@ -257,7 +272,7 @@ func (c *jobSpecificationServiceClient) GetDeployJobsStatus(ctx context.Context, } func (c *jobSpecificationServiceClient) ReplaceAllJobSpecifications(ctx context.Context, opts ...grpc.CallOption) (JobSpecificationService_ReplaceAllJobSpecificationsClient, error) { - stream, err := c.cc.NewStream(ctx, &JobSpecificationService_ServiceDesc.Streams[3], "/odpf.optimus.core.v1beta1.JobSpecificationService/ReplaceAllJobSpecifications", opts...) + stream, err := c.cc.NewStream(ctx, &JobSpecificationService_ServiceDesc.Streams[3], "/raystack.optimus.core.v1beta1.JobSpecificationService/ReplaceAllJobSpecifications", opts...) if err != nil { return nil, err } @@ -289,7 +304,7 @@ func (x *jobSpecificationServiceReplaceAllJobSpecificationsClient) Recv() (*Repl func (c *jobSpecificationServiceClient) GetJobTask(ctx context.Context, in *GetJobTaskRequest, opts ...grpc.CallOption) (*GetJobTaskResponse, error) { out := new(GetJobTaskResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobTask", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobTask", in, out, opts...) if err != nil { return nil, err } @@ -298,7 +313,25 @@ func (c *jobSpecificationServiceClient) GetJobTask(ctx context.Context, in *GetJ func (c *jobSpecificationServiceClient) GetWindow(ctx context.Context, in *GetWindowRequest, opts ...grpc.CallOption) (*GetWindowResponse, error) { out := new(GetWindowResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.JobSpecificationService/GetWindow", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/GetWindow", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobSpecificationServiceClient) UpdateJobsState(ctx context.Context, in *UpdateJobsStateRequest, opts ...grpc.CallOption) (*UpdateJobsStateResponse, error) { + out := new(UpdateJobsStateResponse) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/UpdateJobsState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobSpecificationServiceClient) SyncJobsState(ctx context.Context, in *SyncJobsStateRequest, opts ...grpc.CallOption) (*SyncJobsStateResponse, error) { + out := new(SyncJobsStateResponse) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.JobSpecificationService/SyncJobsState", in, out, opts...) if err != nil { return nil, err } @@ -329,6 +362,8 @@ type JobSpecificationServiceServer interface { GetJobSpecifications(context.Context, *GetJobSpecificationsRequest) (*GetJobSpecificationsResponse, error) // DeleteJobSpecification deletes a job spec of a namespace DeleteJobSpecification(context.Context, *DeleteJobSpecificationRequest) (*DeleteJobSpecificationResponse, error) + // ChangeJobNamespace move a job spec from one namespace to another + ChangeJobNamespace(context.Context, *ChangeJobNamespaceRequest) (*ChangeJobNamespaceResponse, error) // ListJobSpecification returns list of jobs created in a project ListJobSpecification(context.Context, *ListJobSpecificationRequest) (*ListJobSpecificationResponse, error) // CheckJobSpecification checks if a job specification is valid @@ -348,6 +383,10 @@ type JobSpecificationServiceServer interface { // GetWindow provides the start and end dates provided a scheduled date // of the execution window GetWindow(context.Context, *GetWindowRequest) (*GetWindowResponse, error) + // UpdateJobState enable / disable job on scheuler + UpdateJobsState(context.Context, *UpdateJobsStateRequest) (*UpdateJobsStateResponse, error) + // SyncJobsState enable / disable job on scheuler + SyncJobsState(context.Context, *SyncJobsStateRequest) (*SyncJobsStateResponse, error) mustEmbedUnimplementedJobSpecificationServiceServer() } @@ -379,6 +418,9 @@ func (UnimplementedJobSpecificationServiceServer) GetJobSpecifications(context.C func (UnimplementedJobSpecificationServiceServer) DeleteJobSpecification(context.Context, *DeleteJobSpecificationRequest) (*DeleteJobSpecificationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteJobSpecification not implemented") } +func (UnimplementedJobSpecificationServiceServer) ChangeJobNamespace(context.Context, *ChangeJobNamespaceRequest) (*ChangeJobNamespaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangeJobNamespace not implemented") +} func (UnimplementedJobSpecificationServiceServer) ListJobSpecification(context.Context, *ListJobSpecificationRequest) (*ListJobSpecificationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListJobSpecification not implemented") } @@ -403,6 +445,12 @@ func (UnimplementedJobSpecificationServiceServer) GetJobTask(context.Context, *G func (UnimplementedJobSpecificationServiceServer) GetWindow(context.Context, *GetWindowRequest) (*GetWindowResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetWindow not implemented") } +func (UnimplementedJobSpecificationServiceServer) UpdateJobsState(context.Context, *UpdateJobsStateRequest) (*UpdateJobsStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateJobsState not implemented") +} +func (UnimplementedJobSpecificationServiceServer) SyncJobsState(context.Context, *SyncJobsStateRequest) (*SyncJobsStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SyncJobsState not implemented") +} func (UnimplementedJobSpecificationServiceServer) mustEmbedUnimplementedJobSpecificationServiceServer() { } @@ -453,7 +501,7 @@ func _JobSpecificationService_JobInspect_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/JobInspect", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/JobInspect", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).JobInspect(ctx, req.(*JobInspectRequest)) @@ -471,7 +519,7 @@ func _JobSpecificationService_CreateJobSpecification_Handler(srv interface{}, ct } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/CreateJobSpecification", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/CreateJobSpecification", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).CreateJobSpecification(ctx, req.(*CreateJobSpecificationRequest)) @@ -489,7 +537,7 @@ func _JobSpecificationService_AddJobSpecifications_Handler(srv interface{}, ctx } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/AddJobSpecifications", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/AddJobSpecifications", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).AddJobSpecifications(ctx, req.(*AddJobSpecificationsRequest)) @@ -507,7 +555,7 @@ func _JobSpecificationService_UpdateJobSpecifications_Handler(srv interface{}, c } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/UpdateJobSpecifications", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/UpdateJobSpecifications", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).UpdateJobSpecifications(ctx, req.(*UpdateJobSpecificationsRequest)) @@ -525,7 +573,7 @@ func _JobSpecificationService_GetJobSpecification_Handler(srv interface{}, ctx c } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobSpecification", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobSpecification", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).GetJobSpecification(ctx, req.(*GetJobSpecificationRequest)) @@ -543,7 +591,7 @@ func _JobSpecificationService_GetJobSpecifications_Handler(srv interface{}, ctx } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobSpecifications", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobSpecifications", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).GetJobSpecifications(ctx, req.(*GetJobSpecificationsRequest)) @@ -561,7 +609,7 @@ func _JobSpecificationService_DeleteJobSpecification_Handler(srv interface{}, ct } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/DeleteJobSpecification", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/DeleteJobSpecification", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).DeleteJobSpecification(ctx, req.(*DeleteJobSpecificationRequest)) @@ -569,6 +617,24 @@ func _JobSpecificationService_DeleteJobSpecification_Handler(srv interface{}, ct return interceptor(ctx, in, info, handler) } +func _JobSpecificationService_ChangeJobNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangeJobNamespaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobSpecificationServiceServer).ChangeJobNamespace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/ChangeJobNamespace", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobSpecificationServiceServer).ChangeJobNamespace(ctx, req.(*ChangeJobNamespaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _JobSpecificationService_ListJobSpecification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListJobSpecificationRequest) if err := dec(in); err != nil { @@ -579,7 +645,7 @@ func _JobSpecificationService_ListJobSpecification_Handler(srv interface{}, ctx } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/ListJobSpecification", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/ListJobSpecification", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).ListJobSpecification(ctx, req.(*ListJobSpecificationRequest)) @@ -597,7 +663,7 @@ func _JobSpecificationService_CheckJobSpecification_Handler(srv interface{}, ctx } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/CheckJobSpecification", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/CheckJobSpecification", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).CheckJobSpecification(ctx, req.(*CheckJobSpecificationRequest)) @@ -657,7 +723,7 @@ func _JobSpecificationService_GetDeployJobsStatus_Handler(srv interface{}, ctx c } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/GetDeployJobsStatus", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/GetDeployJobsStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).GetDeployJobsStatus(ctx, req.(*GetDeployJobsStatusRequest)) @@ -701,7 +767,7 @@ func _JobSpecificationService_GetJobTask_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/GetJobTask", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/GetJobTask", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).GetJobTask(ctx, req.(*GetJobTaskRequest)) @@ -719,7 +785,7 @@ func _JobSpecificationService_GetWindow_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.JobSpecificationService/GetWindow", + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/GetWindow", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JobSpecificationServiceServer).GetWindow(ctx, req.(*GetWindowRequest)) @@ -727,11 +793,47 @@ func _JobSpecificationService_GetWindow_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } +func _JobSpecificationService_UpdateJobsState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateJobsStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobSpecificationServiceServer).UpdateJobsState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/UpdateJobsState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobSpecificationServiceServer).UpdateJobsState(ctx, req.(*UpdateJobsStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobSpecificationService_SyncJobsState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncJobsStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobSpecificationServiceServer).SyncJobsState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/raystack.optimus.core.v1beta1.JobSpecificationService/SyncJobsState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobSpecificationServiceServer).SyncJobsState(ctx, req.(*SyncJobsStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + // JobSpecificationService_ServiceDesc is the grpc.ServiceDesc for JobSpecificationService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var JobSpecificationService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "odpf.optimus.core.v1beta1.JobSpecificationService", + ServiceName: "raystack.optimus.core.v1beta1.JobSpecificationService", HandlerType: (*JobSpecificationServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -762,6 +864,10 @@ var JobSpecificationService_ServiceDesc = grpc.ServiceDesc{ MethodName: "DeleteJobSpecification", Handler: _JobSpecificationService_DeleteJobSpecification_Handler, }, + { + MethodName: "ChangeJobNamespace", + Handler: _JobSpecificationService_ChangeJobNamespace_Handler, + }, { MethodName: "ListJobSpecification", Handler: _JobSpecificationService_ListJobSpecification_Handler, @@ -782,6 +888,14 @@ var JobSpecificationService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetWindow", Handler: _JobSpecificationService_GetWindow_Handler, }, + { + MethodName: "UpdateJobsState", + Handler: _JobSpecificationService_UpdateJobsState_Handler, + }, + { + MethodName: "SyncJobsState", + Handler: _JobSpecificationService_SyncJobsState_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -807,5 +921,5 @@ var JobSpecificationService_ServiceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "odpf/optimus/core/v1beta1/job_spec.proto", + Metadata: "raystack/optimus/core/v1beta1/job_spec.proto", } diff --git a/protos/raystack/optimus/core/v1beta1/namespace.pb.go b/protos/raystack/optimus/core/v1beta1/namespace.pb.go new file mode 100644 index 0000000000..c0e7540040 --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/namespace.pb.go @@ -0,0 +1,655 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/core/v1beta1/namespace.proto + +package optimus + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + 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 RegisterProjectNamespaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + Namespace *NamespaceSpecification `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` +} + +func (x *RegisterProjectNamespaceRequest) Reset() { + *x = RegisterProjectNamespaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterProjectNamespaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterProjectNamespaceRequest) ProtoMessage() {} + +func (x *RegisterProjectNamespaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_namespace_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 RegisterProjectNamespaceRequest.ProtoReflect.Descriptor instead. +func (*RegisterProjectNamespaceRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{0} +} + +func (x *RegisterProjectNamespaceRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *RegisterProjectNamespaceRequest) GetNamespace() *NamespaceSpecification { + if x != nil { + return x.Namespace + } + return nil +} + +type RegisterProjectNamespaceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *RegisterProjectNamespaceResponse) Reset() { + *x = RegisterProjectNamespaceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterProjectNamespaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterProjectNamespaceResponse) ProtoMessage() {} + +func (x *RegisterProjectNamespaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_namespace_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 RegisterProjectNamespaceResponse.ProtoReflect.Descriptor instead. +func (*RegisterProjectNamespaceResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{1} +} + +func (x *RegisterProjectNamespaceResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *RegisterProjectNamespaceResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type ListProjectNamespacesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` +} + +func (x *ListProjectNamespacesRequest) Reset() { + *x = ListProjectNamespacesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListProjectNamespacesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProjectNamespacesRequest) ProtoMessage() {} + +func (x *ListProjectNamespacesRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_namespace_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 ListProjectNamespacesRequest.ProtoReflect.Descriptor instead. +func (*ListProjectNamespacesRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{2} +} + +func (x *ListProjectNamespacesRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +type ListProjectNamespacesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespaces []*NamespaceSpecification `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces,omitempty"` +} + +func (x *ListProjectNamespacesResponse) Reset() { + *x = ListProjectNamespacesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListProjectNamespacesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProjectNamespacesResponse) ProtoMessage() {} + +func (x *ListProjectNamespacesResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_namespace_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 ListProjectNamespacesResponse.ProtoReflect.Descriptor instead. +func (*ListProjectNamespacesResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{3} +} + +func (x *ListProjectNamespacesResponse) GetNamespaces() []*NamespaceSpecification { + if x != nil { + return x.Namespaces + } + return nil +} + +type GetNamespaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` +} + +func (x *GetNamespaceRequest) Reset() { + *x = GetNamespaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNamespaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNamespaceRequest) ProtoMessage() {} + +func (x *GetNamespaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_namespace_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 GetNamespaceRequest.ProtoReflect.Descriptor instead. +func (*GetNamespaceRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{4} +} + +func (x *GetNamespaceRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *GetNamespaceRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +type GetNamespaceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace *NamespaceSpecification `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` +} + +func (x *GetNamespaceResponse) Reset() { + *x = GetNamespaceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNamespaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNamespaceResponse) ProtoMessage() {} + +func (x *GetNamespaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_namespace_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 GetNamespaceResponse.ProtoReflect.Descriptor instead. +func (*GetNamespaceResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{5} +} + +func (x *GetNamespaceResponse) GetNamespace() *NamespaceSpecification { + if x != nil { + return x.Namespace + } + return nil +} + +type NamespaceSpecification struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Config map[string]string `protobuf:"bytes,2,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *NamespaceSpecification) Reset() { + *x = NamespaceSpecification{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NamespaceSpecification) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NamespaceSpecification) ProtoMessage() {} + +func (x *NamespaceSpecification) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_namespace_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 NamespaceSpecification.ProtoReflect.Descriptor instead. +func (*NamespaceSpecification) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_namespace_proto_rawDescGZIP(), []int{6} +} + +func (x *NamespaceSpecification) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *NamespaceSpecification) GetConfig() map[string]string { + if x != nil { + return x.Config + } + return nil +} + +var File_raystack_optimus_core_v1beta1_namespace_proto protoreflect.FileDescriptor + +var file_raystack_optimus_core_v1beta1_namespace_proto_rawDesc = []byte{ + 0x0a, 0x30, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x20, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x9c, 0x01, 0x0a, 0x1f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x56, 0x0a, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x22, 0x56, 0x0a, 0x20, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x41, 0x0a, 0x1c, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x79, 0x0a, 0x1d, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, + 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, + 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x6e, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x56, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xc5, 0x01, 0x0a, 0x16, 0x4e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x5c, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x32, 0xfe, 0x04, 0x0a, 0x10, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xd7, 0x01, 0x0a, 0x18, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x41, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2e, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, + 0xcb, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x3e, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0xc1, 0x01, + 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x35, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x12, 0x3a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x7d, 0x42, 0x9b, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x42, 0x17, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, + 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, + 0x41, 0x3d, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, + 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, + 0x01, 0x01, 0x72, 0x1b, 0x0a, 0x19, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_raystack_optimus_core_v1beta1_namespace_proto_rawDescOnce sync.Once + file_raystack_optimus_core_v1beta1_namespace_proto_rawDescData = file_raystack_optimus_core_v1beta1_namespace_proto_rawDesc +) + +func file_raystack_optimus_core_v1beta1_namespace_proto_rawDescGZIP() []byte { + file_raystack_optimus_core_v1beta1_namespace_proto_rawDescOnce.Do(func() { + file_raystack_optimus_core_v1beta1_namespace_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_core_v1beta1_namespace_proto_rawDescData) + }) + return file_raystack_optimus_core_v1beta1_namespace_proto_rawDescData +} + +var file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_raystack_optimus_core_v1beta1_namespace_proto_goTypes = []interface{}{ + (*RegisterProjectNamespaceRequest)(nil), // 0: raystack.optimus.core.v1beta1.RegisterProjectNamespaceRequest + (*RegisterProjectNamespaceResponse)(nil), // 1: raystack.optimus.core.v1beta1.RegisterProjectNamespaceResponse + (*ListProjectNamespacesRequest)(nil), // 2: raystack.optimus.core.v1beta1.ListProjectNamespacesRequest + (*ListProjectNamespacesResponse)(nil), // 3: raystack.optimus.core.v1beta1.ListProjectNamespacesResponse + (*GetNamespaceRequest)(nil), // 4: raystack.optimus.core.v1beta1.GetNamespaceRequest + (*GetNamespaceResponse)(nil), // 5: raystack.optimus.core.v1beta1.GetNamespaceResponse + (*NamespaceSpecification)(nil), // 6: raystack.optimus.core.v1beta1.NamespaceSpecification + nil, // 7: raystack.optimus.core.v1beta1.NamespaceSpecification.ConfigEntry +} +var file_raystack_optimus_core_v1beta1_namespace_proto_depIdxs = []int32{ + 6, // 0: raystack.optimus.core.v1beta1.RegisterProjectNamespaceRequest.namespace:type_name -> raystack.optimus.core.v1beta1.NamespaceSpecification + 6, // 1: raystack.optimus.core.v1beta1.ListProjectNamespacesResponse.namespaces:type_name -> raystack.optimus.core.v1beta1.NamespaceSpecification + 6, // 2: raystack.optimus.core.v1beta1.GetNamespaceResponse.namespace:type_name -> raystack.optimus.core.v1beta1.NamespaceSpecification + 7, // 3: raystack.optimus.core.v1beta1.NamespaceSpecification.config:type_name -> raystack.optimus.core.v1beta1.NamespaceSpecification.ConfigEntry + 0, // 4: raystack.optimus.core.v1beta1.NamespaceService.RegisterProjectNamespace:input_type -> raystack.optimus.core.v1beta1.RegisterProjectNamespaceRequest + 2, // 5: raystack.optimus.core.v1beta1.NamespaceService.ListProjectNamespaces:input_type -> raystack.optimus.core.v1beta1.ListProjectNamespacesRequest + 4, // 6: raystack.optimus.core.v1beta1.NamespaceService.GetNamespace:input_type -> raystack.optimus.core.v1beta1.GetNamespaceRequest + 1, // 7: raystack.optimus.core.v1beta1.NamespaceService.RegisterProjectNamespace:output_type -> raystack.optimus.core.v1beta1.RegisterProjectNamespaceResponse + 3, // 8: raystack.optimus.core.v1beta1.NamespaceService.ListProjectNamespaces:output_type -> raystack.optimus.core.v1beta1.ListProjectNamespacesResponse + 5, // 9: raystack.optimus.core.v1beta1.NamespaceService.GetNamespace:output_type -> raystack.optimus.core.v1beta1.GetNamespaceResponse + 7, // [7:10] is the sub-list for method output_type + 4, // [4:7] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_raystack_optimus_core_v1beta1_namespace_proto_init() } +func file_raystack_optimus_core_v1beta1_namespace_proto_init() { + if File_raystack_optimus_core_v1beta1_namespace_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterProjectNamespaceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterProjectNamespaceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListProjectNamespacesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListProjectNamespacesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetNamespaceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetNamespaceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamespaceSpecification); 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_raystack_optimus_core_v1beta1_namespace_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_raystack_optimus_core_v1beta1_namespace_proto_goTypes, + DependencyIndexes: file_raystack_optimus_core_v1beta1_namespace_proto_depIdxs, + MessageInfos: file_raystack_optimus_core_v1beta1_namespace_proto_msgTypes, + }.Build() + File_raystack_optimus_core_v1beta1_namespace_proto = out.File + file_raystack_optimus_core_v1beta1_namespace_proto_rawDesc = nil + file_raystack_optimus_core_v1beta1_namespace_proto_goTypes = nil + file_raystack_optimus_core_v1beta1_namespace_proto_depIdxs = nil +} diff --git a/protos/odpf/optimus/core/v1beta1/namespace.pb.gw.go b/protos/raystack/optimus/core/v1beta1/namespace.pb.gw.go similarity index 93% rename from protos/odpf/optimus/core/v1beta1/namespace.pb.gw.go rename to protos/raystack/optimus/core/v1beta1/namespace.pb.gw.go index 4b013dc4bd..1c170efdb8 100644 --- a/protos/odpf/optimus/core/v1beta1/namespace.pb.gw.go +++ b/protos/raystack/optimus/core/v1beta1/namespace.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: odpf/optimus/core/v1beta1/namespace.proto +// source: raystack/optimus/core/v1beta1/namespace.proto /* Package optimus is a reverse proxy. @@ -235,7 +235,7 @@ func RegisterNamespaceServiceHandlerServer(ctx context.Context, mux *runtime.Ser var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.NamespaceService/RegisterProjectNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.NamespaceService/RegisterProjectNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -258,7 +258,7 @@ func RegisterNamespaceServiceHandlerServer(ctx context.Context, mux *runtime.Ser var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.NamespaceService/ListProjectNamespaces", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.NamespaceService/ListProjectNamespaces", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -281,7 +281,7 @@ func RegisterNamespaceServiceHandlerServer(ctx context.Context, mux *runtime.Ser var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.NamespaceService/GetNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.NamespaceService/GetNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -343,7 +343,7 @@ func RegisterNamespaceServiceHandlerClient(ctx context.Context, mux *runtime.Ser ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.NamespaceService/RegisterProjectNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.NamespaceService/RegisterProjectNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -363,7 +363,7 @@ func RegisterNamespaceServiceHandlerClient(ctx context.Context, mux *runtime.Ser ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.NamespaceService/ListProjectNamespaces", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.NamespaceService/ListProjectNamespaces", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -383,7 +383,7 @@ func RegisterNamespaceServiceHandlerClient(ctx context.Context, mux *runtime.Ser ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.NamespaceService/GetNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.NamespaceService/GetNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/protos/odpf/optimus/core/v1beta1/namespace.swagger.json b/protos/raystack/optimus/core/v1beta1/namespace.swagger.json similarity index 93% rename from protos/odpf/optimus/core/v1beta1/namespace.swagger.json rename to protos/raystack/optimus/core/v1beta1/namespace.swagger.json index 93b196bff8..afe9bb6c57 100644 --- a/protos/odpf/optimus/core/v1beta1/namespace.swagger.json +++ b/protos/raystack/optimus/core/v1beta1/namespace.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/core/v1beta1/namespace.proto", + "title": "raystack/optimus/core/v1beta1/namespace.proto", "version": "0.1" }, "tags": [ @@ -11,15 +11,9 @@ ], "host": "127.0.0.1:9100", "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { "/v1beta1/project/{projectName}/namespace": { "get": { @@ -47,9 +41,7 @@ "type": "string" } ], - "tags": [ - "NamespaceService" - ] + "tags": ["NamespaceService"] }, "post": { "summary": "RegisterProjectNamespace creates a new namespace for a project", @@ -89,9 +81,7 @@ } } ], - "tags": [ - "NamespaceService" - ] + "tags": ["NamespaceService"] } }, "/v1beta1/project/{projectName}/namespace/{namespaceName}": { @@ -126,9 +116,7 @@ "type": "string" } ], - "tags": [ - "NamespaceService" - ] + "tags": ["NamespaceService"] } } }, diff --git a/protos/odpf/optimus/core/v1beta1/namespace_grpc.pb.go b/protos/raystack/optimus/core/v1beta1/namespace_grpc.pb.go similarity index 90% rename from protos/odpf/optimus/core/v1beta1/namespace_grpc.pb.go rename to protos/raystack/optimus/core/v1beta1/namespace_grpc.pb.go index b4d70abb1d..fa7da1091f 100644 --- a/protos/odpf/optimus/core/v1beta1/namespace_grpc.pb.go +++ b/protos/raystack/optimus/core/v1beta1/namespace_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: odpf/optimus/core/v1beta1/namespace.proto +// source: raystack/optimus/core/v1beta1/namespace.proto package optimus @@ -40,7 +40,7 @@ func NewNamespaceServiceClient(cc grpc.ClientConnInterface) NamespaceServiceClie func (c *namespaceServiceClient) RegisterProjectNamespace(ctx context.Context, in *RegisterProjectNamespaceRequest, opts ...grpc.CallOption) (*RegisterProjectNamespaceResponse, error) { out := new(RegisterProjectNamespaceResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.NamespaceService/RegisterProjectNamespace", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.NamespaceService/RegisterProjectNamespace", in, out, opts...) if err != nil { return nil, err } @@ -49,7 +49,7 @@ func (c *namespaceServiceClient) RegisterProjectNamespace(ctx context.Context, i func (c *namespaceServiceClient) ListProjectNamespaces(ctx context.Context, in *ListProjectNamespacesRequest, opts ...grpc.CallOption) (*ListProjectNamespacesResponse, error) { out := new(ListProjectNamespacesResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.NamespaceService/ListProjectNamespaces", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.NamespaceService/ListProjectNamespaces", in, out, opts...) if err != nil { return nil, err } @@ -58,7 +58,7 @@ func (c *namespaceServiceClient) ListProjectNamespaces(ctx context.Context, in * func (c *namespaceServiceClient) GetNamespace(ctx context.Context, in *GetNamespaceRequest, opts ...grpc.CallOption) (*GetNamespaceResponse, error) { out := new(GetNamespaceResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.NamespaceService/GetNamespace", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.NamespaceService/GetNamespace", in, out, opts...) if err != nil { return nil, err } @@ -114,7 +114,7 @@ func _NamespaceService_RegisterProjectNamespace_Handler(srv interface{}, ctx con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.NamespaceService/RegisterProjectNamespace", + FullMethod: "/raystack.optimus.core.v1beta1.NamespaceService/RegisterProjectNamespace", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NamespaceServiceServer).RegisterProjectNamespace(ctx, req.(*RegisterProjectNamespaceRequest)) @@ -132,7 +132,7 @@ func _NamespaceService_ListProjectNamespaces_Handler(srv interface{}, ctx contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.NamespaceService/ListProjectNamespaces", + FullMethod: "/raystack.optimus.core.v1beta1.NamespaceService/ListProjectNamespaces", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NamespaceServiceServer).ListProjectNamespaces(ctx, req.(*ListProjectNamespacesRequest)) @@ -150,7 +150,7 @@ func _NamespaceService_GetNamespace_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.NamespaceService/GetNamespace", + FullMethod: "/raystack.optimus.core.v1beta1.NamespaceService/GetNamespace", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NamespaceServiceServer).GetNamespace(ctx, req.(*GetNamespaceRequest)) @@ -162,7 +162,7 @@ func _NamespaceService_GetNamespace_Handler(srv interface{}, ctx context.Context // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var NamespaceService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "odpf.optimus.core.v1beta1.NamespaceService", + ServiceName: "raystack.optimus.core.v1beta1.NamespaceService", HandlerType: (*NamespaceServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -179,5 +179,5 @@ var NamespaceService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "odpf/optimus/core/v1beta1/namespace.proto", + Metadata: "raystack/optimus/core/v1beta1/namespace.proto", } diff --git a/protos/raystack/optimus/core/v1beta1/project.pb.go b/protos/raystack/optimus/core/v1beta1/project.pb.go new file mode 100644 index 0000000000..021cccba14 --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/project.pb.go @@ -0,0 +1,697 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/core/v1beta1/project.proto + +package optimus + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + 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 RegisterProjectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Project *ProjectSpecification `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` +} + +func (x *RegisterProjectRequest) Reset() { + *x = RegisterProjectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_project_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterProjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterProjectRequest) ProtoMessage() {} + +func (x *RegisterProjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_project_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 RegisterProjectRequest.ProtoReflect.Descriptor instead. +func (*RegisterProjectRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{0} +} + +func (x *RegisterProjectRequest) GetProject() *ProjectSpecification { + if x != nil { + return x.Project + } + return nil +} + +type RegisterProjectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *RegisterProjectResponse) Reset() { + *x = RegisterProjectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_project_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterProjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterProjectResponse) ProtoMessage() {} + +func (x *RegisterProjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_project_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 RegisterProjectResponse.ProtoReflect.Descriptor instead. +func (*RegisterProjectResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{1} +} + +func (x *RegisterProjectResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *RegisterProjectResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type ListProjectsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListProjectsRequest) Reset() { + *x = ListProjectsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_project_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListProjectsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProjectsRequest) ProtoMessage() {} + +func (x *ListProjectsRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_project_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 ListProjectsRequest.ProtoReflect.Descriptor instead. +func (*ListProjectsRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{2} +} + +type ListProjectsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Projects []*ProjectSpecification `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"` +} + +func (x *ListProjectsResponse) Reset() { + *x = ListProjectsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_project_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListProjectsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProjectsResponse) ProtoMessage() {} + +func (x *ListProjectsResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_project_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 ListProjectsResponse.ProtoReflect.Descriptor instead. +func (*ListProjectsResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{3} +} + +func (x *ListProjectsResponse) GetProjects() []*ProjectSpecification { + if x != nil { + return x.Projects + } + return nil +} + +type GetProjectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` +} + +func (x *GetProjectRequest) Reset() { + *x = GetProjectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_project_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProjectRequest) ProtoMessage() {} + +func (x *GetProjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_project_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 GetProjectRequest.ProtoReflect.Descriptor instead. +func (*GetProjectRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{4} +} + +func (x *GetProjectRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +type GetProjectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Project *ProjectSpecification `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` +} + +func (x *GetProjectResponse) Reset() { + *x = GetProjectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_project_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProjectResponse) ProtoMessage() {} + +func (x *GetProjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_project_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 GetProjectResponse.ProtoReflect.Descriptor instead. +func (*GetProjectResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{5} +} + +func (x *GetProjectResponse) GetProject() *ProjectSpecification { + if x != nil { + return x.Project + } + return nil +} + +type ProjectSpecification struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Config map[string]string `protobuf:"bytes,2,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Secrets []*ProjectSpecification_ProjectSecret `protobuf:"bytes,3,rep,name=secrets,proto3" json:"secrets,omitempty"` +} + +func (x *ProjectSpecification) Reset() { + *x = ProjectSpecification{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_project_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectSpecification) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectSpecification) ProtoMessage() {} + +func (x *ProjectSpecification) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_project_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 ProjectSpecification.ProtoReflect.Descriptor instead. +func (*ProjectSpecification) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{6} +} + +func (x *ProjectSpecification) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ProjectSpecification) GetConfig() map[string]string { + if x != nil { + return x.Config + } + return nil +} + +func (x *ProjectSpecification) GetSecrets() []*ProjectSpecification_ProjectSecret { + if x != nil { + return x.Secrets + } + return nil +} + +type ProjectSpecification_ProjectSecret struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *ProjectSpecification_ProjectSecret) Reset() { + *x = ProjectSpecification_ProjectSecret{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_project_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectSpecification_ProjectSecret) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectSpecification_ProjectSecret) ProtoMessage() {} + +func (x *ProjectSpecification_ProjectSecret) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_project_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 ProjectSpecification_ProjectSecret.ProtoReflect.Descriptor instead. +func (*ProjectSpecification_ProjectSecret) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_project_proto_rawDescGZIP(), []int{6, 1} +} + +func (x *ProjectSpecification_ProjectSecret) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ProjectSpecification_ProjectSecret) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_raystack_optimus_core_v1beta1_project_proto protoreflect.FileDescriptor + +var file_raystack_optimus_core_v1beta1_project_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x20, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x70, 0x0a, 0x16, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x07, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4a, 0x04, 0x08, 0x02, + 0x10, 0x03, 0x22, 0x4d, 0x0a, 0x17, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6a, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x52, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x22, 0x36, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x66, 0x0a, 0x12, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x50, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x22, 0xdc, 0x02, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x5a, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x42, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5e, 0x0a, + 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x44, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x52, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x1a, 0x39, 0x0a, + 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x32, 0xf3, 0x03, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xa3, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x97, 0x01, 0x0a, + 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x35, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0xa0, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0x97, 0x01, 0x0a, 0x1e, 0x63, 0x6f, + 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x15, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, 0x41, 0x3b, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, + 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, + 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x19, 0x0a, 0x17, 0x4f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_raystack_optimus_core_v1beta1_project_proto_rawDescOnce sync.Once + file_raystack_optimus_core_v1beta1_project_proto_rawDescData = file_raystack_optimus_core_v1beta1_project_proto_rawDesc +) + +func file_raystack_optimus_core_v1beta1_project_proto_rawDescGZIP() []byte { + file_raystack_optimus_core_v1beta1_project_proto_rawDescOnce.Do(func() { + file_raystack_optimus_core_v1beta1_project_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_core_v1beta1_project_proto_rawDescData) + }) + return file_raystack_optimus_core_v1beta1_project_proto_rawDescData +} + +var file_raystack_optimus_core_v1beta1_project_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_raystack_optimus_core_v1beta1_project_proto_goTypes = []interface{}{ + (*RegisterProjectRequest)(nil), // 0: raystack.optimus.core.v1beta1.RegisterProjectRequest + (*RegisterProjectResponse)(nil), // 1: raystack.optimus.core.v1beta1.RegisterProjectResponse + (*ListProjectsRequest)(nil), // 2: raystack.optimus.core.v1beta1.ListProjectsRequest + (*ListProjectsResponse)(nil), // 3: raystack.optimus.core.v1beta1.ListProjectsResponse + (*GetProjectRequest)(nil), // 4: raystack.optimus.core.v1beta1.GetProjectRequest + (*GetProjectResponse)(nil), // 5: raystack.optimus.core.v1beta1.GetProjectResponse + (*ProjectSpecification)(nil), // 6: raystack.optimus.core.v1beta1.ProjectSpecification + nil, // 7: raystack.optimus.core.v1beta1.ProjectSpecification.ConfigEntry + (*ProjectSpecification_ProjectSecret)(nil), // 8: raystack.optimus.core.v1beta1.ProjectSpecification.ProjectSecret +} +var file_raystack_optimus_core_v1beta1_project_proto_depIdxs = []int32{ + 6, // 0: raystack.optimus.core.v1beta1.RegisterProjectRequest.project:type_name -> raystack.optimus.core.v1beta1.ProjectSpecification + 6, // 1: raystack.optimus.core.v1beta1.ListProjectsResponse.projects:type_name -> raystack.optimus.core.v1beta1.ProjectSpecification + 6, // 2: raystack.optimus.core.v1beta1.GetProjectResponse.project:type_name -> raystack.optimus.core.v1beta1.ProjectSpecification + 7, // 3: raystack.optimus.core.v1beta1.ProjectSpecification.config:type_name -> raystack.optimus.core.v1beta1.ProjectSpecification.ConfigEntry + 8, // 4: raystack.optimus.core.v1beta1.ProjectSpecification.secrets:type_name -> raystack.optimus.core.v1beta1.ProjectSpecification.ProjectSecret + 0, // 5: raystack.optimus.core.v1beta1.ProjectService.RegisterProject:input_type -> raystack.optimus.core.v1beta1.RegisterProjectRequest + 2, // 6: raystack.optimus.core.v1beta1.ProjectService.ListProjects:input_type -> raystack.optimus.core.v1beta1.ListProjectsRequest + 4, // 7: raystack.optimus.core.v1beta1.ProjectService.GetProject:input_type -> raystack.optimus.core.v1beta1.GetProjectRequest + 1, // 8: raystack.optimus.core.v1beta1.ProjectService.RegisterProject:output_type -> raystack.optimus.core.v1beta1.RegisterProjectResponse + 3, // 9: raystack.optimus.core.v1beta1.ProjectService.ListProjects:output_type -> raystack.optimus.core.v1beta1.ListProjectsResponse + 5, // 10: raystack.optimus.core.v1beta1.ProjectService.GetProject:output_type -> raystack.optimus.core.v1beta1.GetProjectResponse + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] 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_raystack_optimus_core_v1beta1_project_proto_init() } +func file_raystack_optimus_core_v1beta1_project_proto_init() { + if File_raystack_optimus_core_v1beta1_project_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_core_v1beta1_project_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterProjectRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_project_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterProjectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_project_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListProjectsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_project_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListProjectsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_project_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProjectRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_project_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProjectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_project_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectSpecification); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_project_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectSpecification_ProjectSecret); 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_raystack_optimus_core_v1beta1_project_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_raystack_optimus_core_v1beta1_project_proto_goTypes, + DependencyIndexes: file_raystack_optimus_core_v1beta1_project_proto_depIdxs, + MessageInfos: file_raystack_optimus_core_v1beta1_project_proto_msgTypes, + }.Build() + File_raystack_optimus_core_v1beta1_project_proto = out.File + file_raystack_optimus_core_v1beta1_project_proto_rawDesc = nil + file_raystack_optimus_core_v1beta1_project_proto_goTypes = nil + file_raystack_optimus_core_v1beta1_project_proto_depIdxs = nil +} diff --git a/protos/odpf/optimus/core/v1beta1/project.pb.gw.go b/protos/raystack/optimus/core/v1beta1/project.pb.gw.go similarity index 93% rename from protos/odpf/optimus/core/v1beta1/project.pb.gw.go rename to protos/raystack/optimus/core/v1beta1/project.pb.gw.go index 4c1b31be92..fe6409d0f3 100644 --- a/protos/odpf/optimus/core/v1beta1/project.pb.gw.go +++ b/protos/raystack/optimus/core/v1beta1/project.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: odpf/optimus/core/v1beta1/project.proto +// source: raystack/optimus/core/v1beta1/project.proto /* Package optimus is a reverse proxy. @@ -147,7 +147,7 @@ func RegisterProjectServiceHandlerServer(ctx context.Context, mux *runtime.Serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ProjectService/RegisterProject", runtime.WithHTTPPathPattern("/v1beta1/project")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ProjectService/RegisterProject", runtime.WithHTTPPathPattern("/v1beta1/project")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -170,7 +170,7 @@ func RegisterProjectServiceHandlerServer(ctx context.Context, mux *runtime.Serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ProjectService/ListProjects", runtime.WithHTTPPathPattern("/v1beta1/project")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ProjectService/ListProjects", runtime.WithHTTPPathPattern("/v1beta1/project")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -193,7 +193,7 @@ func RegisterProjectServiceHandlerServer(ctx context.Context, mux *runtime.Serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ProjectService/GetProject", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ProjectService/GetProject", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -255,7 +255,7 @@ func RegisterProjectServiceHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ProjectService/RegisterProject", runtime.WithHTTPPathPattern("/v1beta1/project")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ProjectService/RegisterProject", runtime.WithHTTPPathPattern("/v1beta1/project")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -275,7 +275,7 @@ func RegisterProjectServiceHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ProjectService/ListProjects", runtime.WithHTTPPathPattern("/v1beta1/project")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ProjectService/ListProjects", runtime.WithHTTPPathPattern("/v1beta1/project")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -295,7 +295,7 @@ func RegisterProjectServiceHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ProjectService/GetProject", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ProjectService/GetProject", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/protos/odpf/optimus/core/v1beta1/project.swagger.json b/protos/raystack/optimus/core/v1beta1/project.swagger.json similarity index 93% rename from protos/odpf/optimus/core/v1beta1/project.swagger.json rename to protos/raystack/optimus/core/v1beta1/project.swagger.json index 6911189870..1cb2d80429 100644 --- a/protos/odpf/optimus/core/v1beta1/project.swagger.json +++ b/protos/raystack/optimus/core/v1beta1/project.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/core/v1beta1/project.proto", + "title": "raystack/optimus/core/v1beta1/project.proto", "version": "0.1" }, "tags": [ @@ -11,15 +11,9 @@ ], "host": "127.0.0.1:9100", "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { "/v1beta1/project": { "get": { @@ -39,9 +33,7 @@ } } }, - "tags": [ - "ProjectService" - ] + "tags": ["ProjectService"] }, "post": { "summary": "RegisterProject creates a new optimus project", @@ -70,9 +62,7 @@ } } ], - "tags": [ - "ProjectService" - ] + "tags": ["ProjectService"] } }, "/v1beta1/project/{projectName}": { @@ -101,9 +91,7 @@ "type": "string" } ], - "tags": [ - "ProjectService" - ] + "tags": ["ProjectService"] } } }, diff --git a/protos/odpf/optimus/core/v1beta1/project_grpc.pb.go b/protos/raystack/optimus/core/v1beta1/project_grpc.pb.go similarity index 90% rename from protos/odpf/optimus/core/v1beta1/project_grpc.pb.go rename to protos/raystack/optimus/core/v1beta1/project_grpc.pb.go index 0222f50557..b8b106f67e 100644 --- a/protos/odpf/optimus/core/v1beta1/project_grpc.pb.go +++ b/protos/raystack/optimus/core/v1beta1/project_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: odpf/optimus/core/v1beta1/project.proto +// source: raystack/optimus/core/v1beta1/project.proto package optimus @@ -40,7 +40,7 @@ func NewProjectServiceClient(cc grpc.ClientConnInterface) ProjectServiceClient { func (c *projectServiceClient) RegisterProject(ctx context.Context, in *RegisterProjectRequest, opts ...grpc.CallOption) (*RegisterProjectResponse, error) { out := new(RegisterProjectResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.ProjectService/RegisterProject", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ProjectService/RegisterProject", in, out, opts...) if err != nil { return nil, err } @@ -49,7 +49,7 @@ func (c *projectServiceClient) RegisterProject(ctx context.Context, in *Register func (c *projectServiceClient) ListProjects(ctx context.Context, in *ListProjectsRequest, opts ...grpc.CallOption) (*ListProjectsResponse, error) { out := new(ListProjectsResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.ProjectService/ListProjects", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ProjectService/ListProjects", in, out, opts...) if err != nil { return nil, err } @@ -58,7 +58,7 @@ func (c *projectServiceClient) ListProjects(ctx context.Context, in *ListProject func (c *projectServiceClient) GetProject(ctx context.Context, in *GetProjectRequest, opts ...grpc.CallOption) (*GetProjectResponse, error) { out := new(GetProjectResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.ProjectService/GetProject", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ProjectService/GetProject", in, out, opts...) if err != nil { return nil, err } @@ -114,7 +114,7 @@ func _ProjectService_RegisterProject_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.ProjectService/RegisterProject", + FullMethod: "/raystack.optimus.core.v1beta1.ProjectService/RegisterProject", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProjectServiceServer).RegisterProject(ctx, req.(*RegisterProjectRequest)) @@ -132,7 +132,7 @@ func _ProjectService_ListProjects_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.ProjectService/ListProjects", + FullMethod: "/raystack.optimus.core.v1beta1.ProjectService/ListProjects", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProjectServiceServer).ListProjects(ctx, req.(*ListProjectsRequest)) @@ -150,7 +150,7 @@ func _ProjectService_GetProject_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.ProjectService/GetProject", + FullMethod: "/raystack.optimus.core.v1beta1.ProjectService/GetProject", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProjectServiceServer).GetProject(ctx, req.(*GetProjectRequest)) @@ -162,7 +162,7 @@ func _ProjectService_GetProject_Handler(srv interface{}, ctx context.Context, de // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var ProjectService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "odpf.optimus.core.v1beta1.ProjectService", + ServiceName: "raystack.optimus.core.v1beta1.ProjectService", HandlerType: (*ProjectServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -179,5 +179,5 @@ var ProjectService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "odpf/optimus/core/v1beta1/project.proto", + Metadata: "raystack/optimus/core/v1beta1/project.proto", } diff --git a/protos/raystack/optimus/core/v1beta1/replay.pb.go b/protos/raystack/optimus/core/v1beta1/replay.pb.go new file mode 100644 index 0000000000..727f68fa3d --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/replay.pb.go @@ -0,0 +1,1069 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/core/v1beta1/replay.proto + +package optimus + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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 ListReplayRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` +} + +func (x *ListReplayRequest) Reset() { + *x = ListReplayRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReplayRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReplayRequest) ProtoMessage() {} + +func (x *ListReplayRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_replay_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 ListReplayRequest.ProtoReflect.Descriptor instead. +func (*ListReplayRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{0} +} + +func (x *ListReplayRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +type ListReplayResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Replays []*GetReplayResponse `protobuf:"bytes,1,rep,name=replays,proto3" json:"replays,omitempty"` +} + +func (x *ListReplayResponse) Reset() { + *x = ListReplayResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReplayResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReplayResponse) ProtoMessage() {} + +func (x *ListReplayResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_replay_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 ListReplayResponse.ProtoReflect.Descriptor instead. +func (*ListReplayResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{1} +} + +func (x *ListReplayResponse) GetReplays() []*GetReplayResponse { + if x != nil { + return x.Replays + } + return nil +} + +type GetReplayRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReplayId string `protobuf:"bytes,1,opt,name=replay_id,json=replayId,proto3" json:"replay_id,omitempty"` + ProjectName string `protobuf:"bytes,2,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` +} + +func (x *GetReplayRequest) Reset() { + *x = GetReplayRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetReplayRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetReplayRequest) ProtoMessage() {} + +func (x *GetReplayRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_replay_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 GetReplayRequest.ProtoReflect.Descriptor instead. +func (*GetReplayRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{2} +} + +func (x *GetReplayRequest) GetReplayId() string { + if x != nil { + return x.ReplayId + } + return "" +} + +func (x *GetReplayRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +type GetReplayResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + ReplayConfig *ReplayConfig `protobuf:"bytes,4,opt,name=replay_config,json=replayConfig,proto3" json:"replay_config,omitempty"` + ReplayRuns []*ReplayRun `protobuf:"bytes,5,rep,name=replay_runs,json=replayRuns,proto3" json:"replay_runs,omitempty"` +} + +func (x *GetReplayResponse) Reset() { + *x = GetReplayResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetReplayResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetReplayResponse) ProtoMessage() {} + +func (x *GetReplayResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_replay_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 GetReplayResponse.ProtoReflect.Descriptor instead. +func (*GetReplayResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{3} +} + +func (x *GetReplayResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetReplayResponse) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *GetReplayResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *GetReplayResponse) GetReplayConfig() *ReplayConfig { + if x != nil { + return x.ReplayConfig + } + return nil +} + +func (x *GetReplayResponse) GetReplayRuns() []*ReplayRun { + if x != nil { + return x.ReplayRuns + } + return nil +} + +type ReplayConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + Parallel bool `protobuf:"varint,3,opt,name=parallel,proto3" json:"parallel,omitempty"` + JobConfig map[string]string `protobuf:"bytes,4,rep,name=job_config,json=jobConfig,proto3" json:"job_config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *ReplayConfig) Reset() { + *x = ReplayConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReplayConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplayConfig) ProtoMessage() {} + +func (x *ReplayConfig) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_replay_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 ReplayConfig.ProtoReflect.Descriptor instead. +func (*ReplayConfig) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{4} +} + +func (x *ReplayConfig) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *ReplayConfig) GetEndTime() *timestamppb.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +func (x *ReplayConfig) GetParallel() bool { + if x != nil { + return x.Parallel + } + return false +} + +func (x *ReplayConfig) GetJobConfig() map[string]string { + if x != nil { + return x.JobConfig + } + return nil +} + +func (x *ReplayConfig) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type ReplayRun struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ScheduledAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=scheduled_at,json=scheduledAt,proto3" json:"scheduled_at,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *ReplayRun) Reset() { + *x = ReplayRun{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReplayRun) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplayRun) ProtoMessage() {} + +func (x *ReplayRun) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_replay_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 ReplayRun.ProtoReflect.Descriptor instead. +func (*ReplayRun) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{5} +} + +func (x *ReplayRun) GetScheduledAt() *timestamppb.Timestamp { + if x != nil { + return x.ScheduledAt + } + return nil +} + +func (x *ReplayRun) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +type ReplayDryRunResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReplayRuns []*ReplayRun `protobuf:"bytes,1,rep,name=replay_runs,json=replayRuns,proto3" json:"replay_runs,omitempty"` +} + +func (x *ReplayDryRunResponse) Reset() { + *x = ReplayDryRunResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReplayDryRunResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplayDryRunResponse) ProtoMessage() {} + +func (x *ReplayDryRunResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_replay_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 ReplayDryRunResponse.ProtoReflect.Descriptor instead. +func (*ReplayDryRunResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{6} +} + +func (x *ReplayDryRunResponse) GetReplayRuns() []*ReplayRun { + if x != nil { + return x.ReplayRuns + } + return nil +} + +type ReplayRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + Parallel bool `protobuf:"varint,6,opt,name=parallel,proto3" json:"parallel,omitempty"` + Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` + JobConfig string `protobuf:"bytes,8,opt,name=job_config,json=jobConfig,proto3" json:"job_config,omitempty"` +} + +func (x *ReplayRequest) Reset() { + *x = ReplayRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReplayRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplayRequest) ProtoMessage() {} + +func (x *ReplayRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_replay_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 ReplayRequest.ProtoReflect.Descriptor instead. +func (*ReplayRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{7} +} + +func (x *ReplayRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *ReplayRequest) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *ReplayRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *ReplayRequest) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *ReplayRequest) GetEndTime() *timestamppb.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +func (x *ReplayRequest) GetParallel() bool { + if x != nil { + return x.Parallel + } + return false +} + +func (x *ReplayRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *ReplayRequest) GetJobConfig() string { + if x != nil { + return x.JobConfig + } + return "" +} + +type ReplayDryRunRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + Parallel bool `protobuf:"varint,6,opt,name=parallel,proto3" json:"parallel,omitempty"` + Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` + JobConfig string `protobuf:"bytes,8,opt,name=job_config,json=jobConfig,proto3" json:"job_config,omitempty"` +} + +func (x *ReplayDryRunRequest) Reset() { + *x = ReplayDryRunRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReplayDryRunRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplayDryRunRequest) ProtoMessage() {} + +func (x *ReplayDryRunRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_replay_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 ReplayDryRunRequest.ProtoReflect.Descriptor instead. +func (*ReplayDryRunRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{8} +} + +func (x *ReplayDryRunRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *ReplayDryRunRequest) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *ReplayDryRunRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *ReplayDryRunRequest) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *ReplayDryRunRequest) GetEndTime() *timestamppb.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +func (x *ReplayDryRunRequest) GetParallel() bool { + if x != nil { + return x.Parallel + } + return false +} + +func (x *ReplayDryRunRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *ReplayDryRunRequest) GetJobConfig() string { + if x != nil { + return x.JobConfig + } + return "" +} + +type ReplayResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ReplayResponse) Reset() { + *x = ReplayResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReplayResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplayResponse) ProtoMessage() {} + +func (x *ReplayResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_replay_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 ReplayResponse.ProtoReflect.Descriptor instead. +func (*ReplayResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP(), []int{9} +} + +func (x *ReplayResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +var File_raystack_optimus_core_v1beta1_replay_proto protoreflect.FileDescriptor + +var file_raystack_optimus_core_v1beta1_replay_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x20, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x36, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x63, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, + 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x22, 0x52, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x49, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0xf9, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x53, 0x0a, 0x0d, 0x72, 0x65, + 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, + 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x4c, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x72, 0x75, 0x6e, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x75, + 0x6e, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x75, 0x6e, 0x73, 0x22, 0xda, 0x02, + 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, + 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x12, 0x5c, 0x0a, 0x0a, + 0x6a, 0x6f, 0x62, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x4a, 0x6f, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x09, 0x6a, 0x6f, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x3c, 0x0a, 0x0e, + 0x4a, 0x6f, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x62, 0x0a, 0x09, 0x52, 0x65, + 0x70, 0x6c, 0x61, 0x79, 0x52, 0x75, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x64, + 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x44, 0x72, 0x79, 0x52, 0x75, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, + 0x5f, 0x72, 0x75, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, + 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x75, 0x6e, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, + 0x52, 0x75, 0x6e, 0x73, 0x22, 0xc3, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, + 0x6f, 0x62, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x6a, 0x6f, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xc9, 0x02, 0x0a, 0x13, 0x52, + 0x65, 0x70, 0x6c, 0x61, 0x79, 0x44, 0x72, 0x79, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x72, + 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x70, 0x61, 0x72, + 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x6f, 0x62, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x20, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x32, 0xc8, 0x05, 0x0a, 0x0d, 0x52, 0x65, 0x70, + 0x6c, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9e, 0x01, 0x0a, 0x06, 0x52, + 0x65, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x2f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, + 0x22, 0x26, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x7d, 0x2f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x01, 0x2a, 0x12, 0xb8, 0x01, 0x0a, 0x0c, + 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x44, 0x72, 0x79, 0x52, 0x75, 0x6e, 0x12, 0x35, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x44, 0x72, 0x79, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x44, 0x72, 0x79, + 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x33, 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x2d, 0x64, 0x72, 0x79, 0x2d, + 0x72, 0x75, 0x6e, 0x3a, 0x01, 0x2a, 0x12, 0xa7, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, + 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, + 0x12, 0xb0, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x32, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, + 0x32, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, + 0x2f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x2f, 0x7b, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x5f, + 0x69, 0x64, 0x7d, 0x42, 0x95, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x14, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1e, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, 0x41, + 0x3a, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, + 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x01, + 0x01, 0x72, 0x18, 0x0a, 0x16, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x52, 0x65, 0x70, + 0x6c, 0x61, 0x79, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_raystack_optimus_core_v1beta1_replay_proto_rawDescOnce sync.Once + file_raystack_optimus_core_v1beta1_replay_proto_rawDescData = file_raystack_optimus_core_v1beta1_replay_proto_rawDesc +) + +func file_raystack_optimus_core_v1beta1_replay_proto_rawDescGZIP() []byte { + file_raystack_optimus_core_v1beta1_replay_proto_rawDescOnce.Do(func() { + file_raystack_optimus_core_v1beta1_replay_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_core_v1beta1_replay_proto_rawDescData) + }) + return file_raystack_optimus_core_v1beta1_replay_proto_rawDescData +} + +var file_raystack_optimus_core_v1beta1_replay_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_raystack_optimus_core_v1beta1_replay_proto_goTypes = []interface{}{ + (*ListReplayRequest)(nil), // 0: raystack.optimus.core.v1beta1.ListReplayRequest + (*ListReplayResponse)(nil), // 1: raystack.optimus.core.v1beta1.ListReplayResponse + (*GetReplayRequest)(nil), // 2: raystack.optimus.core.v1beta1.GetReplayRequest + (*GetReplayResponse)(nil), // 3: raystack.optimus.core.v1beta1.GetReplayResponse + (*ReplayConfig)(nil), // 4: raystack.optimus.core.v1beta1.ReplayConfig + (*ReplayRun)(nil), // 5: raystack.optimus.core.v1beta1.ReplayRun + (*ReplayDryRunResponse)(nil), // 6: raystack.optimus.core.v1beta1.ReplayDryRunResponse + (*ReplayRequest)(nil), // 7: raystack.optimus.core.v1beta1.ReplayRequest + (*ReplayDryRunRequest)(nil), // 8: raystack.optimus.core.v1beta1.ReplayDryRunRequest + (*ReplayResponse)(nil), // 9: raystack.optimus.core.v1beta1.ReplayResponse + nil, // 10: raystack.optimus.core.v1beta1.ReplayConfig.JobConfigEntry + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp +} +var file_raystack_optimus_core_v1beta1_replay_proto_depIdxs = []int32{ + 3, // 0: raystack.optimus.core.v1beta1.ListReplayResponse.replays:type_name -> raystack.optimus.core.v1beta1.GetReplayResponse + 4, // 1: raystack.optimus.core.v1beta1.GetReplayResponse.replay_config:type_name -> raystack.optimus.core.v1beta1.ReplayConfig + 5, // 2: raystack.optimus.core.v1beta1.GetReplayResponse.replay_runs:type_name -> raystack.optimus.core.v1beta1.ReplayRun + 11, // 3: raystack.optimus.core.v1beta1.ReplayConfig.start_time:type_name -> google.protobuf.Timestamp + 11, // 4: raystack.optimus.core.v1beta1.ReplayConfig.end_time:type_name -> google.protobuf.Timestamp + 10, // 5: raystack.optimus.core.v1beta1.ReplayConfig.job_config:type_name -> raystack.optimus.core.v1beta1.ReplayConfig.JobConfigEntry + 11, // 6: raystack.optimus.core.v1beta1.ReplayRun.scheduled_at:type_name -> google.protobuf.Timestamp + 5, // 7: raystack.optimus.core.v1beta1.ReplayDryRunResponse.replay_runs:type_name -> raystack.optimus.core.v1beta1.ReplayRun + 11, // 8: raystack.optimus.core.v1beta1.ReplayRequest.start_time:type_name -> google.protobuf.Timestamp + 11, // 9: raystack.optimus.core.v1beta1.ReplayRequest.end_time:type_name -> google.protobuf.Timestamp + 11, // 10: raystack.optimus.core.v1beta1.ReplayDryRunRequest.start_time:type_name -> google.protobuf.Timestamp + 11, // 11: raystack.optimus.core.v1beta1.ReplayDryRunRequest.end_time:type_name -> google.protobuf.Timestamp + 7, // 12: raystack.optimus.core.v1beta1.ReplayService.Replay:input_type -> raystack.optimus.core.v1beta1.ReplayRequest + 8, // 13: raystack.optimus.core.v1beta1.ReplayService.ReplayDryRun:input_type -> raystack.optimus.core.v1beta1.ReplayDryRunRequest + 0, // 14: raystack.optimus.core.v1beta1.ReplayService.ListReplay:input_type -> raystack.optimus.core.v1beta1.ListReplayRequest + 2, // 15: raystack.optimus.core.v1beta1.ReplayService.GetReplay:input_type -> raystack.optimus.core.v1beta1.GetReplayRequest + 9, // 16: raystack.optimus.core.v1beta1.ReplayService.Replay:output_type -> raystack.optimus.core.v1beta1.ReplayResponse + 6, // 17: raystack.optimus.core.v1beta1.ReplayService.ReplayDryRun:output_type -> raystack.optimus.core.v1beta1.ReplayDryRunResponse + 1, // 18: raystack.optimus.core.v1beta1.ReplayService.ListReplay:output_type -> raystack.optimus.core.v1beta1.ListReplayResponse + 3, // 19: raystack.optimus.core.v1beta1.ReplayService.GetReplay:output_type -> raystack.optimus.core.v1beta1.GetReplayResponse + 16, // [16:20] is the sub-list for method output_type + 12, // [12:16] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_raystack_optimus_core_v1beta1_replay_proto_init() } +func file_raystack_optimus_core_v1beta1_replay_proto_init() { + if File_raystack_optimus_core_v1beta1_replay_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReplayRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReplayResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetReplayRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetReplayResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReplayConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReplayRun); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReplayDryRunResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReplayRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReplayDryRunRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_replay_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReplayResponse); 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_raystack_optimus_core_v1beta1_replay_proto_rawDesc, + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_raystack_optimus_core_v1beta1_replay_proto_goTypes, + DependencyIndexes: file_raystack_optimus_core_v1beta1_replay_proto_depIdxs, + MessageInfos: file_raystack_optimus_core_v1beta1_replay_proto_msgTypes, + }.Build() + File_raystack_optimus_core_v1beta1_replay_proto = out.File + file_raystack_optimus_core_v1beta1_replay_proto_rawDesc = nil + file_raystack_optimus_core_v1beta1_replay_proto_goTypes = nil + file_raystack_optimus_core_v1beta1_replay_proto_depIdxs = nil +} diff --git a/protos/raystack/optimus/core/v1beta1/replay.pb.gw.go b/protos/raystack/optimus/core/v1beta1/replay.pb.gw.go new file mode 100644 index 0000000000..332816ce47 --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/replay.pb.gw.go @@ -0,0 +1,534 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: raystack/optimus/core/v1beta1/replay.proto + +/* +Package optimus is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package optimus + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ReplayService_Replay_0(ctx context.Context, marshaler runtime.Marshaler, client ReplayServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ReplayRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + msg, err := client.Replay(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReplayService_Replay_0(ctx context.Context, marshaler runtime.Marshaler, server ReplayServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ReplayRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + msg, err := server.Replay(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ReplayService_ReplayDryRun_0(ctx context.Context, marshaler runtime.Marshaler, client ReplayServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ReplayDryRunRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + msg, err := client.ReplayDryRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReplayService_ReplayDryRun_0(ctx context.Context, marshaler runtime.Marshaler, server ReplayServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ReplayDryRunRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + msg, err := server.ReplayDryRun(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ReplayService_ListReplay_0(ctx context.Context, marshaler runtime.Marshaler, client ReplayServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReplayRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + msg, err := client.ListReplay(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReplayService_ListReplay_0(ctx context.Context, marshaler runtime.Marshaler, server ReplayServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReplayRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + msg, err := server.ListReplay(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ReplayService_GetReplay_0(ctx context.Context, marshaler runtime.Marshaler, client ReplayServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetReplayRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + val, ok = pathParams["replay_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "replay_id") + } + + protoReq.ReplayId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "replay_id", err) + } + + msg, err := client.GetReplay(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReplayService_GetReplay_0(ctx context.Context, marshaler runtime.Marshaler, server ReplayServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetReplayRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + val, ok = pathParams["replay_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "replay_id") + } + + protoReq.ReplayId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "replay_id", err) + } + + msg, err := server.GetReplay(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterReplayServiceHandlerServer registers the http handlers for service ReplayService to "mux". +// UnaryRPC :call ReplayServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterReplayServiceHandlerFromEndpoint instead. +func RegisterReplayServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReplayServiceServer) error { + + mux.Handle("POST", pattern_ReplayService_Replay_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ReplayService/Replay", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/replay")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReplayService_Replay_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReplayService_Replay_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ReplayService_ReplayDryRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ReplayService/ReplayDryRun", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/replay-dry-run")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReplayService_ReplayDryRun_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReplayService_ReplayDryRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReplayService_ListReplay_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ReplayService/ListReplay", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/replay")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReplayService_ListReplay_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReplayService_ListReplay_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReplayService_GetReplay_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ReplayService/GetReplay", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/replay/{replay_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReplayService_GetReplay_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReplayService_GetReplay_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterReplayServiceHandlerFromEndpoint is same as RegisterReplayServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterReplayServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterReplayServiceHandler(ctx, mux, conn) +} + +// RegisterReplayServiceHandler registers the http handlers for service ReplayService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterReplayServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterReplayServiceHandlerClient(ctx, mux, NewReplayServiceClient(conn)) +} + +// RegisterReplayServiceHandlerClient registers the http handlers for service ReplayService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ReplayServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ReplayServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ReplayServiceClient" to call the correct interceptors. +func RegisterReplayServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReplayServiceClient) error { + + mux.Handle("POST", pattern_ReplayService_Replay_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ReplayService/Replay", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/replay")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReplayService_Replay_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReplayService_Replay_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ReplayService_ReplayDryRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ReplayService/ReplayDryRun", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/replay-dry-run")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReplayService_ReplayDryRun_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReplayService_ReplayDryRun_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReplayService_ListReplay_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ReplayService/ListReplay", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/replay")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReplayService_ListReplay_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReplayService_ListReplay_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReplayService_GetReplay_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ReplayService/GetReplay", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/replay/{replay_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReplayService_GetReplay_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReplayService_GetReplay_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ReplayService_Replay_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "project", "project_name", "replay"}, "")) + + pattern_ReplayService_ReplayDryRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "project", "project_name", "replay-dry-run"}, "")) + + pattern_ReplayService_ListReplay_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "project", "project_name", "replay"}, "")) + + pattern_ReplayService_GetReplay_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1beta1", "project", "project_name", "replay", "replay_id"}, "")) +) + +var ( + forward_ReplayService_Replay_0 = runtime.ForwardResponseMessage + + forward_ReplayService_ReplayDryRun_0 = runtime.ForwardResponseMessage + + forward_ReplayService_ListReplay_0 = runtime.ForwardResponseMessage + + forward_ReplayService_GetReplay_0 = runtime.ForwardResponseMessage +) diff --git a/protos/raystack/optimus/core/v1beta1/replay.swagger.json b/protos/raystack/optimus/core/v1beta1/replay.swagger.json new file mode 100644 index 0000000000..3f8c70f04b --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/replay.swagger.json @@ -0,0 +1,326 @@ +{ + "swagger": "2.0", + "info": { + "title": "raystack/optimus/core/v1beta1/replay.proto", + "version": "0.1" + }, + "tags": [ + { + "name": "ReplayService" + } + ], + "host": "127.0.0.1:9100", + "basePath": "/api", + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/v1beta1/project/{projectName}/replay": { + "get": { + "operationId": "ReplayService_ListReplay", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1ListReplayResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "projectName", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": ["ReplayService"] + }, + "post": { + "operationId": "ReplayService_Replay", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1ReplayResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "projectName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "jobName": { + "type": "string" + }, + "namespaceName": { + "type": "string" + }, + "startTime": { + "type": "string", + "format": "date-time" + }, + "endTime": { + "type": "string", + "format": "date-time" + }, + "parallel": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "jobConfig": { + "type": "string" + } + } + } + } + ], + "tags": ["ReplayService"] + } + }, + "/v1beta1/project/{projectName}/replay-dry-run": { + "post": { + "operationId": "ReplayService_ReplayDryRun", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1ReplayDryRunResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "projectName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "jobName": { + "type": "string" + }, + "namespaceName": { + "type": "string" + }, + "startTime": { + "type": "string", + "format": "date-time" + }, + "endTime": { + "type": "string", + "format": "date-time" + }, + "parallel": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "jobConfig": { + "type": "string" + } + } + } + } + ], + "tags": ["ReplayService"] + } + }, + "/v1beta1/project/{projectName}/replay/{replayId}": { + "get": { + "operationId": "ReplayService_GetReplay", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1GetReplayResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "projectName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "replayId", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": ["ReplayService"] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1beta1GetReplayResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "jobName": { + "type": "string" + }, + "status": { + "type": "string" + }, + "replayConfig": { + "$ref": "#/definitions/v1beta1ReplayConfig" + }, + "replayRuns": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1ReplayRun" + } + } + } + }, + "v1beta1ListReplayResponse": { + "type": "object", + "properties": { + "replays": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1GetReplayResponse" + } + } + } + }, + "v1beta1ReplayConfig": { + "type": "object", + "properties": { + "startTime": { + "type": "string", + "format": "date-time" + }, + "endTime": { + "type": "string", + "format": "date-time" + }, + "parallel": { + "type": "boolean" + }, + "jobConfig": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + } + } + }, + "v1beta1ReplayDryRunResponse": { + "type": "object", + "properties": { + "replayRuns": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1ReplayRun" + } + } + } + }, + "v1beta1ReplayResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "v1beta1ReplayRun": { + "type": "object", + "properties": { + "scheduledAt": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + } + } + }, + "externalDocs": { + "description": "Optimus Replay Service" + } +} diff --git a/protos/raystack/optimus/core/v1beta1/replay_grpc.pb.go b/protos/raystack/optimus/core/v1beta1/replay_grpc.pb.go new file mode 100644 index 0000000000..a6712ae40a --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/replay_grpc.pb.go @@ -0,0 +1,213 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: raystack/optimus/core/v1beta1/replay.proto + +package optimus + +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 + +// ReplayServiceClient is the client API for ReplayService 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 ReplayServiceClient interface { + Replay(ctx context.Context, in *ReplayRequest, opts ...grpc.CallOption) (*ReplayResponse, error) + ReplayDryRun(ctx context.Context, in *ReplayDryRunRequest, opts ...grpc.CallOption) (*ReplayDryRunResponse, error) + ListReplay(ctx context.Context, in *ListReplayRequest, opts ...grpc.CallOption) (*ListReplayResponse, error) + GetReplay(ctx context.Context, in *GetReplayRequest, opts ...grpc.CallOption) (*GetReplayResponse, error) +} + +type replayServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewReplayServiceClient(cc grpc.ClientConnInterface) ReplayServiceClient { + return &replayServiceClient{cc} +} + +func (c *replayServiceClient) Replay(ctx context.Context, in *ReplayRequest, opts ...grpc.CallOption) (*ReplayResponse, error) { + out := new(ReplayResponse) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ReplayService/Replay", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *replayServiceClient) ReplayDryRun(ctx context.Context, in *ReplayDryRunRequest, opts ...grpc.CallOption) (*ReplayDryRunResponse, error) { + out := new(ReplayDryRunResponse) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ReplayService/ReplayDryRun", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *replayServiceClient) ListReplay(ctx context.Context, in *ListReplayRequest, opts ...grpc.CallOption) (*ListReplayResponse, error) { + out := new(ListReplayResponse) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ReplayService/ListReplay", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *replayServiceClient) GetReplay(ctx context.Context, in *GetReplayRequest, opts ...grpc.CallOption) (*GetReplayResponse, error) { + out := new(GetReplayResponse) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ReplayService/GetReplay", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReplayServiceServer is the server API for ReplayService service. +// All implementations must embed UnimplementedReplayServiceServer +// for forward compatibility +type ReplayServiceServer interface { + Replay(context.Context, *ReplayRequest) (*ReplayResponse, error) + ReplayDryRun(context.Context, *ReplayDryRunRequest) (*ReplayDryRunResponse, error) + ListReplay(context.Context, *ListReplayRequest) (*ListReplayResponse, error) + GetReplay(context.Context, *GetReplayRequest) (*GetReplayResponse, error) + mustEmbedUnimplementedReplayServiceServer() +} + +// UnimplementedReplayServiceServer must be embedded to have forward compatible implementations. +type UnimplementedReplayServiceServer struct { +} + +func (UnimplementedReplayServiceServer) Replay(context.Context, *ReplayRequest) (*ReplayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Replay not implemented") +} +func (UnimplementedReplayServiceServer) ReplayDryRun(context.Context, *ReplayDryRunRequest) (*ReplayDryRunResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReplayDryRun not implemented") +} +func (UnimplementedReplayServiceServer) ListReplay(context.Context, *ListReplayRequest) (*ListReplayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListReplay not implemented") +} +func (UnimplementedReplayServiceServer) GetReplay(context.Context, *GetReplayRequest) (*GetReplayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetReplay not implemented") +} +func (UnimplementedReplayServiceServer) mustEmbedUnimplementedReplayServiceServer() {} + +// UnsafeReplayServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ReplayServiceServer will +// result in compilation errors. +type UnsafeReplayServiceServer interface { + mustEmbedUnimplementedReplayServiceServer() +} + +func RegisterReplayServiceServer(s grpc.ServiceRegistrar, srv ReplayServiceServer) { + s.RegisterService(&ReplayService_ServiceDesc, srv) +} + +func _ReplayService_Replay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReplayRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReplayServiceServer).Replay(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/raystack.optimus.core.v1beta1.ReplayService/Replay", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReplayServiceServer).Replay(ctx, req.(*ReplayRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReplayService_ReplayDryRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReplayDryRunRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReplayServiceServer).ReplayDryRun(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/raystack.optimus.core.v1beta1.ReplayService/ReplayDryRun", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReplayServiceServer).ReplayDryRun(ctx, req.(*ReplayDryRunRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReplayService_ListReplay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReplayRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReplayServiceServer).ListReplay(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/raystack.optimus.core.v1beta1.ReplayService/ListReplay", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReplayServiceServer).ListReplay(ctx, req.(*ListReplayRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReplayService_GetReplay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetReplayRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReplayServiceServer).GetReplay(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/raystack.optimus.core.v1beta1.ReplayService/GetReplay", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReplayServiceServer).GetReplay(ctx, req.(*GetReplayRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ReplayService_ServiceDesc is the grpc.ServiceDesc for ReplayService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ReplayService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "raystack.optimus.core.v1beta1.ReplayService", + HandlerType: (*ReplayServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Replay", + Handler: _ReplayService_Replay_Handler, + }, + { + MethodName: "ReplayDryRun", + Handler: _ReplayService_ReplayDryRun_Handler, + }, + { + MethodName: "ListReplay", + Handler: _ReplayService_ListReplay_Handler, + }, + { + MethodName: "GetReplay", + Handler: _ReplayService_GetReplay_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "raystack/optimus/core/v1beta1/replay.proto", +} diff --git a/protos/raystack/optimus/core/v1beta1/resource.pb.go b/protos/raystack/optimus/core/v1beta1/resource.pb.go new file mode 100644 index 0000000000..0cd90a6b12 --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/resource.pb.go @@ -0,0 +1,1616 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/core/v1beta1/resource.proto + +package optimus + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" +) + +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 DeployResourceSpecificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + Resources []*ResourceSpecification `protobuf:"bytes,3,rep,name=resources,proto3" json:"resources,omitempty"` + NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` +} + +func (x *DeployResourceSpecificationRequest) Reset() { + *x = DeployResourceSpecificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeployResourceSpecificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployResourceSpecificationRequest) ProtoMessage() {} + +func (x *DeployResourceSpecificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 DeployResourceSpecificationRequest.ProtoReflect.Descriptor instead. +func (*DeployResourceSpecificationRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{0} +} + +func (x *DeployResourceSpecificationRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *DeployResourceSpecificationRequest) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *DeployResourceSpecificationRequest) GetResources() []*ResourceSpecification { + if x != nil { + return x.Resources + } + return nil +} + +func (x *DeployResourceSpecificationRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +type DeployResourceSpecificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LogStatus *Log `protobuf:"bytes,5,opt,name=log_status,json=logStatus,proto3" json:"log_status,omitempty"` +} + +func (x *DeployResourceSpecificationResponse) Reset() { + *x = DeployResourceSpecificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeployResourceSpecificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployResourceSpecificationResponse) ProtoMessage() {} + +func (x *DeployResourceSpecificationResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 DeployResourceSpecificationResponse.ProtoReflect.Descriptor instead. +func (*DeployResourceSpecificationResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{1} +} + +func (x *DeployResourceSpecificationResponse) GetLogStatus() *Log { + if x != nil { + return x.LogStatus + } + return nil +} + +// ListResourceSpecificationRequest lists all resource specifications of a datastore in project +type ListResourceSpecificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` +} + +func (x *ListResourceSpecificationRequest) Reset() { + *x = ListResourceSpecificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResourceSpecificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResourceSpecificationRequest) ProtoMessage() {} + +func (x *ListResourceSpecificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 ListResourceSpecificationRequest.ProtoReflect.Descriptor instead. +func (*ListResourceSpecificationRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{2} +} + +func (x *ListResourceSpecificationRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *ListResourceSpecificationRequest) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *ListResourceSpecificationRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +type ListResourceSpecificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resources []*ResourceSpecification `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` +} + +func (x *ListResourceSpecificationResponse) Reset() { + *x = ListResourceSpecificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResourceSpecificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResourceSpecificationResponse) ProtoMessage() {} + +func (x *ListResourceSpecificationResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 ListResourceSpecificationResponse.ProtoReflect.Descriptor instead. +func (*ListResourceSpecificationResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{3} +} + +func (x *ListResourceSpecificationResponse) GetResources() []*ResourceSpecification { + if x != nil { + return x.Resources + } + return nil +} + +type CreateResourceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + Resource *ResourceSpecification `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` + NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` +} + +func (x *CreateResourceRequest) Reset() { + *x = CreateResourceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResourceRequest) ProtoMessage() {} + +func (x *CreateResourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 CreateResourceRequest.ProtoReflect.Descriptor instead. +func (*CreateResourceRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateResourceRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *CreateResourceRequest) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *CreateResourceRequest) GetResource() *ResourceSpecification { + if x != nil { + return x.Resource + } + return nil +} + +func (x *CreateResourceRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +type CreateResourceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *CreateResourceResponse) Reset() { + *x = CreateResourceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResourceResponse) ProtoMessage() {} + +func (x *CreateResourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 CreateResourceResponse.ProtoReflect.Descriptor instead. +func (*CreateResourceResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateResourceResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *CreateResourceResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type ReadResourceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + ResourceName string `protobuf:"bytes,3,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` + NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` +} + +func (x *ReadResourceRequest) Reset() { + *x = ReadResourceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadResourceRequest) ProtoMessage() {} + +func (x *ReadResourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 ReadResourceRequest.ProtoReflect.Descriptor instead. +func (*ReadResourceRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{6} +} + +func (x *ReadResourceRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *ReadResourceRequest) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *ReadResourceRequest) GetResourceName() string { + if x != nil { + return x.ResourceName + } + return "" +} + +func (x *ReadResourceRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +type ReadResourceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Resource *ResourceSpecification `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` +} + +func (x *ReadResourceResponse) Reset() { + *x = ReadResourceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadResourceResponse) ProtoMessage() {} + +func (x *ReadResourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 ReadResourceResponse.ProtoReflect.Descriptor instead. +func (*ReadResourceResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{7} +} + +func (x *ReadResourceResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *ReadResourceResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *ReadResourceResponse) GetResource() *ResourceSpecification { + if x != nil { + return x.Resource + } + return nil +} + +type UpdateResourceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + DatastoreName string `protobuf:"bytes,2,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + Resource *ResourceSpecification `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` + NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` +} + +func (x *UpdateResourceRequest) Reset() { + *x = UpdateResourceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateResourceRequest) ProtoMessage() {} + +func (x *UpdateResourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 UpdateResourceRequest.ProtoReflect.Descriptor instead. +func (*UpdateResourceRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateResourceRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *UpdateResourceRequest) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *UpdateResourceRequest) GetResource() *ResourceSpecification { + if x != nil { + return x.Resource + } + return nil +} + +func (x *UpdateResourceRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +type UpdateResourceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *UpdateResourceResponse) Reset() { + *x = UpdateResourceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateResourceResponse) ProtoMessage() {} + +func (x *UpdateResourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 UpdateResourceResponse.ProtoReflect.Descriptor instead. +func (*UpdateResourceResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateResourceResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *UpdateResourceResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// ResourceSpecification are datastore specification representation of a resource +type ResourceSpecification struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` + Spec *structpb.Struct `protobuf:"bytes,5,opt,name=spec,proto3" json:"spec,omitempty"` + Assets map[string]string `protobuf:"bytes,6,rep,name=assets,proto3" json:"assets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ResourceSpecification) Reset() { + *x = ResourceSpecification{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceSpecification) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceSpecification) ProtoMessage() {} + +func (x *ResourceSpecification) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 ResourceSpecification.ProtoReflect.Descriptor instead. +func (*ResourceSpecification) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{10} +} + +func (x *ResourceSpecification) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *ResourceSpecification) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ResourceSpecification) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *ResourceSpecification) GetSpec() *structpb.Struct { + if x != nil { + return x.Spec + } + return nil +} + +func (x *ResourceSpecification) GetAssets() map[string]string { + if x != nil { + return x.Assets + } + return nil +} + +func (x *ResourceSpecification) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +type ChangeResourceNamespaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + DatastoreName string `protobuf:"bytes,3,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + ResourceName string `protobuf:"bytes,4,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` + NewNamespaceName string `protobuf:"bytes,5,opt,name=new_namespace_name,json=newNamespaceName,proto3" json:"new_namespace_name,omitempty"` +} + +func (x *ChangeResourceNamespaceRequest) Reset() { + *x = ChangeResourceNamespaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeResourceNamespaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeResourceNamespaceRequest) ProtoMessage() {} + +func (x *ChangeResourceNamespaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 ChangeResourceNamespaceRequest.ProtoReflect.Descriptor instead. +func (*ChangeResourceNamespaceRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{11} +} + +func (x *ChangeResourceNamespaceRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *ChangeResourceNamespaceRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *ChangeResourceNamespaceRequest) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *ChangeResourceNamespaceRequest) GetResourceName() string { + if x != nil { + return x.ResourceName + } + return "" +} + +func (x *ChangeResourceNamespaceRequest) GetNewNamespaceName() string { + if x != nil { + return x.NewNamespaceName + } + return "" +} + +type ChangeResourceNamespaceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChangeResourceNamespaceResponse) Reset() { + *x = ChangeResourceNamespaceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeResourceNamespaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeResourceNamespaceResponse) ProtoMessage() {} + +func (x *ChangeResourceNamespaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 ChangeResourceNamespaceResponse.ProtoReflect.Descriptor instead. +func (*ChangeResourceNamespaceResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{12} +} + +type ApplyResourcesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + DatastoreName string `protobuf:"bytes,3,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + ResourceNames []string `protobuf:"bytes,4,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"` +} + +func (x *ApplyResourcesRequest) Reset() { + *x = ApplyResourcesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyResourcesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyResourcesRequest) ProtoMessage() {} + +func (x *ApplyResourcesRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 ApplyResourcesRequest.ProtoReflect.Descriptor instead. +func (*ApplyResourcesRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{13} +} + +func (x *ApplyResourcesRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *ApplyResourcesRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *ApplyResourcesRequest) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *ApplyResourcesRequest) GetResourceNames() []string { + if x != nil { + return x.ResourceNames + } + return nil +} + +type ApplyResourcesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Statuses []*ApplyResourcesResponse_ResourceStatus `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"` +} + +func (x *ApplyResourcesResponse) Reset() { + *x = ApplyResourcesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyResourcesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyResourcesResponse) ProtoMessage() {} + +func (x *ApplyResourcesResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 ApplyResourcesResponse.ProtoReflect.Descriptor instead. +func (*ApplyResourcesResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{14} +} + +func (x *ApplyResourcesResponse) GetStatuses() []*ApplyResourcesResponse_ResourceStatus { + if x != nil { + return x.Statuses + } + return nil +} + +type ApplyResourcesResponse_ResourceStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (x *ApplyResourcesResponse_ResourceStatus) Reset() { + *x = ApplyResourcesResponse_ResourceStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyResourcesResponse_ResourceStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyResourcesResponse_ResourceStatus) ProtoMessage() {} + +func (x *ApplyResourcesResponse_ResourceStatus) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_resource_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 ApplyResourcesResponse_ResourceStatus.ProtoReflect.Descriptor instead. +func (*ApplyResourcesResponse_ResourceStatus) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP(), []int{14, 0} +} + +func (x *ApplyResourcesResponse_ResourceStatus) GetResourceName() string { + if x != nil { + return x.ResourceName + } + return "" +} + +func (x *ApplyResourcesResponse_ResourceStatus) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *ApplyResourcesResponse_ResourceStatus) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +var File_raystack_optimus_core_v1beta1_resource_proto protoreflect.FileDescriptor + +var file_raystack_optimus_core_v1beta1_resource_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x20, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2d, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xec, + 0x01, 0x0a, 0x22, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x55, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x71, 0x0a, + 0x23, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, + 0x09, 0x6c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x05, + 0x22, 0x93, 0x01, 0x0a, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x7a, 0x0a, 0x21, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x09, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x22, 0xdd, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0xab, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, + 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x9f, + 0x01, 0x0a, 0x14, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x22, 0xdd, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, + 0x0e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x22, 0x4c, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xbc, + 0x03, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 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, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x5b, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x07, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x41, 0x73, 0x73, 0x65, 0x74, 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, 0x1a, 0x39, 0x0a, 0x0b, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xe4, 0x01, + 0x0a, 0x1e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, + 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x77, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x10, 0x6e, 0x65, 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x21, 0x0a, 0x1f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaf, 0x01, 0x0a, 0x15, 0x41, 0x70, 0x70, 0x6c, + 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64, + 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x16, 0x41, 0x70, + 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x47, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x1a, 0x65, 0x0a, 0x0e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x32, 0x8c, 0x0d, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0xb0, 0x01, 0x0a, 0x1b, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x45, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, + 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x8c, 0x02, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x43, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x66, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x60, 0x12, 0x5e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, + 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0xee, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x69, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x63, 0x22, 0x5e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, + 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0xf5, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x76, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x70, 0x12, + 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, + 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, + 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, + 0xee, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x69, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x63, 0x1a, 0x5e, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, + 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x01, 0x2a, + 0x12, 0xe4, 0x01, 0x0a, 0x17, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x40, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x22, 0x39, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x2d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0xf5, 0x01, 0x0a, 0x0e, 0x41, 0x70, 0x70, 0x6c, + 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x70, + 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x70, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x6a, 0x22, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x7b, 0x64, 0x61, 0x74, + 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2d, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x3a, 0x01, 0x2a, 0x42, + 0xa4, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x42, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, 0x41, 0x47, 0x12, + 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, + 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, + 0x25, 0x0a, 0x23, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x20, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_raystack_optimus_core_v1beta1_resource_proto_rawDescOnce sync.Once + file_raystack_optimus_core_v1beta1_resource_proto_rawDescData = file_raystack_optimus_core_v1beta1_resource_proto_rawDesc +) + +func file_raystack_optimus_core_v1beta1_resource_proto_rawDescGZIP() []byte { + file_raystack_optimus_core_v1beta1_resource_proto_rawDescOnce.Do(func() { + file_raystack_optimus_core_v1beta1_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_core_v1beta1_resource_proto_rawDescData) + }) + return file_raystack_optimus_core_v1beta1_resource_proto_rawDescData +} + +var file_raystack_optimus_core_v1beta1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_raystack_optimus_core_v1beta1_resource_proto_goTypes = []interface{}{ + (*DeployResourceSpecificationRequest)(nil), // 0: raystack.optimus.core.v1beta1.DeployResourceSpecificationRequest + (*DeployResourceSpecificationResponse)(nil), // 1: raystack.optimus.core.v1beta1.DeployResourceSpecificationResponse + (*ListResourceSpecificationRequest)(nil), // 2: raystack.optimus.core.v1beta1.ListResourceSpecificationRequest + (*ListResourceSpecificationResponse)(nil), // 3: raystack.optimus.core.v1beta1.ListResourceSpecificationResponse + (*CreateResourceRequest)(nil), // 4: raystack.optimus.core.v1beta1.CreateResourceRequest + (*CreateResourceResponse)(nil), // 5: raystack.optimus.core.v1beta1.CreateResourceResponse + (*ReadResourceRequest)(nil), // 6: raystack.optimus.core.v1beta1.ReadResourceRequest + (*ReadResourceResponse)(nil), // 7: raystack.optimus.core.v1beta1.ReadResourceResponse + (*UpdateResourceRequest)(nil), // 8: raystack.optimus.core.v1beta1.UpdateResourceRequest + (*UpdateResourceResponse)(nil), // 9: raystack.optimus.core.v1beta1.UpdateResourceResponse + (*ResourceSpecification)(nil), // 10: raystack.optimus.core.v1beta1.ResourceSpecification + (*ChangeResourceNamespaceRequest)(nil), // 11: raystack.optimus.core.v1beta1.ChangeResourceNamespaceRequest + (*ChangeResourceNamespaceResponse)(nil), // 12: raystack.optimus.core.v1beta1.ChangeResourceNamespaceResponse + (*ApplyResourcesRequest)(nil), // 13: raystack.optimus.core.v1beta1.ApplyResourcesRequest + (*ApplyResourcesResponse)(nil), // 14: raystack.optimus.core.v1beta1.ApplyResourcesResponse + nil, // 15: raystack.optimus.core.v1beta1.ResourceSpecification.AssetsEntry + nil, // 16: raystack.optimus.core.v1beta1.ResourceSpecification.LabelsEntry + (*ApplyResourcesResponse_ResourceStatus)(nil), // 17: raystack.optimus.core.v1beta1.ApplyResourcesResponse.ResourceStatus + (*Log)(nil), // 18: raystack.optimus.core.v1beta1.Log + (*structpb.Struct)(nil), // 19: google.protobuf.Struct +} +var file_raystack_optimus_core_v1beta1_resource_proto_depIdxs = []int32{ + 10, // 0: raystack.optimus.core.v1beta1.DeployResourceSpecificationRequest.resources:type_name -> raystack.optimus.core.v1beta1.ResourceSpecification + 18, // 1: raystack.optimus.core.v1beta1.DeployResourceSpecificationResponse.log_status:type_name -> raystack.optimus.core.v1beta1.Log + 10, // 2: raystack.optimus.core.v1beta1.ListResourceSpecificationResponse.resources:type_name -> raystack.optimus.core.v1beta1.ResourceSpecification + 10, // 3: raystack.optimus.core.v1beta1.CreateResourceRequest.resource:type_name -> raystack.optimus.core.v1beta1.ResourceSpecification + 10, // 4: raystack.optimus.core.v1beta1.ReadResourceResponse.resource:type_name -> raystack.optimus.core.v1beta1.ResourceSpecification + 10, // 5: raystack.optimus.core.v1beta1.UpdateResourceRequest.resource:type_name -> raystack.optimus.core.v1beta1.ResourceSpecification + 19, // 6: raystack.optimus.core.v1beta1.ResourceSpecification.spec:type_name -> google.protobuf.Struct + 15, // 7: raystack.optimus.core.v1beta1.ResourceSpecification.assets:type_name -> raystack.optimus.core.v1beta1.ResourceSpecification.AssetsEntry + 16, // 8: raystack.optimus.core.v1beta1.ResourceSpecification.labels:type_name -> raystack.optimus.core.v1beta1.ResourceSpecification.LabelsEntry + 17, // 9: raystack.optimus.core.v1beta1.ApplyResourcesResponse.statuses:type_name -> raystack.optimus.core.v1beta1.ApplyResourcesResponse.ResourceStatus + 0, // 10: raystack.optimus.core.v1beta1.ResourceService.DeployResourceSpecification:input_type -> raystack.optimus.core.v1beta1.DeployResourceSpecificationRequest + 2, // 11: raystack.optimus.core.v1beta1.ResourceService.ListResourceSpecification:input_type -> raystack.optimus.core.v1beta1.ListResourceSpecificationRequest + 4, // 12: raystack.optimus.core.v1beta1.ResourceService.CreateResource:input_type -> raystack.optimus.core.v1beta1.CreateResourceRequest + 6, // 13: raystack.optimus.core.v1beta1.ResourceService.ReadResource:input_type -> raystack.optimus.core.v1beta1.ReadResourceRequest + 8, // 14: raystack.optimus.core.v1beta1.ResourceService.UpdateResource:input_type -> raystack.optimus.core.v1beta1.UpdateResourceRequest + 11, // 15: raystack.optimus.core.v1beta1.ResourceService.ChangeResourceNamespace:input_type -> raystack.optimus.core.v1beta1.ChangeResourceNamespaceRequest + 13, // 16: raystack.optimus.core.v1beta1.ResourceService.ApplyResources:input_type -> raystack.optimus.core.v1beta1.ApplyResourcesRequest + 1, // 17: raystack.optimus.core.v1beta1.ResourceService.DeployResourceSpecification:output_type -> raystack.optimus.core.v1beta1.DeployResourceSpecificationResponse + 3, // 18: raystack.optimus.core.v1beta1.ResourceService.ListResourceSpecification:output_type -> raystack.optimus.core.v1beta1.ListResourceSpecificationResponse + 5, // 19: raystack.optimus.core.v1beta1.ResourceService.CreateResource:output_type -> raystack.optimus.core.v1beta1.CreateResourceResponse + 7, // 20: raystack.optimus.core.v1beta1.ResourceService.ReadResource:output_type -> raystack.optimus.core.v1beta1.ReadResourceResponse + 9, // 21: raystack.optimus.core.v1beta1.ResourceService.UpdateResource:output_type -> raystack.optimus.core.v1beta1.UpdateResourceResponse + 12, // 22: raystack.optimus.core.v1beta1.ResourceService.ChangeResourceNamespace:output_type -> raystack.optimus.core.v1beta1.ChangeResourceNamespaceResponse + 14, // 23: raystack.optimus.core.v1beta1.ResourceService.ApplyResources:output_type -> raystack.optimus.core.v1beta1.ApplyResourcesResponse + 17, // [17:24] is the sub-list for method output_type + 10, // [10:17] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_raystack_optimus_core_v1beta1_resource_proto_init() } +func file_raystack_optimus_core_v1beta1_resource_proto_init() { + if File_raystack_optimus_core_v1beta1_resource_proto != nil { + return + } + file_raystack_optimus_core_v1beta1_status_proto_init() + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeployResourceSpecificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeployResourceSpecificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResourceSpecificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResourceSpecificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateResourceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateResourceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadResourceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadResourceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateResourceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateResourceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceSpecification); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeResourceNamespaceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeResourceNamespaceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyResourcesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyResourcesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_resource_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyResourcesResponse_ResourceStatus); 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_raystack_optimus_core_v1beta1_resource_proto_rawDesc, + NumEnums: 0, + NumMessages: 18, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_raystack_optimus_core_v1beta1_resource_proto_goTypes, + DependencyIndexes: file_raystack_optimus_core_v1beta1_resource_proto_depIdxs, + MessageInfos: file_raystack_optimus_core_v1beta1_resource_proto_msgTypes, + }.Build() + File_raystack_optimus_core_v1beta1_resource_proto = out.File + file_raystack_optimus_core_v1beta1_resource_proto_rawDesc = nil + file_raystack_optimus_core_v1beta1_resource_proto_goTypes = nil + file_raystack_optimus_core_v1beta1_resource_proto_depIdxs = nil +} diff --git a/protos/odpf/optimus/core/v1beta1/resource.pb.gw.go b/protos/raystack/optimus/core/v1beta1/resource.pb.gw.go similarity index 66% rename from protos/odpf/optimus/core/v1beta1/resource.pb.gw.go rename to protos/raystack/optimus/core/v1beta1/resource.pb.gw.go index a696ec1930..816b3ce15b 100644 --- a/protos/odpf/optimus/core/v1beta1/resource.pb.gw.go +++ b/protos/raystack/optimus/core/v1beta1/resource.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: odpf/optimus/core/v1beta1/resource.proto +// source: raystack/optimus/core/v1beta1/resource.proto /* Package optimus is a reverse proxy. @@ -451,6 +451,182 @@ func local_request_ResourceService_UpdateResource_0(ctx context.Context, marshal } +func request_ResourceService_ChangeResourceNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ChangeResourceNamespaceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + msg, err := client.ChangeResourceNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ResourceService_ChangeResourceNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ChangeResourceNamespaceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + msg, err := server.ChangeResourceNamespace(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ResourceService_ApplyResources_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ApplyResourcesRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + val, ok = pathParams["namespace_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace_name") + } + + protoReq.NamespaceName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace_name", err) + } + + val, ok = pathParams["datastore_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "datastore_name") + } + + protoReq.DatastoreName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "datastore_name", err) + } + + msg, err := client.ApplyResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ResourceService_ApplyResources_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ApplyResourcesRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["project_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_name") + } + + protoReq.ProjectName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_name", err) + } + + val, ok = pathParams["namespace_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace_name") + } + + protoReq.NamespaceName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace_name", err) + } + + val, ok = pathParams["datastore_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "datastore_name") + } + + protoReq.DatastoreName, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "datastore_name", err) + } + + msg, err := server.ApplyResources(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterResourceServiceHandlerServer registers the http handlers for service ResourceService to "mux". // UnaryRPC :call ResourceServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -463,7 +639,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ResourceService/ListResourceSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/ListResourceSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -486,7 +662,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ResourceService/CreateResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/CreateResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -509,7 +685,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ResourceService/ReadResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource/{resource_name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/ReadResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource/{resource_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -532,7 +708,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -549,6 +725,52 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv }) + mux.Handle("POST", pattern_ResourceService_ChangeResourceNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/ChangeResourceNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/change-resource-namespace")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ResourceService_ChangeResourceNamespace_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ResourceService_ChangeResourceNamespace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ResourceService_ApplyResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/ApplyResources", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resources-apply")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ResourceService_ApplyResources_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ResourceService_ApplyResources_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -594,7 +816,7 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ResourceService/ListResourceSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/ListResourceSpecification", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -614,7 +836,7 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ResourceService/CreateResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/CreateResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -634,7 +856,7 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ResourceService/ReadResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource/{resource_name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/ReadResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource/{resource_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -654,7 +876,7 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resource")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -670,6 +892,46 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv }) + mux.Handle("POST", pattern_ResourceService_ChangeResourceNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/ChangeResourceNamespace", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/change-resource-namespace")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ResourceService_ChangeResourceNamespace_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ResourceService_ChangeResourceNamespace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ResourceService_ApplyResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.ResourceService/ApplyResources", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resources-apply")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ResourceService_ApplyResources_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ResourceService_ApplyResources_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -681,6 +943,10 @@ var ( pattern_ResourceService_ReadResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"v1beta1", "project", "project_name", "namespace", "namespace_name", "datastore", "datastore_name", "resource", "resource_name"}, "")) pattern_ResourceService_UpdateResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"v1beta1", "project", "project_name", "namespace", "namespace_name", "datastore", "datastore_name", "resource"}, "")) + + pattern_ResourceService_ChangeResourceNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "project", "project_name", "change-resource-namespace"}, "")) + + pattern_ResourceService_ApplyResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"v1beta1", "project", "project_name", "namespace", "namespace_name", "datastore", "datastore_name", "resources-apply"}, "")) ) var ( @@ -691,4 +957,8 @@ var ( forward_ResourceService_ReadResource_0 = runtime.ForwardResponseMessage forward_ResourceService_UpdateResource_0 = runtime.ForwardResponseMessage + + forward_ResourceService_ChangeResourceNamespace_0 = runtime.ForwardResponseMessage + + forward_ResourceService_ApplyResources_0 = runtime.ForwardResponseMessage ) diff --git a/protos/odpf/optimus/core/v1beta1/resource.swagger.json b/protos/raystack/optimus/core/v1beta1/resource.swagger.json similarity index 69% rename from protos/odpf/optimus/core/v1beta1/resource.swagger.json rename to protos/raystack/optimus/core/v1beta1/resource.swagger.json index 1811909197..3b202e08ac 100644 --- a/protos/odpf/optimus/core/v1beta1/resource.swagger.json +++ b/protos/raystack/optimus/core/v1beta1/resource.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/core/v1beta1/resource.proto", + "title": "raystack/optimus/core/v1beta1/resource.proto", "version": "0.1" }, "tags": [ @@ -11,16 +11,61 @@ ], "host": "127.0.0.1:9100", "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { + "/v1beta1/project/{projectName}/change-resource-namespace": { + "post": { + "summary": "ChangeJobNamespace move a job spec from one namespace to another", + "operationId": "ResourceService_ChangeResourceNamespace", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1ChangeResourceNamespaceResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "projectName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "namespaceName": { + "type": "string" + }, + "datastoreName": { + "type": "string" + }, + "resourceName": { + "type": "string" + }, + "newNamespaceName": { + "type": "string" + } + } + } + } + ], + "tags": ["ResourceService"] + } + }, "/v1beta1/project/{projectName}/namespace/{namespaceName}/datastore/{datastoreName}/resource": { "get": { "summary": "ListResourceSpecification lists all resource specifications of a datastore in project", @@ -59,9 +104,7 @@ "type": "string" } ], - "tags": [ - "ResourceService" - ] + "tags": ["ResourceService"] }, "post": { "summary": "Database CRUD\nCreateResource registers a new resource of a namespace which belongs to a project", @@ -113,9 +156,7 @@ } } ], - "tags": [ - "ResourceService" - ] + "tags": ["ResourceService"] }, "put": { "summary": "UpdateResource updates a resource specification of a datastore in project", @@ -167,9 +208,7 @@ } } ], - "tags": [ - "ResourceService" - ] + "tags": ["ResourceService"] } }, "/v1beta1/project/{projectName}/namespace/{namespaceName}/datastore/{datastoreName}/resource/{resourceName}": { @@ -216,13 +255,82 @@ "type": "string" } ], - "tags": [ - "ResourceService" - ] + "tags": ["ResourceService"] + } + }, + "/v1beta1/project/{projectName}/namespace/{namespaceName}/datastore/{datastoreName}/resources-apply": { + "post": { + "summary": "apply a resource from optimus to datastore", + "operationId": "ResourceService_ApplyResources", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1ApplyResourcesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "projectName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "namespaceName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "datastoreName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "resourceNames": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ], + "tags": ["ResourceService"] } } }, "definitions": { + "ApplyResourcesResponseResourceStatus": { + "type": "object", + "properties": { + "resourceName": { + "type": "string" + }, + "status": { + "type": "string" + }, + "reason": { + "type": "string" + } + } + }, "protobufAny": { "type": "object", "properties": { @@ -237,9 +345,7 @@ }, "protobufNullValue": { "type": "string", - "enum": [ - "NULL_VALUE" - ], + "enum": ["NULL_VALUE"], "default": "NULL_VALUE", "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." }, @@ -261,6 +367,20 @@ } } }, + "v1beta1ApplyResourcesResponse": { + "type": "object", + "properties": { + "statuses": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplyResourcesResponseResourceStatus" + } + } + } + }, + "v1beta1ChangeResourceNamespaceResponse": { + "type": "object" + }, "v1beta1CreateResourceResponse": { "type": "object", "properties": { diff --git a/protos/odpf/optimus/core/v1beta1/resource_grpc.pb.go b/protos/raystack/optimus/core/v1beta1/resource_grpc.pb.go similarity index 71% rename from protos/odpf/optimus/core/v1beta1/resource_grpc.pb.go rename to protos/raystack/optimus/core/v1beta1/resource_grpc.pb.go index 72d6bf37b3..4f43dc88dc 100644 --- a/protos/odpf/optimus/core/v1beta1/resource_grpc.pb.go +++ b/protos/raystack/optimus/core/v1beta1/resource_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: odpf/optimus/core/v1beta1/resource.proto +// source: raystack/optimus/core/v1beta1/resource.proto package optimus @@ -34,6 +34,10 @@ type ResourceServiceClient interface { ReadResource(ctx context.Context, in *ReadResourceRequest, opts ...grpc.CallOption) (*ReadResourceResponse, error) // UpdateResource updates a resource specification of a datastore in project UpdateResource(ctx context.Context, in *UpdateResourceRequest, opts ...grpc.CallOption) (*UpdateResourceResponse, error) + // ChangeJobNamespace move a job spec from one namespace to another + ChangeResourceNamespace(ctx context.Context, in *ChangeResourceNamespaceRequest, opts ...grpc.CallOption) (*ChangeResourceNamespaceResponse, error) + // apply a resource from optimus to datastore + ApplyResources(ctx context.Context, in *ApplyResourcesRequest, opts ...grpc.CallOption) (*ApplyResourcesResponse, error) } type resourceServiceClient struct { @@ -45,7 +49,7 @@ func NewResourceServiceClient(cc grpc.ClientConnInterface) ResourceServiceClient } func (c *resourceServiceClient) DeployResourceSpecification(ctx context.Context, opts ...grpc.CallOption) (ResourceService_DeployResourceSpecificationClient, error) { - stream, err := c.cc.NewStream(ctx, &ResourceService_ServiceDesc.Streams[0], "/odpf.optimus.core.v1beta1.ResourceService/DeployResourceSpecification", opts...) + stream, err := c.cc.NewStream(ctx, &ResourceService_ServiceDesc.Streams[0], "/raystack.optimus.core.v1beta1.ResourceService/DeployResourceSpecification", opts...) if err != nil { return nil, err } @@ -77,7 +81,7 @@ func (x *resourceServiceDeployResourceSpecificationClient) Recv() (*DeployResour func (c *resourceServiceClient) ListResourceSpecification(ctx context.Context, in *ListResourceSpecificationRequest, opts ...grpc.CallOption) (*ListResourceSpecificationResponse, error) { out := new(ListResourceSpecificationResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.ResourceService/ListResourceSpecification", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ResourceService/ListResourceSpecification", in, out, opts...) if err != nil { return nil, err } @@ -86,7 +90,7 @@ func (c *resourceServiceClient) ListResourceSpecification(ctx context.Context, i func (c *resourceServiceClient) CreateResource(ctx context.Context, in *CreateResourceRequest, opts ...grpc.CallOption) (*CreateResourceResponse, error) { out := new(CreateResourceResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.ResourceService/CreateResource", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ResourceService/CreateResource", in, out, opts...) if err != nil { return nil, err } @@ -95,7 +99,7 @@ func (c *resourceServiceClient) CreateResource(ctx context.Context, in *CreateRe func (c *resourceServiceClient) ReadResource(ctx context.Context, in *ReadResourceRequest, opts ...grpc.CallOption) (*ReadResourceResponse, error) { out := new(ReadResourceResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.ResourceService/ReadResource", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ResourceService/ReadResource", in, out, opts...) if err != nil { return nil, err } @@ -104,7 +108,25 @@ func (c *resourceServiceClient) ReadResource(ctx context.Context, in *ReadResour func (c *resourceServiceClient) UpdateResource(ctx context.Context, in *UpdateResourceRequest, opts ...grpc.CallOption) (*UpdateResourceResponse, error) { out := new(UpdateResourceResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.ResourceService/UpdateResource", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ResourceService/UpdateResource", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *resourceServiceClient) ChangeResourceNamespace(ctx context.Context, in *ChangeResourceNamespaceRequest, opts ...grpc.CallOption) (*ChangeResourceNamespaceResponse, error) { + out := new(ChangeResourceNamespaceResponse) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ResourceService/ChangeResourceNamespace", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *resourceServiceClient) ApplyResources(ctx context.Context, in *ApplyResourcesRequest, opts ...grpc.CallOption) (*ApplyResourcesResponse, error) { + out := new(ApplyResourcesResponse) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.ResourceService/ApplyResources", in, out, opts...) if err != nil { return nil, err } @@ -127,6 +149,10 @@ type ResourceServiceServer interface { ReadResource(context.Context, *ReadResourceRequest) (*ReadResourceResponse, error) // UpdateResource updates a resource specification of a datastore in project UpdateResource(context.Context, *UpdateResourceRequest) (*UpdateResourceResponse, error) + // ChangeJobNamespace move a job spec from one namespace to another + ChangeResourceNamespace(context.Context, *ChangeResourceNamespaceRequest) (*ChangeResourceNamespaceResponse, error) + // apply a resource from optimus to datastore + ApplyResources(context.Context, *ApplyResourcesRequest) (*ApplyResourcesResponse, error) mustEmbedUnimplementedResourceServiceServer() } @@ -149,6 +175,12 @@ func (UnimplementedResourceServiceServer) ReadResource(context.Context, *ReadRes func (UnimplementedResourceServiceServer) UpdateResource(context.Context, *UpdateResourceRequest) (*UpdateResourceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateResource not implemented") } +func (UnimplementedResourceServiceServer) ChangeResourceNamespace(context.Context, *ChangeResourceNamespaceRequest) (*ChangeResourceNamespaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangeResourceNamespace not implemented") +} +func (UnimplementedResourceServiceServer) ApplyResources(context.Context, *ApplyResourcesRequest) (*ApplyResourcesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ApplyResources not implemented") +} func (UnimplementedResourceServiceServer) mustEmbedUnimplementedResourceServiceServer() {} // UnsafeResourceServiceServer may be embedded to opt out of forward compatibility for this service. @@ -198,7 +230,7 @@ func _ResourceService_ListResourceSpecification_Handler(srv interface{}, ctx con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.ResourceService/ListResourceSpecification", + FullMethod: "/raystack.optimus.core.v1beta1.ResourceService/ListResourceSpecification", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).ListResourceSpecification(ctx, req.(*ListResourceSpecificationRequest)) @@ -216,7 +248,7 @@ func _ResourceService_CreateResource_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.ResourceService/CreateResource", + FullMethod: "/raystack.optimus.core.v1beta1.ResourceService/CreateResource", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).CreateResource(ctx, req.(*CreateResourceRequest)) @@ -234,7 +266,7 @@ func _ResourceService_ReadResource_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.ResourceService/ReadResource", + FullMethod: "/raystack.optimus.core.v1beta1.ResourceService/ReadResource", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).ReadResource(ctx, req.(*ReadResourceRequest)) @@ -252,7 +284,7 @@ func _ResourceService_UpdateResource_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.ResourceService/UpdateResource", + FullMethod: "/raystack.optimus.core.v1beta1.ResourceService/UpdateResource", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).UpdateResource(ctx, req.(*UpdateResourceRequest)) @@ -260,11 +292,47 @@ func _ResourceService_UpdateResource_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _ResourceService_ChangeResourceNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangeResourceNamespaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ResourceServiceServer).ChangeResourceNamespace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/raystack.optimus.core.v1beta1.ResourceService/ChangeResourceNamespace", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ResourceServiceServer).ChangeResourceNamespace(ctx, req.(*ChangeResourceNamespaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ResourceService_ApplyResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApplyResourcesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ResourceServiceServer).ApplyResources(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/raystack.optimus.core.v1beta1.ResourceService/ApplyResources", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ResourceServiceServer).ApplyResources(ctx, req.(*ApplyResourcesRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ResourceService_ServiceDesc is the grpc.ServiceDesc for ResourceService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var ResourceService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "odpf.optimus.core.v1beta1.ResourceService", + ServiceName: "raystack.optimus.core.v1beta1.ResourceService", HandlerType: (*ResourceServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -283,6 +351,14 @@ var ResourceService_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateResource", Handler: _ResourceService_UpdateResource_Handler, }, + { + MethodName: "ChangeResourceNamespace", + Handler: _ResourceService_ChangeResourceNamespace_Handler, + }, + { + MethodName: "ApplyResources", + Handler: _ResourceService_ApplyResources_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -292,5 +368,5 @@ var ResourceService_ServiceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "odpf/optimus/core/v1beta1/resource.proto", + Metadata: "raystack/optimus/core/v1beta1/resource.proto", } diff --git a/protos/raystack/optimus/core/v1beta1/runtime.pb.go b/protos/raystack/optimus/core/v1beta1/runtime.pb.go new file mode 100644 index 0000000000..90d0a2f2cd --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/runtime.pb.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/core/v1beta1/runtime.proto + +package optimus + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + 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 VersionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Client string `protobuf:"bytes,1,opt,name=client,proto3" json:"client,omitempty"` +} + +func (x *VersionRequest) Reset() { + *x = VersionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_runtime_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VersionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VersionRequest) ProtoMessage() {} + +func (x *VersionRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_runtime_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 VersionRequest.ProtoReflect.Descriptor instead. +func (*VersionRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_runtime_proto_rawDescGZIP(), []int{0} +} + +func (x *VersionRequest) GetClient() string { + if x != nil { + return x.Client + } + return "" +} + +type VersionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` +} + +func (x *VersionResponse) Reset() { + *x = VersionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_runtime_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VersionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VersionResponse) ProtoMessage() {} + +func (x *VersionResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_runtime_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 VersionResponse.ProtoReflect.Descriptor instead. +func (*VersionResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_runtime_proto_rawDescGZIP(), []int{1} +} + +func (x *VersionResponse) GetServer() string { + if x != nil { + return x.Server + } + return "" +} + +var File_raystack_optimus_core_v1beta1_runtime_proto protoreflect.FileDescriptor + +var file_raystack_optimus_core_v1beta1_runtime_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x20, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x28, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x22, 0x29, 0x0a, 0x0f, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x32, 0x9e, 0x01, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x07, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x15, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x3a, 0x01, 0x2a, 0x42, 0x97, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x15, 0x52, 0x75, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, + 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x92, 0x41, 0x3b, 0x12, 0x05, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, + 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, + 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x19, 0x0a, 0x17, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x20, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_raystack_optimus_core_v1beta1_runtime_proto_rawDescOnce sync.Once + file_raystack_optimus_core_v1beta1_runtime_proto_rawDescData = file_raystack_optimus_core_v1beta1_runtime_proto_rawDesc +) + +func file_raystack_optimus_core_v1beta1_runtime_proto_rawDescGZIP() []byte { + file_raystack_optimus_core_v1beta1_runtime_proto_rawDescOnce.Do(func() { + file_raystack_optimus_core_v1beta1_runtime_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_core_v1beta1_runtime_proto_rawDescData) + }) + return file_raystack_optimus_core_v1beta1_runtime_proto_rawDescData +} + +var file_raystack_optimus_core_v1beta1_runtime_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_raystack_optimus_core_v1beta1_runtime_proto_goTypes = []interface{}{ + (*VersionRequest)(nil), // 0: raystack.optimus.core.v1beta1.VersionRequest + (*VersionResponse)(nil), // 1: raystack.optimus.core.v1beta1.VersionResponse +} +var file_raystack_optimus_core_v1beta1_runtime_proto_depIdxs = []int32{ + 0, // 0: raystack.optimus.core.v1beta1.RuntimeService.Version:input_type -> raystack.optimus.core.v1beta1.VersionRequest + 1, // 1: raystack.optimus.core.v1beta1.RuntimeService.Version:output_type -> raystack.optimus.core.v1beta1.VersionResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_raystack_optimus_core_v1beta1_runtime_proto_init() } +func file_raystack_optimus_core_v1beta1_runtime_proto_init() { + if File_raystack_optimus_core_v1beta1_runtime_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_core_v1beta1_runtime_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VersionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_runtime_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VersionResponse); 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_raystack_optimus_core_v1beta1_runtime_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_raystack_optimus_core_v1beta1_runtime_proto_goTypes, + DependencyIndexes: file_raystack_optimus_core_v1beta1_runtime_proto_depIdxs, + MessageInfos: file_raystack_optimus_core_v1beta1_runtime_proto_msgTypes, + }.Build() + File_raystack_optimus_core_v1beta1_runtime_proto = out.File + file_raystack_optimus_core_v1beta1_runtime_proto_rawDesc = nil + file_raystack_optimus_core_v1beta1_runtime_proto_goTypes = nil + file_raystack_optimus_core_v1beta1_runtime_proto_depIdxs = nil +} diff --git a/protos/odpf/optimus/core/v1beta1/runtime.pb.gw.go b/protos/raystack/optimus/core/v1beta1/runtime.pb.gw.go similarity index 95% rename from protos/odpf/optimus/core/v1beta1/runtime.pb.gw.go rename to protos/raystack/optimus/core/v1beta1/runtime.pb.gw.go index 95da6a84bb..baa1d78acf 100644 --- a/protos/odpf/optimus/core/v1beta1/runtime.pb.gw.go +++ b/protos/raystack/optimus/core/v1beta1/runtime.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: odpf/optimus/core/v1beta1/runtime.proto +// source: raystack/optimus/core/v1beta1/runtime.proto /* Package optimus is a reverse proxy. @@ -77,7 +77,7 @@ func RegisterRuntimeServiceHandlerServer(ctx context.Context, mux *runtime.Serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.RuntimeService/Version", runtime.WithHTTPPathPattern("/v1beta1/version")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.RuntimeService/Version", runtime.WithHTTPPathPattern("/v1beta1/version")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -139,7 +139,7 @@ func RegisterRuntimeServiceHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.RuntimeService/Version", runtime.WithHTTPPathPattern("/v1beta1/version")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.RuntimeService/Version", runtime.WithHTTPPathPattern("/v1beta1/version")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/protos/odpf/optimus/core/v1beta1/runtime.swagger.json b/protos/raystack/optimus/core/v1beta1/runtime.swagger.json similarity index 89% rename from protos/odpf/optimus/core/v1beta1/runtime.swagger.json rename to protos/raystack/optimus/core/v1beta1/runtime.swagger.json index eedac90626..63de81808f 100644 --- a/protos/odpf/optimus/core/v1beta1/runtime.swagger.json +++ b/protos/raystack/optimus/core/v1beta1/runtime.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/core/v1beta1/runtime.proto", + "title": "raystack/optimus/core/v1beta1/runtime.proto", "version": "0.1" }, "tags": [ @@ -11,15 +11,9 @@ ], "host": "127.0.0.1:9100", "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { "/v1beta1/version": { "post": { @@ -49,9 +43,7 @@ } } ], - "tags": [ - "RuntimeService" - ] + "tags": ["RuntimeService"] } } }, diff --git a/protos/odpf/optimus/core/v1beta1/runtime_grpc.pb.go b/protos/raystack/optimus/core/v1beta1/runtime_grpc.pb.go similarity index 91% rename from protos/odpf/optimus/core/v1beta1/runtime_grpc.pb.go rename to protos/raystack/optimus/core/v1beta1/runtime_grpc.pb.go index cad51fe26c..29947f2994 100644 --- a/protos/odpf/optimus/core/v1beta1/runtime_grpc.pb.go +++ b/protos/raystack/optimus/core/v1beta1/runtime_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: odpf/optimus/core/v1beta1/runtime.proto +// source: raystack/optimus/core/v1beta1/runtime.proto package optimus @@ -36,7 +36,7 @@ func NewRuntimeServiceClient(cc grpc.ClientConnInterface) RuntimeServiceClient { func (c *runtimeServiceClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) { out := new(VersionResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.RuntimeService/Version", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.RuntimeService/Version", in, out, opts...) if err != nil { return nil, err } @@ -82,7 +82,7 @@ func _RuntimeService_Version_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.RuntimeService/Version", + FullMethod: "/raystack.optimus.core.v1beta1.RuntimeService/Version", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).Version(ctx, req.(*VersionRequest)) @@ -94,7 +94,7 @@ func _RuntimeService_Version_Handler(srv interface{}, ctx context.Context, dec f // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var RuntimeService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "odpf.optimus.core.v1beta1.RuntimeService", + ServiceName: "raystack.optimus.core.v1beta1.RuntimeService", HandlerType: (*RuntimeServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -103,5 +103,5 @@ var RuntimeService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "odpf/optimus/core/v1beta1/runtime.proto", + Metadata: "raystack/optimus/core/v1beta1/runtime.proto", } diff --git a/protos/raystack/optimus/core/v1beta1/secret.pb.go b/protos/raystack/optimus/core/v1beta1/secret.pb.go new file mode 100644 index 0000000000..4acc6b8f5a --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/secret.pb.go @@ -0,0 +1,814 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/core/v1beta1/secret.proto + +package optimus + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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 RegisterSecretRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + SecretName string `protobuf:"bytes,2,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // base64 encoded secret value + NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` +} + +func (x *RegisterSecretRequest) Reset() { + *x = RegisterSecretRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterSecretRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterSecretRequest) ProtoMessage() {} + +func (x *RegisterSecretRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_secret_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 RegisterSecretRequest.ProtoReflect.Descriptor instead. +func (*RegisterSecretRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{0} +} + +func (x *RegisterSecretRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *RegisterSecretRequest) GetSecretName() string { + if x != nil { + return x.SecretName + } + return "" +} + +func (x *RegisterSecretRequest) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *RegisterSecretRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +type RegisterSecretResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RegisterSecretResponse) Reset() { + *x = RegisterSecretResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterSecretResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterSecretResponse) ProtoMessage() {} + +func (x *RegisterSecretResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_secret_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 RegisterSecretResponse.ProtoReflect.Descriptor instead. +func (*RegisterSecretResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{1} +} + +type UpdateSecretRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + SecretName string `protobuf:"bytes,2,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // base64 encoded secret value + NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` +} + +func (x *UpdateSecretRequest) Reset() { + *x = UpdateSecretRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateSecretRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateSecretRequest) ProtoMessage() {} + +func (x *UpdateSecretRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_secret_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 UpdateSecretRequest.ProtoReflect.Descriptor instead. +func (*UpdateSecretRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateSecretRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *UpdateSecretRequest) GetSecretName() string { + if x != nil { + return x.SecretName + } + return "" +} + +func (x *UpdateSecretRequest) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *UpdateSecretRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +type UpdateSecretResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateSecretResponse) Reset() { + *x = UpdateSecretResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateSecretResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateSecretResponse) ProtoMessage() {} + +func (x *UpdateSecretResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_secret_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 UpdateSecretResponse.ProtoReflect.Descriptor instead. +func (*UpdateSecretResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{3} +} + +type ListSecretsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` +} + +func (x *ListSecretsRequest) Reset() { + *x = ListSecretsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSecretsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSecretsRequest) ProtoMessage() {} + +func (x *ListSecretsRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_secret_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 ListSecretsRequest.ProtoReflect.Descriptor instead. +func (*ListSecretsRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{4} +} + +func (x *ListSecretsRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +type ListSecretsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Secrets []*ListSecretsResponse_Secret `protobuf:"bytes,1,rep,name=secrets,proto3" json:"secrets,omitempty"` +} + +func (x *ListSecretsResponse) Reset() { + *x = ListSecretsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSecretsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSecretsResponse) ProtoMessage() {} + +func (x *ListSecretsResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_secret_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 ListSecretsResponse.ProtoReflect.Descriptor instead. +func (*ListSecretsResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{5} +} + +func (x *ListSecretsResponse) GetSecrets() []*ListSecretsResponse_Secret { + if x != nil { + return x.Secrets + } + return nil +} + +type DeleteSecretRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + SecretName string `protobuf:"bytes,2,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"` + NamespaceName string `protobuf:"bytes,3,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` +} + +func (x *DeleteSecretRequest) Reset() { + *x = DeleteSecretRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteSecretRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteSecretRequest) ProtoMessage() {} + +func (x *DeleteSecretRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_secret_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 DeleteSecretRequest.ProtoReflect.Descriptor instead. +func (*DeleteSecretRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteSecretRequest) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *DeleteSecretRequest) GetSecretName() string { + if x != nil { + return x.SecretName + } + return "" +} + +func (x *DeleteSecretRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +type DeleteSecretResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteSecretResponse) Reset() { + *x = DeleteSecretResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteSecretResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteSecretResponse) ProtoMessage() {} + +func (x *DeleteSecretResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_secret_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 DeleteSecretResponse.ProtoReflect.Descriptor instead. +func (*DeleteSecretResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{7} +} + +type ListSecretsResponse_Secret struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Digest string `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +} + +func (x *ListSecretsResponse_Secret) Reset() { + *x = ListSecretsResponse_Secret{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSecretsResponse_Secret) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSecretsResponse_Secret) ProtoMessage() {} + +func (x *ListSecretsResponse_Secret) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_secret_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 ListSecretsResponse_Secret.ProtoReflect.Descriptor instead. +func (*ListSecretsResponse_Secret) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_secret_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *ListSecretsResponse_Secret) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ListSecretsResponse_Secret) GetDigest() string { + if x != nil { + return x.Digest + } + return "" +} + +func (x *ListSecretsResponse_Secret) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ListSecretsResponse_Secret) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +var File_raystack_optimus_core_v1beta1_secret_proto protoreflect.FileDescriptor + +var file_raystack_optimus_core_v1beta1_secret_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x20, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x98, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x96, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, + 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x16, + 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, + 0xfd, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x1a, + 0x8d, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, + 0x80, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x82, 0x06, 0x0a, 0x0d, 0x53, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xc4, 0x01, 0x0a, + 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, + 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x22, 0x34, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x73, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x2f, 0x7b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, + 0x3a, 0x01, 0x2a, 0x12, 0xbe, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x1a, 0x34, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x73, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x2f, 0x7b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xaa, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x73, 0x12, 0x34, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x12, 0xbb, 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x2a, 0x34, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x2f, 0x7b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, + 0xa0, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x75, 0x73, 0x42, 0x14, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x92, 0x41, 0x45, 0x12, 0x05, 0x32, + 0x03, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, + 0x39, 0x31, 0x30, 0x30, 0x22, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x01, 0x01, 0x72, 0x23, 0x0a, + 0x21, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x20, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x20, + 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_raystack_optimus_core_v1beta1_secret_proto_rawDescOnce sync.Once + file_raystack_optimus_core_v1beta1_secret_proto_rawDescData = file_raystack_optimus_core_v1beta1_secret_proto_rawDesc +) + +func file_raystack_optimus_core_v1beta1_secret_proto_rawDescGZIP() []byte { + file_raystack_optimus_core_v1beta1_secret_proto_rawDescOnce.Do(func() { + file_raystack_optimus_core_v1beta1_secret_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_core_v1beta1_secret_proto_rawDescData) + }) + return file_raystack_optimus_core_v1beta1_secret_proto_rawDescData +} + +var file_raystack_optimus_core_v1beta1_secret_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_raystack_optimus_core_v1beta1_secret_proto_goTypes = []interface{}{ + (*RegisterSecretRequest)(nil), // 0: raystack.optimus.core.v1beta1.RegisterSecretRequest + (*RegisterSecretResponse)(nil), // 1: raystack.optimus.core.v1beta1.RegisterSecretResponse + (*UpdateSecretRequest)(nil), // 2: raystack.optimus.core.v1beta1.UpdateSecretRequest + (*UpdateSecretResponse)(nil), // 3: raystack.optimus.core.v1beta1.UpdateSecretResponse + (*ListSecretsRequest)(nil), // 4: raystack.optimus.core.v1beta1.ListSecretsRequest + (*ListSecretsResponse)(nil), // 5: raystack.optimus.core.v1beta1.ListSecretsResponse + (*DeleteSecretRequest)(nil), // 6: raystack.optimus.core.v1beta1.DeleteSecretRequest + (*DeleteSecretResponse)(nil), // 7: raystack.optimus.core.v1beta1.DeleteSecretResponse + (*ListSecretsResponse_Secret)(nil), // 8: raystack.optimus.core.v1beta1.ListSecretsResponse.Secret + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp +} +var file_raystack_optimus_core_v1beta1_secret_proto_depIdxs = []int32{ + 8, // 0: raystack.optimus.core.v1beta1.ListSecretsResponse.secrets:type_name -> raystack.optimus.core.v1beta1.ListSecretsResponse.Secret + 9, // 1: raystack.optimus.core.v1beta1.ListSecretsResponse.Secret.updated_at:type_name -> google.protobuf.Timestamp + 0, // 2: raystack.optimus.core.v1beta1.SecretService.RegisterSecret:input_type -> raystack.optimus.core.v1beta1.RegisterSecretRequest + 2, // 3: raystack.optimus.core.v1beta1.SecretService.UpdateSecret:input_type -> raystack.optimus.core.v1beta1.UpdateSecretRequest + 4, // 4: raystack.optimus.core.v1beta1.SecretService.ListSecrets:input_type -> raystack.optimus.core.v1beta1.ListSecretsRequest + 6, // 5: raystack.optimus.core.v1beta1.SecretService.DeleteSecret:input_type -> raystack.optimus.core.v1beta1.DeleteSecretRequest + 1, // 6: raystack.optimus.core.v1beta1.SecretService.RegisterSecret:output_type -> raystack.optimus.core.v1beta1.RegisterSecretResponse + 3, // 7: raystack.optimus.core.v1beta1.SecretService.UpdateSecret:output_type -> raystack.optimus.core.v1beta1.UpdateSecretResponse + 5, // 8: raystack.optimus.core.v1beta1.SecretService.ListSecrets:output_type -> raystack.optimus.core.v1beta1.ListSecretsResponse + 7, // 9: raystack.optimus.core.v1beta1.SecretService.DeleteSecret:output_type -> raystack.optimus.core.v1beta1.DeleteSecretResponse + 6, // [6:10] is the sub-list for method output_type + 2, // [2:6] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_raystack_optimus_core_v1beta1_secret_proto_init() } +func file_raystack_optimus_core_v1beta1_secret_proto_init() { + if File_raystack_optimus_core_v1beta1_secret_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterSecretRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterSecretResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateSecretRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateSecretResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSecretsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSecretsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteSecretRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteSecretResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_core_v1beta1_secret_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSecretsResponse_Secret); 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_raystack_optimus_core_v1beta1_secret_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_raystack_optimus_core_v1beta1_secret_proto_goTypes, + DependencyIndexes: file_raystack_optimus_core_v1beta1_secret_proto_depIdxs, + MessageInfos: file_raystack_optimus_core_v1beta1_secret_proto_msgTypes, + }.Build() + File_raystack_optimus_core_v1beta1_secret_proto = out.File + file_raystack_optimus_core_v1beta1_secret_proto_rawDesc = nil + file_raystack_optimus_core_v1beta1_secret_proto_goTypes = nil + file_raystack_optimus_core_v1beta1_secret_proto_depIdxs = nil +} diff --git a/protos/odpf/optimus/core/v1beta1/secret.pb.gw.go b/protos/raystack/optimus/core/v1beta1/secret.pb.gw.go similarity index 94% rename from protos/odpf/optimus/core/v1beta1/secret.pb.gw.go rename to protos/raystack/optimus/core/v1beta1/secret.pb.gw.go index 3f7bb3cf09..59163cb9d1 100644 --- a/protos/odpf/optimus/core/v1beta1/secret.pb.gw.go +++ b/protos/raystack/optimus/core/v1beta1/secret.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: odpf/optimus/core/v1beta1/secret.proto +// source: raystack/optimus/core/v1beta1/secret.proto /* Package optimus is a reverse proxy. @@ -361,7 +361,7 @@ func RegisterSecretServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.SecretService/RegisterSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.SecretService/RegisterSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -384,7 +384,7 @@ func RegisterSecretServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.SecretService/UpdateSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.SecretService/UpdateSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -407,7 +407,7 @@ func RegisterSecretServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.SecretService/ListSecrets", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.SecretService/ListSecrets", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -430,7 +430,7 @@ func RegisterSecretServiceHandlerServer(ctx context.Context, mux *runtime.ServeM var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.SecretService/DeleteSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.SecretService/DeleteSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -492,7 +492,7 @@ func RegisterSecretServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.SecretService/RegisterSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.SecretService/RegisterSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -512,7 +512,7 @@ func RegisterSecretServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.SecretService/UpdateSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.SecretService/UpdateSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -532,7 +532,7 @@ func RegisterSecretServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.SecretService/ListSecrets", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.SecretService/ListSecrets", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -552,7 +552,7 @@ func RegisterSecretServiceHandlerClient(ctx context.Context, mux *runtime.ServeM ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.optimus.core.v1beta1.SecretService/DeleteSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/raystack.optimus.core.v1beta1.SecretService/DeleteSecret", runtime.WithHTTPPathPattern("/v1beta1/project/{project_name}/secret/{secret_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/protos/odpf/optimus/core/v1beta1/secret.swagger.json b/protos/raystack/optimus/core/v1beta1/secret.swagger.json similarity index 94% rename from protos/odpf/optimus/core/v1beta1/secret.swagger.json rename to protos/raystack/optimus/core/v1beta1/secret.swagger.json index 8a1c62ab39..47296d5176 100644 --- a/protos/odpf/optimus/core/v1beta1/secret.swagger.json +++ b/protos/raystack/optimus/core/v1beta1/secret.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/core/v1beta1/secret.proto", + "title": "raystack/optimus/core/v1beta1/secret.proto", "version": "0.1" }, "tags": [ @@ -11,15 +11,9 @@ ], "host": "127.0.0.1:9100", "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": { "/v1beta1/project/{projectName}/secret": { "get": { @@ -47,9 +41,7 @@ "type": "string" } ], - "tags": [ - "SecretService" - ] + "tags": ["SecretService"] } }, "/v1beta1/project/{projectName}/secret/{secretName}": { @@ -90,9 +82,7 @@ "type": "string" } ], - "tags": [ - "SecretService" - ] + "tags": ["SecretService"] }, "post": { "summary": "RegisterSecret creates a new secret of a project", @@ -141,9 +131,7 @@ } } ], - "tags": [ - "SecretService" - ] + "tags": ["SecretService"] }, "put": { "summary": "UpdateSecret updates secret at project level", @@ -192,9 +180,7 @@ } } ], - "tags": [ - "SecretService" - ] + "tags": ["SecretService"] } } }, diff --git a/protos/odpf/optimus/core/v1beta1/secret_grpc.pb.go b/protos/raystack/optimus/core/v1beta1/secret_grpc.pb.go similarity index 90% rename from protos/odpf/optimus/core/v1beta1/secret_grpc.pb.go rename to protos/raystack/optimus/core/v1beta1/secret_grpc.pb.go index 2e202efce9..044cad59d1 100644 --- a/protos/odpf/optimus/core/v1beta1/secret_grpc.pb.go +++ b/protos/raystack/optimus/core/v1beta1/secret_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: odpf/optimus/core/v1beta1/secret.proto +// source: raystack/optimus/core/v1beta1/secret.proto package optimus @@ -42,7 +42,7 @@ func NewSecretServiceClient(cc grpc.ClientConnInterface) SecretServiceClient { func (c *secretServiceClient) RegisterSecret(ctx context.Context, in *RegisterSecretRequest, opts ...grpc.CallOption) (*RegisterSecretResponse, error) { out := new(RegisterSecretResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.SecretService/RegisterSecret", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.SecretService/RegisterSecret", in, out, opts...) if err != nil { return nil, err } @@ -51,7 +51,7 @@ func (c *secretServiceClient) RegisterSecret(ctx context.Context, in *RegisterSe func (c *secretServiceClient) UpdateSecret(ctx context.Context, in *UpdateSecretRequest, opts ...grpc.CallOption) (*UpdateSecretResponse, error) { out := new(UpdateSecretResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.SecretService/UpdateSecret", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.SecretService/UpdateSecret", in, out, opts...) if err != nil { return nil, err } @@ -60,7 +60,7 @@ func (c *secretServiceClient) UpdateSecret(ctx context.Context, in *UpdateSecret func (c *secretServiceClient) ListSecrets(ctx context.Context, in *ListSecretsRequest, opts ...grpc.CallOption) (*ListSecretsResponse, error) { out := new(ListSecretsResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.SecretService/ListSecrets", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.SecretService/ListSecrets", in, out, opts...) if err != nil { return nil, err } @@ -69,7 +69,7 @@ func (c *secretServiceClient) ListSecrets(ctx context.Context, in *ListSecretsRe func (c *secretServiceClient) DeleteSecret(ctx context.Context, in *DeleteSecretRequest, opts ...grpc.CallOption) (*DeleteSecretResponse, error) { out := new(DeleteSecretResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.core.v1beta1.SecretService/DeleteSecret", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.core.v1beta1.SecretService/DeleteSecret", in, out, opts...) if err != nil { return nil, err } @@ -130,7 +130,7 @@ func _SecretService_RegisterSecret_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.SecretService/RegisterSecret", + FullMethod: "/raystack.optimus.core.v1beta1.SecretService/RegisterSecret", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SecretServiceServer).RegisterSecret(ctx, req.(*RegisterSecretRequest)) @@ -148,7 +148,7 @@ func _SecretService_UpdateSecret_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.SecretService/UpdateSecret", + FullMethod: "/raystack.optimus.core.v1beta1.SecretService/UpdateSecret", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SecretServiceServer).UpdateSecret(ctx, req.(*UpdateSecretRequest)) @@ -166,7 +166,7 @@ func _SecretService_ListSecrets_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.SecretService/ListSecrets", + FullMethod: "/raystack.optimus.core.v1beta1.SecretService/ListSecrets", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SecretServiceServer).ListSecrets(ctx, req.(*ListSecretsRequest)) @@ -184,7 +184,7 @@ func _SecretService_DeleteSecret_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.core.v1beta1.SecretService/DeleteSecret", + FullMethod: "/raystack.optimus.core.v1beta1.SecretService/DeleteSecret", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SecretServiceServer).DeleteSecret(ctx, req.(*DeleteSecretRequest)) @@ -196,7 +196,7 @@ func _SecretService_DeleteSecret_Handler(srv interface{}, ctx context.Context, d // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var SecretService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "odpf.optimus.core.v1beta1.SecretService", + ServiceName: "raystack.optimus.core.v1beta1.SecretService", HandlerType: (*SecretServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -217,5 +217,5 @@ var SecretService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "odpf/optimus/core/v1beta1/secret.proto", + Metadata: "raystack/optimus/core/v1beta1/secret.proto", } diff --git a/protos/raystack/optimus/core/v1beta1/status.pb.go b/protos/raystack/optimus/core/v1beta1/status.pb.go new file mode 100644 index 0000000000..8f5c185804 --- /dev/null +++ b/protos/raystack/optimus/core/v1beta1/status.pb.go @@ -0,0 +1,234 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/core/v1beta1/status.proto + +package optimus + +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 Level int32 + +const ( + Level_LEVEL_UNSPECIFIED Level = 0 + Level_LEVEL_TRACE Level = 1 + Level_LEVEL_DEBUG Level = 2 + Level_LEVEL_INFO Level = 3 + Level_LEVEL_WARNING Level = 4 + Level_LEVEL_ERROR Level = 5 + Level_LEVEL_FATAL Level = 6 +) + +// Enum value maps for Level. +var ( + Level_name = map[int32]string{ + 0: "LEVEL_UNSPECIFIED", + 1: "LEVEL_TRACE", + 2: "LEVEL_DEBUG", + 3: "LEVEL_INFO", + 4: "LEVEL_WARNING", + 5: "LEVEL_ERROR", + 6: "LEVEL_FATAL", + } + Level_value = map[string]int32{ + "LEVEL_UNSPECIFIED": 0, + "LEVEL_TRACE": 1, + "LEVEL_DEBUG": 2, + "LEVEL_INFO": 3, + "LEVEL_WARNING": 4, + "LEVEL_ERROR": 5, + "LEVEL_FATAL": 6, + } +) + +func (x Level) Enum() *Level { + p := new(Level) + *p = x + return p +} + +func (x Level) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Level) Descriptor() protoreflect.EnumDescriptor { + return file_raystack_optimus_core_v1beta1_status_proto_enumTypes[0].Descriptor() +} + +func (Level) Type() protoreflect.EnumType { + return &file_raystack_optimus_core_v1beta1_status_proto_enumTypes[0] +} + +func (x Level) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Level.Descriptor instead. +func (Level) EnumDescriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_status_proto_rawDescGZIP(), []int{0} +} + +type Log struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Level Level `protobuf:"varint,1,opt,name=level,proto3,enum=raystack.optimus.core.v1beta1.Level" json:"level,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *Log) Reset() { + *x = Log{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_core_v1beta1_status_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Log) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Log) ProtoMessage() {} + +func (x *Log) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_core_v1beta1_status_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 Log.ProtoReflect.Descriptor instead. +func (*Log) Descriptor() ([]byte, []int) { + return file_raystack_optimus_core_v1beta1_status_proto_rawDescGZIP(), []int{0} +} + +func (x *Log) GetLevel() Level { + if x != nil { + return x.Level + } + return Level_LEVEL_UNSPECIFIED +} + +func (x *Log) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_raystack_optimus_core_v1beta1_status_proto protoreflect.FileDescriptor + +var file_raystack_optimus_core_v1beta1_status_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x20, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x22, 0x5e, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x3d, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2a, 0x85, 0x01, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x15, 0x0a, 0x11, 0x4c, + 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x54, 0x52, 0x41, 0x43, + 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x44, 0x45, 0x42, + 0x55, 0x47, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x49, 0x4e, + 0x46, 0x4f, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x41, + 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, + 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, + 0x4c, 0x5f, 0x46, 0x41, 0x54, 0x41, 0x4c, 0x10, 0x06, 0x42, 0x4a, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x06, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_raystack_optimus_core_v1beta1_status_proto_rawDescOnce sync.Once + file_raystack_optimus_core_v1beta1_status_proto_rawDescData = file_raystack_optimus_core_v1beta1_status_proto_rawDesc +) + +func file_raystack_optimus_core_v1beta1_status_proto_rawDescGZIP() []byte { + file_raystack_optimus_core_v1beta1_status_proto_rawDescOnce.Do(func() { + file_raystack_optimus_core_v1beta1_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_core_v1beta1_status_proto_rawDescData) + }) + return file_raystack_optimus_core_v1beta1_status_proto_rawDescData +} + +var file_raystack_optimus_core_v1beta1_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_raystack_optimus_core_v1beta1_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_raystack_optimus_core_v1beta1_status_proto_goTypes = []interface{}{ + (Level)(0), // 0: raystack.optimus.core.v1beta1.Level + (*Log)(nil), // 1: raystack.optimus.core.v1beta1.Log +} +var file_raystack_optimus_core_v1beta1_status_proto_depIdxs = []int32{ + 0, // 0: raystack.optimus.core.v1beta1.Log.level:type_name -> raystack.optimus.core.v1beta1.Level + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_raystack_optimus_core_v1beta1_status_proto_init() } +func file_raystack_optimus_core_v1beta1_status_proto_init() { + if File_raystack_optimus_core_v1beta1_status_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_core_v1beta1_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Log); 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_raystack_optimus_core_v1beta1_status_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_raystack_optimus_core_v1beta1_status_proto_goTypes, + DependencyIndexes: file_raystack_optimus_core_v1beta1_status_proto_depIdxs, + EnumInfos: file_raystack_optimus_core_v1beta1_status_proto_enumTypes, + MessageInfos: file_raystack_optimus_core_v1beta1_status_proto_msgTypes, + }.Build() + File_raystack_optimus_core_v1beta1_status_proto = out.File + file_raystack_optimus_core_v1beta1_status_proto_rawDesc = nil + file_raystack_optimus_core_v1beta1_status_proto_goTypes = nil + file_raystack_optimus_core_v1beta1_status_proto_depIdxs = nil +} diff --git a/protos/odpf/optimus/core/v1beta1/status.swagger.json b/protos/raystack/optimus/core/v1beta1/status.swagger.json similarity index 83% rename from protos/odpf/optimus/core/v1beta1/status.swagger.json rename to protos/raystack/optimus/core/v1beta1/status.swagger.json index f4eb363d8d..b301d14969 100644 --- a/protos/odpf/optimus/core/v1beta1/status.swagger.json +++ b/protos/raystack/optimus/core/v1beta1/status.swagger.json @@ -1,15 +1,11 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/core/v1beta1/status.proto", + "title": "raystack/optimus/core/v1beta1/status.proto", "version": "version not set" }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": {}, "definitions": { "protobufAny": { diff --git a/protos/raystack/optimus/integration/v1beta1/event.pb.go b/protos/raystack/optimus/integration/v1beta1/event.pb.go new file mode 100644 index 0000000000..dadc8a1c1c --- /dev/null +++ b/protos/raystack/optimus/integration/v1beta1/event.pb.go @@ -0,0 +1,746 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/integration/v1beta1/event.proto + +package optimus + +import ( + v1beta1 "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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 OptimusChangeEvent_EventType int32 + +const ( + OptimusChangeEvent_EVENT_TYPE_TYPE_UNSPECIFIED OptimusChangeEvent_EventType = 0 + OptimusChangeEvent_EVENT_TYPE_RESOURCE_CREATE OptimusChangeEvent_EventType = 1 + OptimusChangeEvent_EVENT_TYPE_RESOURCE_UPDATE OptimusChangeEvent_EventType = 2 + OptimusChangeEvent_EVENT_TYPE_JOB_CREATE OptimusChangeEvent_EventType = 3 + OptimusChangeEvent_EVENT_TYPE_JOB_UPDATE OptimusChangeEvent_EventType = 4 + OptimusChangeEvent_EVENT_TYPE_JOB_DELETE OptimusChangeEvent_EventType = 5 + OptimusChangeEvent_EVENT_TYPE_JOB_WAIT_UPSTREAM OptimusChangeEvent_EventType = 6 + OptimusChangeEvent_EVENT_TYPE_JOB_IN_PROGRESS OptimusChangeEvent_EventType = 7 + OptimusChangeEvent_EVENT_TYPE_JOB_SUCCESS OptimusChangeEvent_EventType = 8 + OptimusChangeEvent_EVENT_TYPE_JOB_FAILURE OptimusChangeEvent_EventType = 9 + OptimusChangeEvent_EVENT_TYPE_JOB_STATE_CHANGE OptimusChangeEvent_EventType = 10 +) + +// Enum value maps for OptimusChangeEvent_EventType. +var ( + OptimusChangeEvent_EventType_name = map[int32]string{ + 0: "EVENT_TYPE_TYPE_UNSPECIFIED", + 1: "EVENT_TYPE_RESOURCE_CREATE", + 2: "EVENT_TYPE_RESOURCE_UPDATE", + 3: "EVENT_TYPE_JOB_CREATE", + 4: "EVENT_TYPE_JOB_UPDATE", + 5: "EVENT_TYPE_JOB_DELETE", + 6: "EVENT_TYPE_JOB_WAIT_UPSTREAM", + 7: "EVENT_TYPE_JOB_IN_PROGRESS", + 8: "EVENT_TYPE_JOB_SUCCESS", + 9: "EVENT_TYPE_JOB_FAILURE", + 10: "EVENT_TYPE_JOB_STATE_CHANGE", + } + OptimusChangeEvent_EventType_value = map[string]int32{ + "EVENT_TYPE_TYPE_UNSPECIFIED": 0, + "EVENT_TYPE_RESOURCE_CREATE": 1, + "EVENT_TYPE_RESOURCE_UPDATE": 2, + "EVENT_TYPE_JOB_CREATE": 3, + "EVENT_TYPE_JOB_UPDATE": 4, + "EVENT_TYPE_JOB_DELETE": 5, + "EVENT_TYPE_JOB_WAIT_UPSTREAM": 6, + "EVENT_TYPE_JOB_IN_PROGRESS": 7, + "EVENT_TYPE_JOB_SUCCESS": 8, + "EVENT_TYPE_JOB_FAILURE": 9, + "EVENT_TYPE_JOB_STATE_CHANGE": 10, + } +) + +func (x OptimusChangeEvent_EventType) Enum() *OptimusChangeEvent_EventType { + p := new(OptimusChangeEvent_EventType) + *p = x + return p +} + +func (x OptimusChangeEvent_EventType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OptimusChangeEvent_EventType) Descriptor() protoreflect.EnumDescriptor { + return file_raystack_optimus_integration_v1beta1_event_proto_enumTypes[0].Descriptor() +} + +func (OptimusChangeEvent_EventType) Type() protoreflect.EnumType { + return &file_raystack_optimus_integration_v1beta1_event_proto_enumTypes[0] +} + +func (x OptimusChangeEvent_EventType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OptimusChangeEvent_EventType.Descriptor instead. +func (OptimusChangeEvent_EventType) EnumDescriptor() ([]byte, []int) { + return file_raystack_optimus_integration_v1beta1_event_proto_rawDescGZIP(), []int{4, 0} +} + +type ResourceChangePayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DatastoreName string `protobuf:"bytes,1,opt,name=datastore_name,json=datastoreName,proto3" json:"datastore_name,omitempty"` + Resource *v1beta1.ResourceSpecification `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` +} + +func (x *ResourceChangePayload) Reset() { + *x = ResourceChangePayload{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceChangePayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceChangePayload) ProtoMessage() {} + +func (x *ResourceChangePayload) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_integration_v1beta1_event_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 ResourceChangePayload.ProtoReflect.Descriptor instead. +func (*ResourceChangePayload) Descriptor() ([]byte, []int) { + return file_raystack_optimus_integration_v1beta1_event_proto_rawDescGZIP(), []int{0} +} + +func (x *ResourceChangePayload) GetDatastoreName() string { + if x != nil { + return x.DatastoreName + } + return "" +} + +func (x *ResourceChangePayload) GetResource() *v1beta1.ResourceSpecification { + if x != nil { + return x.Resource + } + return nil +} + +type JobChangePayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + JobName string `protobuf:"bytes,1,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + JobSpec *v1beta1.JobSpecification `protobuf:"bytes,2,opt,name=job_spec,json=jobSpec,proto3" json:"job_spec,omitempty"` +} + +func (x *JobChangePayload) Reset() { + *x = JobChangePayload{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobChangePayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobChangePayload) ProtoMessage() {} + +func (x *JobChangePayload) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_integration_v1beta1_event_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 JobChangePayload.ProtoReflect.Descriptor instead. +func (*JobChangePayload) Descriptor() ([]byte, []int) { + return file_raystack_optimus_integration_v1beta1_event_proto_rawDescGZIP(), []int{1} +} + +func (x *JobChangePayload) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *JobChangePayload) GetJobSpec() *v1beta1.JobSpecification { + if x != nil { + return x.JobSpec + } + return nil +} + +type JobRunPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + JobName string `protobuf:"bytes,1,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + ScheduledAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=scheduled_at,json=scheduledAt,proto3" json:"scheduled_at,omitempty"` + JobRunId string `protobuf:"bytes,3,opt,name=job_run_id,json=jobRunId,proto3" json:"job_run_id,omitempty"` + StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` +} + +func (x *JobRunPayload) Reset() { + *x = JobRunPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobRunPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobRunPayload) ProtoMessage() {} + +func (x *JobRunPayload) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_integration_v1beta1_event_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 JobRunPayload.ProtoReflect.Descriptor instead. +func (*JobRunPayload) Descriptor() ([]byte, []int) { + return file_raystack_optimus_integration_v1beta1_event_proto_rawDescGZIP(), []int{2} +} + +func (x *JobRunPayload) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *JobRunPayload) GetScheduledAt() *timestamppb.Timestamp { + if x != nil { + return x.ScheduledAt + } + return nil +} + +func (x *JobRunPayload) GetJobRunId() string { + if x != nil { + return x.JobRunId + } + return "" +} + +func (x *JobRunPayload) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +type JobStateChangePayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + JobName string `protobuf:"bytes,1,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` + State v1beta1.JobState `protobuf:"varint,2,opt,name=state,proto3,enum=raystack.optimus.core.v1beta1.JobState" json:"state,omitempty"` +} + +func (x *JobStateChangePayload) Reset() { + *x = JobStateChangePayload{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JobStateChangePayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JobStateChangePayload) ProtoMessage() {} + +func (x *JobStateChangePayload) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_integration_v1beta1_event_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 JobStateChangePayload.ProtoReflect.Descriptor instead. +func (*JobStateChangePayload) Descriptor() ([]byte, []int) { + return file_raystack_optimus_integration_v1beta1_event_proto_rawDescGZIP(), []int{3} +} + +func (x *JobStateChangePayload) GetJobName() string { + if x != nil { + return x.JobName + } + return "" +} + +func (x *JobStateChangePayload) GetState() v1beta1.JobState { + if x != nil { + return x.State + } + return v1beta1.JobState(0) +} + +type OptimusChangeEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EventId string `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` + OccurredAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=occurred_at,json=occurredAt,proto3" json:"occurred_at,omitempty"` + ProjectName string `protobuf:"bytes,3,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + NamespaceName string `protobuf:"bytes,4,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + EventType OptimusChangeEvent_EventType `protobuf:"varint,5,opt,name=event_type,json=eventType,proto3,enum=raystack.optimus.integration.v1beta1.OptimusChangeEvent_EventType" json:"event_type,omitempty"` + // Types that are assignable to Payload: + // + // *OptimusChangeEvent_JobChange + // *OptimusChangeEvent_ResourceChange + // *OptimusChangeEvent_JobRun + // *OptimusChangeEvent_JobStateChange + Payload isOptimusChangeEvent_Payload `protobuf_oneof:"payload"` +} + +func (x *OptimusChangeEvent) Reset() { + *x = OptimusChangeEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptimusChangeEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptimusChangeEvent) ProtoMessage() {} + +func (x *OptimusChangeEvent) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_integration_v1beta1_event_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 OptimusChangeEvent.ProtoReflect.Descriptor instead. +func (*OptimusChangeEvent) Descriptor() ([]byte, []int) { + return file_raystack_optimus_integration_v1beta1_event_proto_rawDescGZIP(), []int{4} +} + +func (x *OptimusChangeEvent) GetEventId() string { + if x != nil { + return x.EventId + } + return "" +} + +func (x *OptimusChangeEvent) GetOccurredAt() *timestamppb.Timestamp { + if x != nil { + return x.OccurredAt + } + return nil +} + +func (x *OptimusChangeEvent) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *OptimusChangeEvent) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *OptimusChangeEvent) GetEventType() OptimusChangeEvent_EventType { + if x != nil { + return x.EventType + } + return OptimusChangeEvent_EVENT_TYPE_TYPE_UNSPECIFIED +} + +func (m *OptimusChangeEvent) GetPayload() isOptimusChangeEvent_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *OptimusChangeEvent) GetJobChange() *JobChangePayload { + if x, ok := x.GetPayload().(*OptimusChangeEvent_JobChange); ok { + return x.JobChange + } + return nil +} + +func (x *OptimusChangeEvent) GetResourceChange() *ResourceChangePayload { + if x, ok := x.GetPayload().(*OptimusChangeEvent_ResourceChange); ok { + return x.ResourceChange + } + return nil +} + +func (x *OptimusChangeEvent) GetJobRun() *JobRunPayload { + if x, ok := x.GetPayload().(*OptimusChangeEvent_JobRun); ok { + return x.JobRun + } + return nil +} + +func (x *OptimusChangeEvent) GetJobStateChange() *JobStateChangePayload { + if x, ok := x.GetPayload().(*OptimusChangeEvent_JobStateChange); ok { + return x.JobStateChange + } + return nil +} + +type isOptimusChangeEvent_Payload interface { + isOptimusChangeEvent_Payload() +} + +type OptimusChangeEvent_JobChange struct { + JobChange *JobChangePayload `protobuf:"bytes,6,opt,name=job_change,json=jobChange,proto3,oneof"` +} + +type OptimusChangeEvent_ResourceChange struct { + ResourceChange *ResourceChangePayload `protobuf:"bytes,7,opt,name=resource_change,json=resourceChange,proto3,oneof"` +} + +type OptimusChangeEvent_JobRun struct { + JobRun *JobRunPayload `protobuf:"bytes,8,opt,name=job_run,json=jobRun,proto3,oneof"` +} + +type OptimusChangeEvent_JobStateChange struct { + JobStateChange *JobStateChangePayload `protobuf:"bytes,9,opt,name=job_state_change,json=jobStateChange,proto3,oneof"` +} + +func (*OptimusChangeEvent_JobChange) isOptimusChangeEvent_Payload() {} + +func (*OptimusChangeEvent_ResourceChange) isOptimusChangeEvent_Payload() {} + +func (*OptimusChangeEvent_JobRun) isOptimusChangeEvent_Payload() {} + +func (*OptimusChangeEvent_JobStateChange) isOptimusChangeEvent_Payload() {} + +var File_raystack_optimus_integration_v1beta1_event_proto protoreflect.FileDescriptor + +var file_raystack_optimus_integration_v1beta1_event_proto_rawDesc = []byte{ + 0x0a, 0x33, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x27, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x93, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x64, + 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x7c, 0x0a, 0x10, 0x4a, 0x6f, 0x62, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6a, + 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, + 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x70, + 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6a, 0x6f, + 0x62, 0x53, 0x70, 0x65, 0x63, 0x22, 0xc2, 0x01, 0x0a, 0x0d, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x1c, 0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x49, 0x64, 0x12, + 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x74, 0x0a, 0x15, 0x4a, 0x6f, + 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x40, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x22, 0x88, 0x08, 0x0a, 0x12, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6f, 0x63, 0x63, 0x75, 0x72, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x64, 0x0a, 0x0a, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x5a, 0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, + 0x62, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x00, + 0x52, 0x09, 0x6a, 0x6f, 0x62, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x69, 0x0a, 0x0f, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x51, 0x0a, 0x07, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x75, + 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x69, 0x6e, + 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x00, 0x52, 0x06, 0x6a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x12, 0x6a, 0x0a, 0x10, 0x6a, 0x6f, 0x62, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4a, 0x6f, + 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x48, 0x00, 0x52, 0x0e, 0x6a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0xd8, 0x02, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x43, 0x52, 0x45, 0x41, + 0x54, 0x45, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x50, 0x44, 0x41, + 0x54, 0x45, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, + 0x19, 0x0a, 0x15, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, + 0x42, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x44, 0x45, 0x4c, + 0x45, 0x54, 0x45, 0x10, 0x05, 0x12, 0x20, 0x0a, 0x1c, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x55, 0x50, 0x53, + 0x54, 0x52, 0x45, 0x41, 0x4d, 0x10, 0x06, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x4f, + 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x07, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, 0x4e, 0x54, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, + 0x53, 0x10, 0x08, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x09, 0x12, + 0x1f, 0x0a, 0x1b, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, + 0x42, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x0a, + 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x49, 0x0a, 0x1e, 0x63, + 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x42, 0x05, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_raystack_optimus_integration_v1beta1_event_proto_rawDescOnce sync.Once + file_raystack_optimus_integration_v1beta1_event_proto_rawDescData = file_raystack_optimus_integration_v1beta1_event_proto_rawDesc +) + +func file_raystack_optimus_integration_v1beta1_event_proto_rawDescGZIP() []byte { + file_raystack_optimus_integration_v1beta1_event_proto_rawDescOnce.Do(func() { + file_raystack_optimus_integration_v1beta1_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_integration_v1beta1_event_proto_rawDescData) + }) + return file_raystack_optimus_integration_v1beta1_event_proto_rawDescData +} + +var file_raystack_optimus_integration_v1beta1_event_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_raystack_optimus_integration_v1beta1_event_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_raystack_optimus_integration_v1beta1_event_proto_goTypes = []interface{}{ + (OptimusChangeEvent_EventType)(0), // 0: raystack.optimus.integration.v1beta1.OptimusChangeEvent.EventType + (*ResourceChangePayload)(nil), // 1: raystack.optimus.integration.v1beta1.ResourceChangePayload + (*JobChangePayload)(nil), // 2: raystack.optimus.integration.v1beta1.JobChangePayload + (*JobRunPayload)(nil), // 3: raystack.optimus.integration.v1beta1.JobRunPayload + (*JobStateChangePayload)(nil), // 4: raystack.optimus.integration.v1beta1.JobStateChangePayload + (*OptimusChangeEvent)(nil), // 5: raystack.optimus.integration.v1beta1.OptimusChangeEvent + (*v1beta1.ResourceSpecification)(nil), // 6: raystack.optimus.core.v1beta1.ResourceSpecification + (*v1beta1.JobSpecification)(nil), // 7: raystack.optimus.core.v1beta1.JobSpecification + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp + (v1beta1.JobState)(0), // 9: raystack.optimus.core.v1beta1.JobState +} +var file_raystack_optimus_integration_v1beta1_event_proto_depIdxs = []int32{ + 6, // 0: raystack.optimus.integration.v1beta1.ResourceChangePayload.resource:type_name -> raystack.optimus.core.v1beta1.ResourceSpecification + 7, // 1: raystack.optimus.integration.v1beta1.JobChangePayload.job_spec:type_name -> raystack.optimus.core.v1beta1.JobSpecification + 8, // 2: raystack.optimus.integration.v1beta1.JobRunPayload.scheduled_at:type_name -> google.protobuf.Timestamp + 8, // 3: raystack.optimus.integration.v1beta1.JobRunPayload.start_time:type_name -> google.protobuf.Timestamp + 9, // 4: raystack.optimus.integration.v1beta1.JobStateChangePayload.state:type_name -> raystack.optimus.core.v1beta1.JobState + 8, // 5: raystack.optimus.integration.v1beta1.OptimusChangeEvent.occurred_at:type_name -> google.protobuf.Timestamp + 0, // 6: raystack.optimus.integration.v1beta1.OptimusChangeEvent.event_type:type_name -> raystack.optimus.integration.v1beta1.OptimusChangeEvent.EventType + 2, // 7: raystack.optimus.integration.v1beta1.OptimusChangeEvent.job_change:type_name -> raystack.optimus.integration.v1beta1.JobChangePayload + 1, // 8: raystack.optimus.integration.v1beta1.OptimusChangeEvent.resource_change:type_name -> raystack.optimus.integration.v1beta1.ResourceChangePayload + 3, // 9: raystack.optimus.integration.v1beta1.OptimusChangeEvent.job_run:type_name -> raystack.optimus.integration.v1beta1.JobRunPayload + 4, // 10: raystack.optimus.integration.v1beta1.OptimusChangeEvent.job_state_change:type_name -> raystack.optimus.integration.v1beta1.JobStateChangePayload + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_raystack_optimus_integration_v1beta1_event_proto_init() } +func file_raystack_optimus_integration_v1beta1_event_proto_init() { + if File_raystack_optimus_integration_v1beta1_event_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceChangePayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JobChangePayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JobRunPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JobStateChangePayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptimusChangeEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_raystack_optimus_integration_v1beta1_event_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*OptimusChangeEvent_JobChange)(nil), + (*OptimusChangeEvent_ResourceChange)(nil), + (*OptimusChangeEvent_JobRun)(nil), + (*OptimusChangeEvent_JobStateChange)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_raystack_optimus_integration_v1beta1_event_proto_rawDesc, + NumEnums: 1, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_raystack_optimus_integration_v1beta1_event_proto_goTypes, + DependencyIndexes: file_raystack_optimus_integration_v1beta1_event_proto_depIdxs, + EnumInfos: file_raystack_optimus_integration_v1beta1_event_proto_enumTypes, + MessageInfos: file_raystack_optimus_integration_v1beta1_event_proto_msgTypes, + }.Build() + File_raystack_optimus_integration_v1beta1_event_proto = out.File + file_raystack_optimus_integration_v1beta1_event_proto_rawDesc = nil + file_raystack_optimus_integration_v1beta1_event_proto_goTypes = nil + file_raystack_optimus_integration_v1beta1_event_proto_depIdxs = nil +} diff --git a/protos/odpf/optimus/cluster/v1beta1/command.swagger.json b/protos/raystack/optimus/integration/v1beta1/event.swagger.json similarity index 82% rename from protos/odpf/optimus/cluster/v1beta1/command.swagger.json rename to protos/raystack/optimus/integration/v1beta1/event.swagger.json index 773c449a06..c3e20136a8 100644 --- a/protos/odpf/optimus/cluster/v1beta1/command.swagger.json +++ b/protos/raystack/optimus/integration/v1beta1/event.swagger.json @@ -1,15 +1,11 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/cluster/v1beta1/command.proto", + "title": "raystack/optimus/integration/v1beta1/event.proto", "version": "version not set" }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": {}, "definitions": { "protobufAny": { diff --git a/protos/raystack/optimus/plugins/v1beta1/dependency_resolver.pb.go b/protos/raystack/optimus/plugins/v1beta1/dependency_resolver.pb.go new file mode 100644 index 0000000000..364f37d5c4 --- /dev/null +++ b/protos/raystack/optimus/plugins/v1beta1/dependency_resolver.pb.go @@ -0,0 +1,1204 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: raystack/optimus/plugins/v1beta1/dependency_resolver.proto + +package optimus + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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 GetNameRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetNameRequest) Reset() { + *x = GetNameRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNameRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNameRequest) ProtoMessage() {} + +func (x *GetNameRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 GetNameRequest.ProtoReflect.Descriptor instead. +func (*GetNameRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{0} +} + +type GetNameResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetNameResponse) Reset() { + *x = GetNameResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNameResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNameResponse) ProtoMessage() {} + +func (x *GetNameResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 GetNameResponse.ProtoReflect.Descriptor instead. +func (*GetNameResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{1} +} + +func (x *GetNameResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GenerateDestinationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config *Configs `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` + Assets *Assets `protobuf:"bytes,2,opt,name=assets,proto3" json:"assets,omitempty"` + Options *PluginOptions `protobuf:"bytes,40,opt,name=options,proto3" json:"options,omitempty"` +} + +func (x *GenerateDestinationRequest) Reset() { + *x = GenerateDestinationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenerateDestinationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateDestinationRequest) ProtoMessage() {} + +func (x *GenerateDestinationRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 GenerateDestinationRequest.ProtoReflect.Descriptor instead. +func (*GenerateDestinationRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{2} +} + +func (x *GenerateDestinationRequest) GetConfig() *Configs { + if x != nil { + return x.Config + } + return nil +} + +func (x *GenerateDestinationRequest) GetAssets() *Assets { + if x != nil { + return x.Assets + } + return nil +} + +func (x *GenerateDestinationRequest) GetOptions() *PluginOptions { + if x != nil { + return x.Options + } + return nil +} + +type GenerateDestinationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` + DestinationType string `protobuf:"bytes,2,opt,name=destination_type,json=destinationType,proto3" json:"destination_type,omitempty"` +} + +func (x *GenerateDestinationResponse) Reset() { + *x = GenerateDestinationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenerateDestinationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateDestinationResponse) ProtoMessage() {} + +func (x *GenerateDestinationResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 GenerateDestinationResponse.ProtoReflect.Descriptor instead. +func (*GenerateDestinationResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{3} +} + +func (x *GenerateDestinationResponse) GetDestination() string { + if x != nil { + return x.Destination + } + return "" +} + +func (x *GenerateDestinationResponse) GetDestinationType() string { + if x != nil { + return x.DestinationType + } + return "" +} + +type GenerateDependenciesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config *Configs `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` + Assets *Assets `protobuf:"bytes,2,opt,name=assets,proto3" json:"assets,omitempty"` + Options *PluginOptions `protobuf:"bytes,40,opt,name=options,proto3" json:"options,omitempty"` +} + +func (x *GenerateDependenciesRequest) Reset() { + *x = GenerateDependenciesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenerateDependenciesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateDependenciesRequest) ProtoMessage() {} + +func (x *GenerateDependenciesRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 GenerateDependenciesRequest.ProtoReflect.Descriptor instead. +func (*GenerateDependenciesRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{4} +} + +func (x *GenerateDependenciesRequest) GetConfig() *Configs { + if x != nil { + return x.Config + } + return nil +} + +func (x *GenerateDependenciesRequest) GetAssets() *Assets { + if x != nil { + return x.Assets + } + return nil +} + +func (x *GenerateDependenciesRequest) GetOptions() *PluginOptions { + if x != nil { + return x.Options + } + return nil +} + +type GenerateDependenciesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dependencies []string `protobuf:"bytes,1,rep,name=dependencies,proto3" json:"dependencies,omitempty"` +} + +func (x *GenerateDependenciesResponse) Reset() { + *x = GenerateDependenciesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenerateDependenciesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateDependenciesResponse) ProtoMessage() {} + +func (x *GenerateDependenciesResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 GenerateDependenciesResponse.ProtoReflect.Descriptor instead. +func (*GenerateDependenciesResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{5} +} + +func (x *GenerateDependenciesResponse) GetDependencies() []string { + if x != nil { + return x.Dependencies + } + return nil +} + +type Configs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Configs []*Configs_Config `protobuf:"bytes,1,rep,name=configs,proto3" json:"configs,omitempty"` +} + +func (x *Configs) Reset() { + *x = Configs{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Configs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Configs) ProtoMessage() {} + +func (x *Configs) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 Configs.ProtoReflect.Descriptor instead. +func (*Configs) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{6} +} + +func (x *Configs) GetConfigs() []*Configs_Config { + if x != nil { + return x.Configs + } + return nil +} + +type Assets struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Assets []*Assets_Asset `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` +} + +func (x *Assets) Reset() { + *x = Assets{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Assets) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Assets) ProtoMessage() {} + +func (x *Assets) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 Assets.ProtoReflect.Descriptor instead. +func (*Assets) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{7} +} + +func (x *Assets) GetAssets() []*Assets_Asset { + if x != nil { + return x.Assets + } + return nil +} + +type InstanceData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` +} + +func (x *InstanceData) Reset() { + *x = InstanceData{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstanceData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstanceData) ProtoMessage() {} + +func (x *InstanceData) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 InstanceData.ProtoReflect.Descriptor instead. +func (*InstanceData) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{8} +} + +func (x *InstanceData) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *InstanceData) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *InstanceData) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +type CompileAssetsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Configs *Configs `protobuf:"bytes,1,opt,name=configs,proto3" json:"configs,omitempty"` + Assets *Assets `protobuf:"bytes,2,opt,name=assets,proto3" json:"assets,omitempty"` + InstanceData []*InstanceData `protobuf:"bytes,8,rep,name=instance_data,json=instanceData,proto3" json:"instance_data,omitempty"` + StartTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + Options *PluginOptions `protobuf:"bytes,40,opt,name=options,proto3" json:"options,omitempty"` +} + +func (x *CompileAssetsRequest) Reset() { + *x = CompileAssetsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompileAssetsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompileAssetsRequest) ProtoMessage() {} + +func (x *CompileAssetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 CompileAssetsRequest.ProtoReflect.Descriptor instead. +func (*CompileAssetsRequest) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{9} +} + +func (x *CompileAssetsRequest) GetConfigs() *Configs { + if x != nil { + return x.Configs + } + return nil +} + +func (x *CompileAssetsRequest) GetAssets() *Assets { + if x != nil { + return x.Assets + } + return nil +} + +func (x *CompileAssetsRequest) GetInstanceData() []*InstanceData { + if x != nil { + return x.InstanceData + } + return nil +} + +func (x *CompileAssetsRequest) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *CompileAssetsRequest) GetEndTime() *timestamppb.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +func (x *CompileAssetsRequest) GetOptions() *PluginOptions { + if x != nil { + return x.Options + } + return nil +} + +type CompileAssetsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Assets *Assets `protobuf:"bytes,1,opt,name=assets,proto3" json:"assets,omitempty"` +} + +func (x *CompileAssetsResponse) Reset() { + *x = CompileAssetsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompileAssetsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompileAssetsResponse) ProtoMessage() {} + +func (x *CompileAssetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 CompileAssetsResponse.ProtoReflect.Descriptor instead. +func (*CompileAssetsResponse) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{10} +} + +func (x *CompileAssetsResponse) GetAssets() *Assets { + if x != nil { + return x.Assets + } + return nil +} + +type PluginOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DryRun bool `protobuf:"varint,1,opt,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"` +} + +func (x *PluginOptions) Reset() { + *x = PluginOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PluginOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PluginOptions) ProtoMessage() {} + +func (x *PluginOptions) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 PluginOptions.ProtoReflect.Descriptor instead. +func (*PluginOptions) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{11} +} + +func (x *PluginOptions) GetDryRun() bool { + if x != nil { + return x.DryRun + } + return false +} + +type Configs_Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Configs_Config) Reset() { + *x = Configs_Config{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Configs_Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Configs_Config) ProtoMessage() {} + +func (x *Configs_Config) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 Configs_Config.ProtoReflect.Descriptor instead. +func (*Configs_Config) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *Configs_Config) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Configs_Config) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type Assets_Asset struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Assets_Asset) Reset() { + *x = Assets_Asset{} + if protoimpl.UnsafeEnabled { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Assets_Asset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Assets_Asset) ProtoMessage() {} + +func (x *Assets_Asset) ProtoReflect() protoreflect.Message { + mi := &file_raystack_optimus_plugins_v1beta1_dependency_resolver_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 Assets_Asset.ProtoReflect.Descriptor instead. +func (*Assets_Asset) Descriptor() ([]byte, []int) { + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *Assets_Asset) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Assets_Asset) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_raystack_optimus_plugins_v1beta1_dependency_resolver_proto protoreflect.FileDescriptor + +var file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDesc = []byte{ + 0x0a, 0x3d, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, + 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x23, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x25, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xfb, + 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x43, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, + 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x4c, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x6a, 0x0a, 0x1b, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, + 0x10, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x43, + 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x06, 0x61, 0x73, 0x73, + 0x65, 0x74, 0x73, 0x12, 0x4c, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x28, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x42, 0x0a, 0x1c, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, + 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x64, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x07, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x4d, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x1a, 0x32, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x86, 0x01, 0x0a, 0x06, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x49, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x73, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, + 0x1a, 0x31, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0x4c, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x22, 0xcd, 0x03, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x41, 0x73, 0x73, + 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x73, 0x12, 0x43, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, + 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x56, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, + 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x4c, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x28, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a, + 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, + 0x06, 0x22, 0x5c, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x22, + 0x28, 0x0a, 0x0d, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x17, 0x0a, 0x07, 0x64, 0x72, 0x79, 0x5f, 0x72, 0x75, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x64, 0x72, 0x79, 0x52, 0x75, 0x6e, 0x32, 0xd6, 0x04, 0x0a, 0x1c, 0x44, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, + 0x4d, 0x6f, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x07, 0x47, 0x65, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, + 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x98, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9b, 0x01, 0x0a, 0x14, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x63, 0x69, 0x65, 0x73, 0x12, 0x40, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x86, 0x01, 0x0a, 0x0d, 0x43, 0x6f, + 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x39, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, + 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, + 0x70, 0x69, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x42, 0x66, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x75, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x42, 0x1a, 0x44, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, + 0x4d, 0x6f, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescOnce sync.Once + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescData = file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDesc +) + +func file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescGZIP() []byte { + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescOnce.Do(func() { + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescData = protoimpl.X.CompressGZIP(file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescData) + }) + return file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDescData +} + +var file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_goTypes = []interface{}{ + (*GetNameRequest)(nil), // 0: raystack.optimus.plugins.v1beta1.GetNameRequest + (*GetNameResponse)(nil), // 1: raystack.optimus.plugins.v1beta1.GetNameResponse + (*GenerateDestinationRequest)(nil), // 2: raystack.optimus.plugins.v1beta1.GenerateDestinationRequest + (*GenerateDestinationResponse)(nil), // 3: raystack.optimus.plugins.v1beta1.GenerateDestinationResponse + (*GenerateDependenciesRequest)(nil), // 4: raystack.optimus.plugins.v1beta1.GenerateDependenciesRequest + (*GenerateDependenciesResponse)(nil), // 5: raystack.optimus.plugins.v1beta1.GenerateDependenciesResponse + (*Configs)(nil), // 6: raystack.optimus.plugins.v1beta1.Configs + (*Assets)(nil), // 7: raystack.optimus.plugins.v1beta1.Assets + (*InstanceData)(nil), // 8: raystack.optimus.plugins.v1beta1.InstanceData + (*CompileAssetsRequest)(nil), // 9: raystack.optimus.plugins.v1beta1.CompileAssetsRequest + (*CompileAssetsResponse)(nil), // 10: raystack.optimus.plugins.v1beta1.CompileAssetsResponse + (*PluginOptions)(nil), // 11: raystack.optimus.plugins.v1beta1.PluginOptions + (*Configs_Config)(nil), // 12: raystack.optimus.plugins.v1beta1.Configs.Config + (*Assets_Asset)(nil), // 13: raystack.optimus.plugins.v1beta1.Assets.Asset + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp +} +var file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_depIdxs = []int32{ + 6, // 0: raystack.optimus.plugins.v1beta1.GenerateDestinationRequest.config:type_name -> raystack.optimus.plugins.v1beta1.Configs + 7, // 1: raystack.optimus.plugins.v1beta1.GenerateDestinationRequest.assets:type_name -> raystack.optimus.plugins.v1beta1.Assets + 11, // 2: raystack.optimus.plugins.v1beta1.GenerateDestinationRequest.options:type_name -> raystack.optimus.plugins.v1beta1.PluginOptions + 6, // 3: raystack.optimus.plugins.v1beta1.GenerateDependenciesRequest.config:type_name -> raystack.optimus.plugins.v1beta1.Configs + 7, // 4: raystack.optimus.plugins.v1beta1.GenerateDependenciesRequest.assets:type_name -> raystack.optimus.plugins.v1beta1.Assets + 11, // 5: raystack.optimus.plugins.v1beta1.GenerateDependenciesRequest.options:type_name -> raystack.optimus.plugins.v1beta1.PluginOptions + 12, // 6: raystack.optimus.plugins.v1beta1.Configs.configs:type_name -> raystack.optimus.plugins.v1beta1.Configs.Config + 13, // 7: raystack.optimus.plugins.v1beta1.Assets.assets:type_name -> raystack.optimus.plugins.v1beta1.Assets.Asset + 6, // 8: raystack.optimus.plugins.v1beta1.CompileAssetsRequest.configs:type_name -> raystack.optimus.plugins.v1beta1.Configs + 7, // 9: raystack.optimus.plugins.v1beta1.CompileAssetsRequest.assets:type_name -> raystack.optimus.plugins.v1beta1.Assets + 8, // 10: raystack.optimus.plugins.v1beta1.CompileAssetsRequest.instance_data:type_name -> raystack.optimus.plugins.v1beta1.InstanceData + 14, // 11: raystack.optimus.plugins.v1beta1.CompileAssetsRequest.start_time:type_name -> google.protobuf.Timestamp + 14, // 12: raystack.optimus.plugins.v1beta1.CompileAssetsRequest.end_time:type_name -> google.protobuf.Timestamp + 11, // 13: raystack.optimus.plugins.v1beta1.CompileAssetsRequest.options:type_name -> raystack.optimus.plugins.v1beta1.PluginOptions + 7, // 14: raystack.optimus.plugins.v1beta1.CompileAssetsResponse.assets:type_name -> raystack.optimus.plugins.v1beta1.Assets + 0, // 15: raystack.optimus.plugins.v1beta1.DependencyResolverModService.GetName:input_type -> raystack.optimus.plugins.v1beta1.GetNameRequest + 2, // 16: raystack.optimus.plugins.v1beta1.DependencyResolverModService.GenerateDestination:input_type -> raystack.optimus.plugins.v1beta1.GenerateDestinationRequest + 4, // 17: raystack.optimus.plugins.v1beta1.DependencyResolverModService.GenerateDependencies:input_type -> raystack.optimus.plugins.v1beta1.GenerateDependenciesRequest + 9, // 18: raystack.optimus.plugins.v1beta1.DependencyResolverModService.CompileAssets:input_type -> raystack.optimus.plugins.v1beta1.CompileAssetsRequest + 1, // 19: raystack.optimus.plugins.v1beta1.DependencyResolverModService.GetName:output_type -> raystack.optimus.plugins.v1beta1.GetNameResponse + 3, // 20: raystack.optimus.plugins.v1beta1.DependencyResolverModService.GenerateDestination:output_type -> raystack.optimus.plugins.v1beta1.GenerateDestinationResponse + 5, // 21: raystack.optimus.plugins.v1beta1.DependencyResolverModService.GenerateDependencies:output_type -> raystack.optimus.plugins.v1beta1.GenerateDependenciesResponse + 10, // 22: raystack.optimus.plugins.v1beta1.DependencyResolverModService.CompileAssets:output_type -> raystack.optimus.plugins.v1beta1.CompileAssetsResponse + 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 +} + +func init() { file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_init() } +func file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_init() { + if File_raystack_optimus_plugins_v1beta1_dependency_resolver_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetNameRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetNameResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenerateDestinationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenerateDestinationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenerateDependenciesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenerateDependenciesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Configs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Assets); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstanceData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompileAssetsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompileAssetsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PluginOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Configs_Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Assets_Asset); 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_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_goTypes, + DependencyIndexes: file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_depIdxs, + MessageInfos: file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_msgTypes, + }.Build() + File_raystack_optimus_plugins_v1beta1_dependency_resolver_proto = out.File + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_rawDesc = nil + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_goTypes = nil + file_raystack_optimus_plugins_v1beta1_dependency_resolver_proto_depIdxs = nil +} diff --git a/protos/odpf/optimus/plugins/v1beta1/dependency_resolver.swagger.json b/protos/raystack/optimus/plugins/v1beta1/dependency_resolver.swagger.json similarity index 66% rename from protos/odpf/optimus/plugins/v1beta1/dependency_resolver.swagger.json rename to protos/raystack/optimus/plugins/v1beta1/dependency_resolver.swagger.json index f928c5fbd0..2dbf75bf8b 100644 --- a/protos/odpf/optimus/plugins/v1beta1/dependency_resolver.swagger.json +++ b/protos/raystack/optimus/plugins/v1beta1/dependency_resolver.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "odpf/optimus/plugins/v1beta1/dependency_resolver.proto", + "title": "raystack/optimus/plugins/v1beta1/dependency_resolver.proto", "version": "version not set" }, "tags": [ @@ -9,12 +9,8 @@ "name": "DependencyResolverModService" } ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], + "consumes": ["application/json"], + "produces": ["application/json"], "paths": {}, "definitions": { "AssetsAsset": { @@ -39,17 +35,6 @@ } } }, - "ProjectSpecificationProjectSecret": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, "protobufAny": { "type": "object", "properties": { @@ -140,7 +125,7 @@ } } }, - "v1beta1InstanceSpecData": { + "v1beta1InstanceData": { "type": "object", "properties": { "name": { @@ -150,20 +135,10 @@ "type": "string" }, "type": { - "$ref": "#/definitions/v1beta1InstanceSpecDataType" + "type": "string" } } }, - "v1beta1InstanceSpecDataType": { - "type": "string", - "enum": [ - "TYPE_UNSPECIFIED", - "TYPE_ENV", - "TYPE_FILE" - ], - "default": "TYPE_UNSPECIFIED", - "title": "type of data, could be an env var or file" - }, "v1beta1PluginOptions": { "type": "object", "properties": { @@ -171,40 +146,6 @@ "type": "boolean" } } - }, - "v1beta1ProjectSpecification": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "config": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "secrets": { - "type": "array", - "items": { - "$ref": "#/definitions/ProjectSpecificationProjectSecret" - } - } - } - }, - "v1beta1TaskWindow": { - "type": "object", - "properties": { - "size": { - "type": "string" - }, - "offset": { - "type": "string" - }, - "truncateTo": { - "type": "string" - } - } } } } diff --git a/protos/odpf/optimus/plugins/v1beta1/dependency_resolver_grpc.pb.go b/protos/raystack/optimus/plugins/v1beta1/dependency_resolver_grpc.pb.go similarity index 89% rename from protos/odpf/optimus/plugins/v1beta1/dependency_resolver_grpc.pb.go rename to protos/raystack/optimus/plugins/v1beta1/dependency_resolver_grpc.pb.go index 053597a21c..1a6d37cad9 100644 --- a/protos/odpf/optimus/plugins/v1beta1/dependency_resolver_grpc.pb.go +++ b/protos/raystack/optimus/plugins/v1beta1/dependency_resolver_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: odpf/optimus/plugins/v1beta1/dependency_resolver.proto +// source: raystack/optimus/plugins/v1beta1/dependency_resolver.proto package optimus @@ -43,7 +43,7 @@ func NewDependencyResolverModServiceClient(cc grpc.ClientConnInterface) Dependen func (c *dependencyResolverModServiceClient) GetName(ctx context.Context, in *GetNameRequest, opts ...grpc.CallOption) (*GetNameResponse, error) { out := new(GetNameResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.plugins.v1beta1.DependencyResolverModService/GetName", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.plugins.v1beta1.DependencyResolverModService/GetName", in, out, opts...) if err != nil { return nil, err } @@ -52,7 +52,7 @@ func (c *dependencyResolverModServiceClient) GetName(ctx context.Context, in *Ge func (c *dependencyResolverModServiceClient) GenerateDestination(ctx context.Context, in *GenerateDestinationRequest, opts ...grpc.CallOption) (*GenerateDestinationResponse, error) { out := new(GenerateDestinationResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.plugins.v1beta1.DependencyResolverModService/GenerateDestination", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.plugins.v1beta1.DependencyResolverModService/GenerateDestination", in, out, opts...) if err != nil { return nil, err } @@ -61,7 +61,7 @@ func (c *dependencyResolverModServiceClient) GenerateDestination(ctx context.Con func (c *dependencyResolverModServiceClient) GenerateDependencies(ctx context.Context, in *GenerateDependenciesRequest, opts ...grpc.CallOption) (*GenerateDependenciesResponse, error) { out := new(GenerateDependenciesResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.plugins.v1beta1.DependencyResolverModService/GenerateDependencies", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.plugins.v1beta1.DependencyResolverModService/GenerateDependencies", in, out, opts...) if err != nil { return nil, err } @@ -70,7 +70,7 @@ func (c *dependencyResolverModServiceClient) GenerateDependencies(ctx context.Co func (c *dependencyResolverModServiceClient) CompileAssets(ctx context.Context, in *CompileAssetsRequest, opts ...grpc.CallOption) (*CompileAssetsResponse, error) { out := new(CompileAssetsResponse) - err := c.cc.Invoke(ctx, "/odpf.optimus.plugins.v1beta1.DependencyResolverModService/CompileAssets", in, out, opts...) + err := c.cc.Invoke(ctx, "/raystack.optimus.plugins.v1beta1.DependencyResolverModService/CompileAssets", in, out, opts...) if err != nil { return nil, err } @@ -133,7 +133,7 @@ func _DependencyResolverModService_GetName_Handler(srv interface{}, ctx context. } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.plugins.v1beta1.DependencyResolverModService/GetName", + FullMethod: "/raystack.optimus.plugins.v1beta1.DependencyResolverModService/GetName", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DependencyResolverModServiceServer).GetName(ctx, req.(*GetNameRequest)) @@ -151,7 +151,7 @@ func _DependencyResolverModService_GenerateDestination_Handler(srv interface{}, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.plugins.v1beta1.DependencyResolverModService/GenerateDestination", + FullMethod: "/raystack.optimus.plugins.v1beta1.DependencyResolverModService/GenerateDestination", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DependencyResolverModServiceServer).GenerateDestination(ctx, req.(*GenerateDestinationRequest)) @@ -169,7 +169,7 @@ func _DependencyResolverModService_GenerateDependencies_Handler(srv interface{}, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.plugins.v1beta1.DependencyResolverModService/GenerateDependencies", + FullMethod: "/raystack.optimus.plugins.v1beta1.DependencyResolverModService/GenerateDependencies", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DependencyResolverModServiceServer).GenerateDependencies(ctx, req.(*GenerateDependenciesRequest)) @@ -187,7 +187,7 @@ func _DependencyResolverModService_CompileAssets_Handler(srv interface{}, ctx co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/odpf.optimus.plugins.v1beta1.DependencyResolverModService/CompileAssets", + FullMethod: "/raystack.optimus.plugins.v1beta1.DependencyResolverModService/CompileAssets", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DependencyResolverModServiceServer).CompileAssets(ctx, req.(*CompileAssetsRequest)) @@ -199,7 +199,7 @@ func _DependencyResolverModService_CompileAssets_Handler(srv interface{}, ctx co // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var DependencyResolverModService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "odpf.optimus.plugins.v1beta1.DependencyResolverModService", + ServiceName: "raystack.optimus.plugins.v1beta1.DependencyResolverModService", HandlerType: (*DependencyResolverModServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -220,5 +220,5 @@ var DependencyResolverModService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "odpf/optimus/plugins/v1beta1/dependency_resolver.proto", + Metadata: "raystack/optimus/plugins/v1beta1/dependency_resolver.proto", } diff --git a/sdk/go.mod b/sdk/go.mod index ade720ac0e..639690f342 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -1,4 +1,4 @@ -module github.com/odpf/optimus/sdk +module github.com/raystack/optimus/sdk go 1.18 diff --git a/sdk/plugin/mock/mods.go b/sdk/plugin/mock/mods.go index 6b54c276a8..74e6399c61 100644 --- a/sdk/plugin/mock/mods.go +++ b/sdk/plugin/mock/mods.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/mock" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/sdk/plugin" ) type YamlMod struct { diff --git a/sdk/plugin/mock/plugin.go b/sdk/plugin/mock/plugin.go index fd4b45874b..110ea95a35 100644 --- a/sdk/plugin/mock/plugin.go +++ b/sdk/plugin/mock/plugin.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/sdk/plugin" ) func NewMockBinaryPlugin(name, pluginType string) *plugin.Plugin { diff --git a/sdk/plugin/plugin_test.go b/sdk/plugin/plugin_test.go index 5182516558..8ec4dfa907 100644 --- a/sdk/plugin/plugin_test.go +++ b/sdk/plugin/plugin_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/odpf/optimus/sdk/plugin" - "github.com/odpf/optimus/sdk/plugin/mock" + "github.com/raystack/optimus/sdk/plugin" + "github.com/raystack/optimus/sdk/plugin/mock" ) func TestPlugins(t *testing.T) { @@ -47,7 +47,7 @@ func TestPlugins(t *testing.T) { err: errors.New("plugin name cannot be empty"), info: plugin.Info{ Name: "", - Image: "odpf.io/example", + Image: "raystack.io/example", PluginVersion: "0.2", Entrypoint: plugin.Entrypoint{ Script: "sleep 10", @@ -73,7 +73,7 @@ func TestPlugins(t *testing.T) { err: errors.New("plugin version cannot be empty"), info: plugin.Info{ Name: "example", - Image: "odpf.io/example", + Image: "raystack.io/example", PluginVersion: "", Entrypoint: plugin.Entrypoint{ Script: "sleep 10", @@ -86,7 +86,7 @@ func TestPlugins(t *testing.T) { err: errors.New("entrypoint args cannot be empty"), info: plugin.Info{ Name: "example", - Image: "odpf.io/example", + Image: "raystack.io/example", PluginVersion: "0.2", Entrypoint: plugin.Entrypoint{}, PluginType: plugin.TypeTask, @@ -97,7 +97,7 @@ func TestPlugins(t *testing.T) { err: errors.New("plugin type is not supported"), info: plugin.Info{ Name: "example", - Image: "odpf.io/example", + Image: "raystack.io/example", PluginVersion: "0.2", Entrypoint: plugin.Entrypoint{ Script: "sleep 10", @@ -110,7 +110,7 @@ func TestPlugins(t *testing.T) { err: nil, info: plugin.Info{ Name: "example", - Image: "odpf.io/example", + Image: "raystack.io/example", PluginVersion: "0.2", Entrypoint: plugin.Entrypoint{ Script: "sleep 10", diff --git a/server/cmd/migration/migrate_to.go b/server/cmd/migration/migrate_to.go index 32cb7048d1..cba6572ad6 100644 --- a/server/cmd/migration/migrate_to.go +++ b/server/cmd/migration/migrate_to.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/store/postgres" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/store/postgres" ) type migrateTo struct { diff --git a/server/cmd/migration/rollback.go b/server/cmd/migration/rollback.go index a0cf374d35..f9488c5195 100644 --- a/server/cmd/migration/rollback.go +++ b/server/cmd/migration/rollback.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/store/postgres" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/store/postgres" ) type rollbackCommand struct { diff --git a/server/cmd/serve.go b/server/cmd/serve.go index fa228f4bfc..eaad343b9a 100644 --- a/server/cmd/serve.go +++ b/server/cmd/serve.go @@ -8,9 +8,9 @@ import ( "github.com/spf13/cobra" - "github.com/odpf/optimus/config" - oplugin "github.com/odpf/optimus/plugin" - "github.com/odpf/optimus/server" + "github.com/raystack/optimus/config" + oplugin "github.com/raystack/optimus/plugin" + "github.com/raystack/optimus/server" ) type serveCommand struct { diff --git a/server/handler/v1beta1/version.go b/server/handler/v1beta1/version.go index 3534bf51b9..774fb4f9c6 100644 --- a/server/handler/v1beta1/version.go +++ b/server/handler/v1beta1/version.go @@ -3,9 +3,9 @@ package v1beta1 import ( "context" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) type VersionHandler struct { diff --git a/server/handler/v1beta1/version_test.go b/server/handler/v1beta1/version_test.go index c579454dbc..5114b62dc3 100644 --- a/server/handler/v1beta1/version_test.go +++ b/server/handler/v1beta1/version_test.go @@ -4,11 +4,11 @@ import ( "context" "testing" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/stretchr/testify/assert" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" - v1 "github.com/odpf/optimus/server/handler/v1beta1" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" + v1 "github.com/raystack/optimus/server/handler/v1beta1" ) func TestVersionHandler(t *testing.T) { diff --git a/server/logger.go b/server/logger.go index a226ab5359..22b839df80 100644 --- a/server/logger.go +++ b/server/logger.go @@ -5,7 +5,7 @@ import ( "io" "os" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" ) type defaultLogger struct { diff --git a/server/optimus.go b/server/optimus.go index af831e4f37..0bca5b6678 100644 --- a/server/optimus.go +++ b/server/optimus.go @@ -13,38 +13,41 @@ import ( "github.com/hashicorp/go-hclog" hPlugin "github.com/hashicorp/go-plugin" "github.com/jackc/pgx/v5/pgxpool" - "github.com/odpf/salt/log" + "github.com/mitchellh/mapstructure" "github.com/prometheus/client_golang/prometheus" + "github.com/raystack/salt/log" slackapi "github.com/slack-go/slack" "google.golang.org/grpc" - "github.com/odpf/optimus/config" - jHandler "github.com/odpf/optimus/core/job/handler/v1beta1" - jResolver "github.com/odpf/optimus/core/job/resolver" - jService "github.com/odpf/optimus/core/job/service" - rModel "github.com/odpf/optimus/core/resource" - rHandler "github.com/odpf/optimus/core/resource/handler/v1beta1" - rService "github.com/odpf/optimus/core/resource/service" - schedulerHandler "github.com/odpf/optimus/core/scheduler/handler/v1beta1" - schedulerResolver "github.com/odpf/optimus/core/scheduler/resolver" - schedulerService "github.com/odpf/optimus/core/scheduler/service" - tHandler "github.com/odpf/optimus/core/tenant/handler/v1beta1" - tService "github.com/odpf/optimus/core/tenant/service" - "github.com/odpf/optimus/ext/notify/pagerduty" - "github.com/odpf/optimus/ext/notify/slack" - bqStore "github.com/odpf/optimus/ext/store/bigquery" - "github.com/odpf/optimus/internal/compiler" - "github.com/odpf/optimus/internal/errors" - "github.com/odpf/optimus/internal/models" - "github.com/odpf/optimus/internal/store/postgres" - jRepo "github.com/odpf/optimus/internal/store/postgres/job" - "github.com/odpf/optimus/internal/store/postgres/resource" - schedulerRepo "github.com/odpf/optimus/internal/store/postgres/scheduler" - "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/internal/telemetry" - "github.com/odpf/optimus/plugin" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" - oHandler "github.com/odpf/optimus/server/handler/v1beta1" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/core/event/moderator" + jHandler "github.com/raystack/optimus/core/job/handler/v1beta1" + jResolver "github.com/raystack/optimus/core/job/resolver" + jService "github.com/raystack/optimus/core/job/service" + rModel "github.com/raystack/optimus/core/resource" + rHandler "github.com/raystack/optimus/core/resource/handler/v1beta1" + rService "github.com/raystack/optimus/core/resource/service" + schedulerHandler "github.com/raystack/optimus/core/scheduler/handler/v1beta1" + schedulerResolver "github.com/raystack/optimus/core/scheduler/resolver" + schedulerService "github.com/raystack/optimus/core/scheduler/service" + tHandler "github.com/raystack/optimus/core/tenant/handler/v1beta1" + tService "github.com/raystack/optimus/core/tenant/service" + "github.com/raystack/optimus/ext/notify/pagerduty" + "github.com/raystack/optimus/ext/notify/slack" + bqStore "github.com/raystack/optimus/ext/store/bigquery" + "github.com/raystack/optimus/ext/transport/kafka" + "github.com/raystack/optimus/internal/compiler" + "github.com/raystack/optimus/internal/errors" + "github.com/raystack/optimus/internal/models" + "github.com/raystack/optimus/internal/store/postgres" + jRepo "github.com/raystack/optimus/internal/store/postgres/job" + "github.com/raystack/optimus/internal/store/postgres/resource" + schedulerRepo "github.com/raystack/optimus/internal/store/postgres/scheduler" + "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/internal/telemetry" + "github.com/raystack/optimus/plugin" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" + oHandler "github.com/raystack/optimus/server/handler/v1beta1" ) const keyLength = 32 @@ -64,6 +67,8 @@ type OptimusServer struct { pluginRepo *models.PluginRepository cleanupFn []func() + + eventHandler moderator.Handler } func New(conf *config.ServerConfig) (*OptimusServer, error) { @@ -79,6 +84,7 @@ func New(conf *config.ServerConfig) (*OptimusServer, error) { } setupFns := []setupFn{ + server.setupPublisher, server.setupPlugins, server.setupTelemetry, server.setupAppKey, @@ -101,6 +107,45 @@ func New(conf *config.ServerConfig) (*OptimusServer, error) { return server, nil } +func (s *OptimusServer) setupPublisher() error { + if s.conf.Publisher == nil { + s.eventHandler = moderator.NoOpHandler{} + return nil + } + + ch := make(chan []byte, s.conf.Publisher.Buffer) + + var worker *moderator.Worker + + switch s.conf.Publisher.Type { + case "kafka": + var kafkaConfig config.PublisherKafkaConfig + if err := mapstructure.Decode(s.conf.Publisher.Config, &kafkaConfig); err != nil { + return err + } + + writer := kafka.NewWriter(kafkaConfig.BrokerURLs, kafkaConfig.Topic, s.logger) + interval := time.Second * time.Duration(kafkaConfig.BatchIntervalSecond) + worker = moderator.NewWorker(ch, writer, interval, s.logger) + default: + return fmt.Errorf("publisher with type [%s] is not recognized", s.conf.Publisher.Type) + } + + ctx, cancel := context.WithCancel(context.Background()) + go worker.Run(ctx) + + s.cleanupFn = append(s.cleanupFn, func() { + cancel() + + if err := worker.Close(); err != nil { + s.logger.Error("error closing publishing worker: %v", err) + } + }) + + s.eventHandler = moderator.NewEventHandler(ch, s.logger) + return nil +} + func (s *OptimusServer) setupPlugins() error { pluginLogLevel := hclog.Info if s.conf.Log.Level == config.LogLevelDebug { @@ -235,20 +280,8 @@ func (s *OptimusServer) setupHandlers() error { tProjectService := tService.NewProjectService(tProjectRepo) tNamespaceService := tService.NewNamespaceService(tNamespaceRepo) - tSecretService := tService.NewSecretService(s.key, tSecretRepo) - tenantService := tService.NewTenantService(tProjectService, tNamespaceService, tSecretService) - - // Resource Bounded Context - resourceRepository := resource.NewRepository(s.dbPool) - backupRepository := resource.NewBackupRepository(s.dbPool) - resourceManager := rService.NewResourceManager(resourceRepository, s.logger) - resourceService := rService.NewResourceService(s.logger, resourceRepository, resourceManager, tenantService) - backupService := rService.NewBackupService(backupRepository, resourceRepository, resourceManager) - - // Register datastore - bqClientProvider := bqStore.NewClientProvider() - bigqueryStore := bqStore.NewBigqueryDataStore(tenantService, bqClientProvider) - resourceManager.RegisterDatastore(rModel.Bigquery, bigqueryStore) + tSecretService := tService.NewSecretService(s.key, tSecretRepo, s.logger) + tenantService := tService.NewTenantService(tProjectService, tNamespaceService, tSecretService, s.logger) // Scheduler bounded context jobRunRepo := schedulerRepo.NewJobRunRepository(s.dbPool) @@ -277,9 +310,9 @@ func (s *OptimusServer) setupHandlers() error { newEngine := compiler.NewEngine() - newPriorityResolver := schedulerResolver.NewPriorityResolver() - assetCompiler := schedulerService.NewJobAssetsCompiler(newEngine, s.pluginRepo) - jobInputCompiler := schedulerService.NewJobInputCompiler(tenantService, newEngine, assetCompiler) + newPriorityResolver := schedulerResolver.NewSimpleResolver() + assetCompiler := schedulerService.NewJobAssetsCompiler(newEngine, s.pluginRepo, s.logger) + jobInputCompiler := schedulerService.NewJobInputCompiler(tenantService, newEngine, assetCompiler, s.logger) notificationService := schedulerService.NewNotifyService(s.logger, jobProviderRepo, tenantService, notifierChanels) newScheduler, err := NewScheduler(s.logger, s.conf, s.pluginRepo, tProjectService, tSecretService) if err != nil { @@ -291,10 +324,11 @@ func (s *OptimusServer) setupHandlers() error { replayManager := schedulerService.NewReplayManager(s.logger, replayRepository, replayWorker, func() time.Time { return time.Now().UTC() }, s.conf.Replay) - replayValidator := schedulerService.NewValidator(replayRepository, newScheduler) - replayService := schedulerService.NewReplayService(replayRepository, jobProviderRepo, replayValidator) - newJobRunService := schedulerService.NewJobRunService(s.logger, jobProviderRepo, jobRunRepo, replayRepository, operatorRunRepository, newScheduler, newPriorityResolver, jobInputCompiler) + replayValidator := schedulerService.NewValidator(replayRepository, newScheduler, jobProviderRepo) + replayService := schedulerService.NewReplayService(replayRepository, jobProviderRepo, replayValidator, s.logger) + + newJobRunService := schedulerService.NewJobRunService(s.logger, jobProviderRepo, jobRunRepo, replayRepository, operatorRunRepository, newScheduler, newPriorityResolver, jobInputCompiler, s.eventHandler) // Job Bounded Context Setup jJobRepo := jRepo.NewJobRepository(s.dbPool) @@ -302,7 +336,19 @@ func (s *OptimusServer) setupHandlers() error { jExternalUpstreamResolver, _ := jResolver.NewExternalUpstreamResolver(s.conf.ResourceManagers) jInternalUpstreamResolver := jResolver.NewInternalUpstreamResolver(jJobRepo) jUpstreamResolver := jResolver.NewUpstreamResolver(jJobRepo, jExternalUpstreamResolver, jInternalUpstreamResolver) - jJobService := jService.NewJobService(jJobRepo, jPluginService, jUpstreamResolver, tenantService, s.logger) + jJobService := jService.NewJobService(jJobRepo, jJobRepo, jJobRepo, jPluginService, jUpstreamResolver, tenantService, s.eventHandler, s.logger, newJobRunService, newScheduler) + + // Resource Bounded Context + resourceRepository := resource.NewRepository(s.dbPool) + backupRepository := resource.NewBackupRepository(s.dbPool) + resourceManager := rService.NewResourceManager(resourceRepository, s.logger) + resourceService := rService.NewResourceService(s.logger, resourceRepository, jJobService, resourceManager, s.eventHandler) + backupService := rService.NewBackupService(backupRepository, resourceRepository, resourceManager, s.logger) + + // Register datastore + bqClientProvider := bqStore.NewClientProvider() + bigqueryStore := bqStore.NewBigqueryDataStore(tenantService, bqClientProvider) + resourceManager.RegisterDatastore(rModel.Bigquery, bigqueryStore) // Tenant Handlers pb.RegisterSecretServiceServer(s.grpcServer, tHandler.NewSecretsHandler(s.logger, tSecretService)) diff --git a/server/scheduler.go b/server/scheduler.go index e7cb230937..da165decd6 100644 --- a/server/scheduler.go +++ b/server/scheduler.go @@ -1,12 +1,12 @@ package server import ( - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/ext/scheduler/airflow" - "github.com/odpf/optimus/ext/scheduler/airflow/bucket" - "github.com/odpf/optimus/ext/scheduler/airflow/dag" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/ext/scheduler/airflow" + "github.com/raystack/optimus/ext/scheduler/airflow/bucket" + "github.com/raystack/optimus/ext/scheduler/airflow/dag" ) func NewScheduler(l log.Logger, conf *config.ServerConfig, pluginRepo dag.PluginRepo, projecGetter airflow.ProjectGetter, diff --git a/server/server.go b/server/server.go index a5db1e5002..68fc708c03 100644 --- a/server/server.go +++ b/server/server.go @@ -15,7 +15,7 @@ import ( grpctags "github.com/grpc-ecosystem/go-grpc-middleware/tags" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/odpf/salt/log" + "github.com/raystack/salt/log" "github.com/sirupsen/logrus" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" @@ -28,9 +28,9 @@ import ( "google.golang.org/grpc/reflection" "google.golang.org/grpc/status" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/plugin" - pb "github.com/odpf/optimus/protos/odpf/optimus/core/v1beta1" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/plugin" + pb "github.com/raystack/optimus/protos/raystack/optimus/core/v1beta1" ) const ( diff --git a/tests/bench/job/job_repo_test.go b/tests/bench/job/job_repo_test.go index 9c84e467e4..885ad6d9da 100644 --- a/tests/bench/job/job_repo_test.go +++ b/tests/bench/job/job_repo_test.go @@ -10,11 +10,11 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - serviceJob "github.com/odpf/optimus/core/job" - serviceTenant "github.com/odpf/optimus/core/tenant" - repoJob "github.com/odpf/optimus/internal/store/postgres/job" - repoTenant "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + serviceJob "github.com/raystack/optimus/core/job" + serviceTenant "github.com/raystack/optimus/core/tenant" + repoJob "github.com/raystack/optimus/internal/store/postgres/job" + repoTenant "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func BenchmarkJobRepository(b *testing.B) { diff --git a/tests/bench/resource/backup_repo_test.go b/tests/bench/resource/backup_repo_test.go index 9f13d1e4ac..92033bee51 100644 --- a/tests/bench/resource/backup_repo_test.go +++ b/tests/bench/resource/backup_repo_test.go @@ -10,11 +10,11 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - serviceResource "github.com/odpf/optimus/core/resource" - serviceTenant "github.com/odpf/optimus/core/tenant" - repoResource "github.com/odpf/optimus/internal/store/postgres/resource" - repoTenant "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + serviceResource "github.com/raystack/optimus/core/resource" + serviceTenant "github.com/raystack/optimus/core/tenant" + repoResource "github.com/raystack/optimus/internal/store/postgres/resource" + repoTenant "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func BenchmarkBackupRepository(b *testing.B) { diff --git a/tests/bench/resource/resource_repo_test.go b/tests/bench/resource/resource_repo_test.go index bfe2591daa..9f1bddb051 100644 --- a/tests/bench/resource/resource_repo_test.go +++ b/tests/bench/resource/resource_repo_test.go @@ -10,12 +10,12 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - serviceResource "github.com/odpf/optimus/core/resource" - serviceTenant "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/ext/store/bigquery" - repoResource "github.com/odpf/optimus/internal/store/postgres/resource" - repoTenant "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + serviceResource "github.com/raystack/optimus/core/resource" + serviceTenant "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/ext/store/bigquery" + repoResource "github.com/raystack/optimus/internal/store/postgres/resource" + repoTenant "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func BenchmarkResourceRepository(b *testing.B) { diff --git a/tests/bench/scheduler/job_repo_test.go b/tests/bench/scheduler/job_repo_test.go index ce7776c87b..805da3b06a 100644 --- a/tests/bench/scheduler/job_repo_test.go +++ b/tests/bench/scheduler/job_repo_test.go @@ -10,13 +10,13 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - serviceJob "github.com/odpf/optimus/core/job" - serviceScheduler "github.com/odpf/optimus/core/scheduler" - serviceTenant "github.com/odpf/optimus/core/tenant" - repoJob "github.com/odpf/optimus/internal/store/postgres/job" - repoScheduler "github.com/odpf/optimus/internal/store/postgres/scheduler" - repoTenant "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + serviceJob "github.com/raystack/optimus/core/job" + serviceScheduler "github.com/raystack/optimus/core/scheduler" + serviceTenant "github.com/raystack/optimus/core/tenant" + repoJob "github.com/raystack/optimus/internal/store/postgres/job" + repoScheduler "github.com/raystack/optimus/internal/store/postgres/scheduler" + repoTenant "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func BenchmarkJobRepository(b *testing.B) { diff --git a/tests/bench/scheduler/job_run_repo_test.go b/tests/bench/scheduler/job_run_repo_test.go index 3e1a0969e6..d47ceb5908 100644 --- a/tests/bench/scheduler/job_run_repo_test.go +++ b/tests/bench/scheduler/job_run_repo_test.go @@ -11,13 +11,13 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - serviceJob "github.com/odpf/optimus/core/job" - serviceScheduler "github.com/odpf/optimus/core/scheduler" - serviceTenant "github.com/odpf/optimus/core/tenant" - repoJob "github.com/odpf/optimus/internal/store/postgres/job" - repoScheduler "github.com/odpf/optimus/internal/store/postgres/scheduler" - repoTenant "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + serviceJob "github.com/raystack/optimus/core/job" + serviceScheduler "github.com/raystack/optimus/core/scheduler" + serviceTenant "github.com/raystack/optimus/core/tenant" + repoJob "github.com/raystack/optimus/internal/store/postgres/job" + repoScheduler "github.com/raystack/optimus/internal/store/postgres/scheduler" + repoTenant "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func BenchmarkJobRunRepository(b *testing.B) { diff --git a/tests/bench/scheduler/operator_run_repo_test.go b/tests/bench/scheduler/operator_run_repo_test.go index 4662dc9323..29e0bb6f77 100644 --- a/tests/bench/scheduler/operator_run_repo_test.go +++ b/tests/bench/scheduler/operator_run_repo_test.go @@ -11,13 +11,13 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - serviceJob "github.com/odpf/optimus/core/job" - serviceScheduler "github.com/odpf/optimus/core/scheduler" - serviceTenant "github.com/odpf/optimus/core/tenant" - repoJob "github.com/odpf/optimus/internal/store/postgres/job" - repoScheduler "github.com/odpf/optimus/internal/store/postgres/scheduler" - repoTenant "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + serviceJob "github.com/raystack/optimus/core/job" + serviceScheduler "github.com/raystack/optimus/core/scheduler" + serviceTenant "github.com/raystack/optimus/core/tenant" + repoJob "github.com/raystack/optimus/internal/store/postgres/job" + repoScheduler "github.com/raystack/optimus/internal/store/postgres/scheduler" + repoTenant "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func BenchmarkOperatorRunRepository(b *testing.B) { diff --git a/tests/bench/tenant/namespace_repo_test.go b/tests/bench/tenant/namespace_repo_test.go index 949dc489d3..6a148b264b 100644 --- a/tests/bench/tenant/namespace_repo_test.go +++ b/tests/bench/tenant/namespace_repo_test.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - serviceTenant "github.com/odpf/optimus/core/tenant" - repoTenant "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + serviceTenant "github.com/raystack/optimus/core/tenant" + repoTenant "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func BenchmarkNamespaceRepository(b *testing.B) { diff --git a/tests/bench/tenant/project_repo_test.go b/tests/bench/tenant/project_repo_test.go index cdd15c2f51..71939cb68c 100644 --- a/tests/bench/tenant/project_repo_test.go +++ b/tests/bench/tenant/project_repo_test.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - serviceTenant "github.com/odpf/optimus/core/tenant" - repoTenant "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + serviceTenant "github.com/raystack/optimus/core/tenant" + repoTenant "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func BenchmarkProjectRepository(b *testing.B) { diff --git a/tests/bench/tenant/secret_repo_test.go b/tests/bench/tenant/secret_repo_test.go index fdc59a3f02..f1e88960b1 100644 --- a/tests/bench/tenant/secret_repo_test.go +++ b/tests/bench/tenant/secret_repo_test.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" - serviceTenant "github.com/odpf/optimus/core/tenant" - repoTenant "github.com/odpf/optimus/internal/store/postgres/tenant" - "github.com/odpf/optimus/tests/setup" + serviceTenant "github.com/raystack/optimus/core/tenant" + repoTenant "github.com/raystack/optimus/internal/store/postgres/tenant" + "github.com/raystack/optimus/tests/setup" ) func BenchmarkSecretRepository(b *testing.B) { diff --git a/tests/setup/database.go b/tests/setup/database.go index daaf5d4a13..d909215f04 100644 --- a/tests/setup/database.go +++ b/tests/setup/database.go @@ -11,8 +11,8 @@ import ( "github.com/golang-migrate/migrate/v4" "github.com/jackc/pgx/v5/pgxpool" - "github.com/odpf/optimus/config" - "github.com/odpf/optimus/internal/store/postgres" + "github.com/raystack/optimus/config" + "github.com/raystack/optimus/internal/store/postgres" ) var ( diff --git a/tests/setup/job.go b/tests/setup/job.go index 8e164f85f9..2cb6125127 100644 --- a/tests/setup/job.go +++ b/tests/setup/job.go @@ -1,9 +1,9 @@ package setup import ( - "github.com/odpf/optimus/core/job" - "github.com/odpf/optimus/core/tenant" - "github.com/odpf/optimus/internal/models" + "github.com/raystack/optimus/core/job" + "github.com/raystack/optimus/core/tenant" + "github.com/raystack/optimus/internal/models" ) type DummyJobBuilder struct { diff --git a/tests/setup/plugin.go b/tests/setup/plugin.go index 56ee6edcd7..d54b1becb6 100644 --- a/tests/setup/plugin.go +++ b/tests/setup/plugin.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/odpf/optimus/sdk/plugin" + "github.com/raystack/optimus/sdk/plugin" ) type MockPluginBQ struct{}