diff --git a/.devcontainer/setup.py b/.devcontainer/setup.py index 829c77fb85..f57267ac07 100755 --- a/.devcontainer/setup.py +++ b/.devcontainer/setup.py @@ -1,8 +1,7 @@ -#!/usr/bin/python2 +#!/usr/bin/python3 # See CONTRIBUTING.md. -from __future__ import print_function, unicode_literals import os import subprocess import time @@ -10,7 +9,7 @@ GO_VERSION = os.getenv("GO_VERSION") if GO_VERSION is None: - raise "GO_VERSION is not set" + raise RuntimeError("GO_VERSION is not set") def run_commands(commands): @@ -25,21 +24,16 @@ def install_packages(): """Installs required and useful RPM packages.""" run_commands([ - # to install man pages - "sed -i '/nodocs/d' /etc/yum.conf", - - # reinstall with man pages - "yum reinstall -y yum rpm", - - "yum install -y gcc git make pkgconfig glibc-static \ + "dnf install -y gcc git make pkgconfig \ vim \ - ansible-lint \ mc tmux psmisc lsof which iproute \ - bash-completion bash-completion-extras \ + bash-completion \ man man-pages \ - dh-autoreconf \ openssl-devel \ - wget" + wget", + + "dnf install -y ansible-lint glibc-static --enablerepo=ol9_codeready_builder" + ]) @@ -51,7 +45,7 @@ def install_go(): "chmod +x /usr/local/bin/gimme" ]) - go_version = str(subprocess.check_output("gimme -r " + GO_VERSION, shell=True).strip()) + go_version = str(subprocess.check_output("gimme -r " + GO_VERSION, shell=True).strip().decode()) if GO_VERSION == "tip": run_commands([ @@ -105,7 +99,8 @@ def main(): make_init() # do basic setup - setup() + # TODO: fix the setup and revert + # setup() MARKER = "/tmp/devcontainer-setup-done" diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 71e4fab6ff..68d20180a2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,16 +1,11 @@ * @percona/pmm-review-be -/build/ @atymchuk @percona/pmm-review-be -/admin/ @percona/pmm-review-be /agent/agents/postgres/ @JiriCtvrtka @percona/pmm-review-be /agent/runner/ @artemgavrilov @percona/pmm-review-be /api/ @BupycHuk @percona/pmm-review-be -/docs/api/ @atymchuk @percona/pmm-review-be /managed/services/checks/ @idoqo @percona/pmm-review-be -/managed/ @percona/pmm-review-be /managed/services/dbaas @gen1us2k @recharte @percona/pmm-review-be /managed/services/management/dbaas @gen1us2k @recharte @percona/pmm-review-be /update/ @BupycHuk @talhabinrizwan @percona/pmm-review-be -/api-tests/ @percona/pmm-review-be **/go.mod @percona/pmm-review-dependency @percona/pmm-review-be **/Dockerfile @percona/pmm-review-dependency @percona/pmm-review-be /cli-tests/package.json @percona/pmm-review-dependency @yurkovychv diff --git a/.github/workflows/admin.yml b/.github/workflows/admin.yml index 64d05ed1ca..625e33324a 100644 --- a/.github/workflows/admin.yml +++ b/.github/workflows/admin.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 @@ -82,6 +82,7 @@ jobs: cli-test: name: CLI Tests + if: false runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -94,7 +95,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 @@ -126,7 +127,6 @@ jobs: - name: Setup tools run: | - sudo apt-get install -y wget jq sudo ln -sf /home/runner/go/bin/pmm /usr/bin sudo chown -R runner:docker /usr/bin/pmm diff --git a/.github/workflows/agent.yml b/.github/workflows/agent.yml index 8edef91181..46bf271491 100644 --- a/.github/workflows/agent.yml +++ b/.github/workflows/agent.yml @@ -63,7 +63,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml index 3b56e28bbb..e28b694a26 100644 --- a/.github/workflows/clean.yml +++ b/.github/workflows/clean.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: go: - - version: 1.20.x + - version: 1.21.x may-fail: false - version: tip may-fail: true @@ -52,7 +52,7 @@ jobs: echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV echo "$HOME/gotip/bin" >> $GITHUB_PATH - name: Check out code into the Go module directory - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: lfs: true diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 0000000000..3e573ed183 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,24 @@ +name: Dependabot +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + name: Enable auto-merge + runs-on: ubuntu-20.04 + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml new file mode 100644 index 0000000000..71ad2974ba --- /dev/null +++ b/.github/workflows/devcontainer.yml @@ -0,0 +1,62 @@ +name: Devcontainer +on: + workflow_dispatch: + inputs: + branch: + description: "The branch to build the devcontainer from" + default: "main" + required: true + type: string + workflow_call: + inputs: + branch: + description: "The branch to build the devcontainer from" + default: "main" + required: true + type: string + +jobs: + devcontainer: + name: Build + runs-on: ubuntu-22.04 + timeout-minutes: 15 + strategy: + fail-fast: false + permissions: + packages: write + + env: + LAB_DEVCONTAINER_IMAGE: perconalab/pmm-server:dev-container + GH_DEVCONTAINER_IMAGE: ghcr.io/percona/pmm:dev-container + + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to ghcr.io registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to docker.io registry + uses: docker/login-action@v3 + with: + registry: docker.io + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build and push to registries + uses: docker/build-push-action@v5 + with: + file: ./devcontainer.Dockerfile + push: true + tags: | + ${{ env.GH_DEVCONTAINER_IMAGE }} + ${{ env.LAB_DEVCONTAINER_IMAGE }} diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 8fe9398359..851406bcef 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: API uses: readmeio/rdme@v8 diff --git a/.github/workflows/dockerhub-readme.yml b/.github/workflows/dockerhub-readme.yml index bb739540c3..b2f0e71574 100644 --- a/.github/workflows/dockerhub-readme.yml +++ b/.github/workflows/dockerhub-readme.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest environment: Production steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Update Docker Hub Readme for perconalab/pmm-server uses: peter-evans/dockerhub-description@v3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a44a430a6..5ecd013a33 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 diff --git a/.github/workflows/managed.yml b/.github/workflows/managed.yml index 6f2e87e0af..ab1c5b8dcf 100644 --- a/.github/workflows/managed.yml +++ b/.github/workflows/managed.yml @@ -9,14 +9,14 @@ on: pull_request: paths-ignore: - - "admin/**" - - "agent/**" - - "api-tests/**" - - "cli-tests/**" - - "docs/**" - - "qan-api2/**" - - "update/**" - - "vmproxy/**" + - 'admin/**' + - 'agent/**' + - 'api-tests/**' + - 'cli-tests/**' + - 'docs/**' + - 'qan-api2/**' + - 'update/**' + - 'vmproxy/**' jobs: test: @@ -36,7 +36,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Enable Go build cache if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }} @@ -63,7 +63,7 @@ jobs: popd && go mod download -x - name: Initialize CI environment - run: make env-compose-up + run: make env-compose-up # the container workdir is /root/go/src/github.com/percona/pmm - name: Restore Go build cache if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }} @@ -75,14 +75,17 @@ jobs: continue-on-error: true run: docker cp ~/go/pkg/mod pmm-server:/root/go/pkg/mod + - name: Mark the root directory of pmm as safe + run: docker exec -i pmm-server git config --global --add safe.directory /root/go/src/github.com/percona/pmm + - name: Update binaries - run: docker exec -i --workdir=/root/go/src/github.com/percona/pmm pmm-server make run-managed-ci run-agent run-vmproxy + run: docker exec -i pmm-server make run-managed-ci run-agent run-vmproxy - name: Run tests - run: docker exec -i --workdir=/root/go/src/github.com/percona/pmm/managed pmm-server make test-cover + run: docker exec -i pmm-server make -C managed test-cover - name: Run PMM server update test - run: docker exec -i --workdir=/root/go/src/github.com/percona/pmm/managed pmm-server make test-update + run: docker exec -i pmm-server make -C managed test-update - name: Upload coverage results uses: codecov/codecov-action@v3 @@ -96,7 +99,7 @@ jobs: if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }} run: | docker exec pmm-server go clean -testcache - docker exec --workdir=/root/go/src/github.com/percona/pmm/managed pmm-server find . -type d -name fuzzdata -exec rm -r {} + + docker exec pmm-server find ./managed -type d -name fuzzdata -exec rm -r {} + rm -fr ~/.cache/go-build mkdir -p ~/.cache docker cp pmm-server:/root/.cache/go-build ~/.cache/go-build @@ -104,9 +107,6 @@ jobs: - name: Run debug commands on failure if: ${{ failure() }} run: | - env - go version - go env - pwd + env | sort + go env | sort git status - kubectl version diff --git a/.github/workflows/qan-api2.yml b/.github/workflows/qan-api2.yml index c16b984bd2..328edd972b 100644 --- a/.github/workflows/qan-api2.yml +++ b/.github/workflows/qan-api2.yml @@ -32,7 +32,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 diff --git a/.github/workflows/sbom.yml b/.github/workflows/sbom.yml index d04acadc5e..2acc444c22 100644 --- a/.github/workflows/sbom.yml +++ b/.github/workflows/sbom.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create SBOM for PMM uses: anchore/sbom-action@v0 @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create SBOM for vmproxy uses: anchore/sbom-action@v0 diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index a1ea10e660..bbe76d37df 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker Up run: docker compose up -d diff --git a/.github/workflows/vmproxy.yml b/.github/workflows/vmproxy.yml index 5bbbb6196d..ed81580f61 100644 --- a/.github/workflows/vmproxy.yml +++ b/.github/workflows/vmproxy.yml @@ -32,7 +32,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go release uses: actions/setup-go@v4 diff --git a/.golangci.yml b/.golangci.yml index 645ad885e3..9ba704817d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,19 +7,19 @@ linters-settings: max-complexity: 30 depguard: - list-type: blacklist - include-go-root: true - packages: - # use "github.com/pkg/errors" instead - - errors - # use "github.com/golang/protobuf/proto" instead - - github.com/gogo/protobuf/proto - # use only forked parser - - github.com/percona/go-mysql/log/slow - # use "github.com/percona-platform/saas" instead - - github.com/percona-platform/platform - # use "gopkg.in/yaml.v3" instead - - gopkg.in/yaml.v2 + rules: + main: + deny: + - pkg: "errors" + desc: use "github.com/pkg/errors" instead + - pkg: "github.com/gogo/protobuf/proto" + desc: use "github.com/golang/protobuf/proto" instead + - pkg: "github.com/percona/go-mysql/log/slow" + desc: only use the forked parser + - pkg: "github.com/percona-platform/platform" + desc: use "github.com/percona-platform/saas" instead + - pkg: "gopkg.in/yaml.v2" + desc: use "gopkg.in/yaml.v3" instead gci: sections: @@ -29,7 +29,7 @@ linters-settings: godot: capital: true - period: false + period: true scope: toplevel exclude: - go-sumtype:decl @@ -103,8 +103,12 @@ linters: - maligned # deprecated - nlreturn # too annoying - nosnakecase # deprecated + - rowserrcheck # disabled because of generics - scopelint # too many false positives + - structcheck # replaced by unused + - varcheck # replaced by unused - varnamelen # useless + - wastedassign # disabled because of generics - wrapcheck # we do not use wrapping everywhere - wsl # too annoying diff --git a/.licenserc.yaml b/.licenserc.yaml index 60fcfc859e..0db7da52ac 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -2,8 +2,8 @@ header: - paths: - "**/*.go" paths-ignore: - - "**/agent/**" - - "**/admin/**" + - "agent/**" + - "admin/**" - "**/mock_*" - "**/*.pb.go" - "**/*.pb.gw.go" @@ -12,62 +12,23 @@ header: - "**/json/client/**" - "**/amclient/**" - "**/ammodels/**" - - "qan-api2/migrations/" + - "qan-api2/migrations/**" - "managed/services/dbaas/kubernetes/client/kubeclient_interface.go" - "managed/services/dbaas/olm/operator_service_interface.go" - "managed/services/dbaas/kubernetes/operator_service_interface.go" license: - spdx-id: AGPL-3.0 - content: | - // Copyright (C) 2019 Percona LLC - // - // This program is free software: you can redistribute it and/or modify - // it under the terms of the GNU Affero General Public License as published by - // the Free Software Foundation, either version 3 of the License, or - // (at your option) any later version. - // - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - // GNU Affero General Public License for more details. - // - // You should have received a copy of the GNU Affero General Public License - // along with this program. If not, see . + spdx-id: AGPL-3.0-or-later + copyright-owner: Percona LLC + copyright-year: 2023 - paths: - - "./agent/**/*.go" - - "./admin/**/.go" + - "agent/**/*.go" + - "admin/**/*.go" paths-ignore: - "**/*_reform.go" - "**/mock_*" - "**/json/client/**" license: - content: | - // Copyright (C) 2019 Percona LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - pattern: | - // Copyright \(C\) 20\d{2} Percona LLC - // - // Licensed under the Apache License, Version 2.0 \(the "License"\); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. + spdx-id: Apache-2.0 + copyright-owner: Percona LLC + copyright-year: 2023 diff --git a/Dockerfile b/Dockerfile index 6da7583caf..46ab87ad75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # This Dockerfile is used only for API tests. -FROM golang:1.20 +FROM golang:1.21 RUN export GOPATH=$(go env GOPATH) && \ mkdir -p $GOPATH/src/github.com/percona/pmm diff --git a/admin/agentlocal/agentlocal.go b/admin/agentlocal/agentlocal.go index 56e4fb3d5a..26a7aa18cc 100644 --- a/admin/agentlocal/agentlocal.go +++ b/admin/agentlocal/agentlocal.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/cli/cli.go b/admin/cli/cli.go index 36e5d4615f..9db76727dc 100644 --- a/admin/cli/cli.go +++ b/admin/cli/cli.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package cli stores cli configuration and common logic for commands +// Package cli stores cli configuration and common logic for commands. package cli import ( diff --git a/admin/cli/flags/global.go b/admin/cli/flags/global.go index 8714d8023a..8ede216a51 100644 --- a/admin/cli/flags/global.go +++ b/admin/cli/flags/global.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package flags holds global flags +// Package flags holds global flags. package flags import ( diff --git a/admin/cmd/bootstrap.go b/admin/cmd/bootstrap.go index 369a3a3fa4..e302946ecb 100644 --- a/admin/cmd/bootstrap.go +++ b/admin/cmd/bootstrap.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package cmd holds common logic used by commands +// Package cmd holds common logic used by commands. package cmd import ( diff --git a/admin/cmd/pmm-admin/main.go b/admin/cmd/pmm-admin/main.go index d2746fdb9a..c376184e68 100644 --- a/admin/cmd/pmm-admin/main.go +++ b/admin/cmd/pmm-admin/main.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/cmd/pmm-admin/main_test.go b/admin/cmd/pmm-admin/main_test.go index c434b1f60f..d7dc2e40b1 100644 --- a/admin/cmd/pmm-admin/main_test.go +++ b/admin/cmd/pmm-admin/main_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/cmd/pmm/main.go b/admin/cmd/pmm/main.go index 45b6697355..6800636f6d 100644 --- a/admin/cmd/pmm/main.go +++ b/admin/cmd/pmm/main.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/annotation.go b/admin/commands/annotation.go index ca39d4c93f..78239a7549 100644 --- a/admin/commands/annotation.go +++ b/admin/commands/annotation.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/base.go b/admin/commands/base.go index 66074bf9b3..9289789951 100644 --- a/admin/commands/base.go +++ b/admin/commands/base.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/base/setup.go b/admin/commands/base/setup.go index be6b76fd89..a7dc9a472f 100644 --- a/admin/commands/base/setup.go +++ b/admin/commands/base/setup.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package base provides helpers for all commands +// Package base provides helpers for all commands. package base import ( diff --git a/admin/commands/base_test.go b/admin/commands/base_test.go index d7015e3115..0b3f7ac205 100644 --- a/admin/commands/base_test.go +++ b/admin/commands/base_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/completion.go b/admin/commands/completion.go index 0e8df896ae..fbbc66b86c 100644 --- a/admin/commands/completion.go +++ b/admin/commands/completion.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/config.go b/admin/commands/config.go index 44cf7a0220..eda73cf1a2 100644 --- a/admin/commands/config.go +++ b/admin/commands/config.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/config_test.go b/admin/commands/config_test.go index 60da3239b0..792e981221 100644 --- a/admin/commands/config_test.go +++ b/admin/commands/config_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_external_exporter.go b/admin/commands/inventory/add_agent_external_exporter.go index 0f658a9d08..8d83d9240e 100644 --- a/admin/commands/inventory/add_agent_external_exporter.go +++ b/admin/commands/inventory/add_agent_external_exporter.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_mongodb_exporter.go b/admin/commands/inventory/add_agent_mongodb_exporter.go index 3c3d92ea4a..fb258a39c6 100644 --- a/admin/commands/inventory/add_agent_mongodb_exporter.go +++ b/admin/commands/inventory/add_agent_mongodb_exporter.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_mysqld_exporter.go b/admin/commands/inventory/add_agent_mysqld_exporter.go index 3558de47b7..ab828cbfae 100644 --- a/admin/commands/inventory/add_agent_mysqld_exporter.go +++ b/admin/commands/inventory/add_agent_mysqld_exporter.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_mysqld_exporter_test.go b/admin/commands/inventory/add_agent_mysqld_exporter_test.go index 390ed2b9ba..3f74a626ce 100644 --- a/admin/commands/inventory/add_agent_mysqld_exporter_test.go +++ b/admin/commands/inventory/add_agent_mysqld_exporter_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_node_exporter.go b/admin/commands/inventory/add_agent_node_exporter.go index b6b2a44ea2..982befd0e6 100644 --- a/admin/commands/inventory/add_agent_node_exporter.go +++ b/admin/commands/inventory/add_agent_node_exporter.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_pmm_agent.go b/admin/commands/inventory/add_agent_pmm_agent.go index dc7fd315a1..df8057e766 100644 --- a/admin/commands/inventory/add_agent_pmm_agent.go +++ b/admin/commands/inventory/add_agent_pmm_agent.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_postgres_exporter.go b/admin/commands/inventory/add_agent_postgres_exporter.go index 9e607fa5fb..3dbca7ca90 100644 --- a/admin/commands/inventory/add_agent_postgres_exporter.go +++ b/admin/commands/inventory/add_agent_postgres_exporter.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_postgres_exporter_test.go b/admin/commands/inventory/add_agent_postgres_exporter_test.go index 29465034c4..25554a53fb 100644 --- a/admin/commands/inventory/add_agent_postgres_exporter_test.go +++ b/admin/commands/inventory/add_agent_postgres_exporter_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_proxysql_exporter.go b/admin/commands/inventory/add_agent_proxysql_exporter.go index abfe4e55b5..a4c2e7fc4d 100644 --- a/admin/commands/inventory/add_agent_proxysql_exporter.go +++ b/admin/commands/inventory/add_agent_proxysql_exporter.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_qan_mongodb_profiler_agent.go b/admin/commands/inventory/add_agent_qan_mongodb_profiler_agent.go index 5dd330f1ea..22fbd3dabf 100644 --- a/admin/commands/inventory/add_agent_qan_mongodb_profiler_agent.go +++ b/admin/commands/inventory/add_agent_qan_mongodb_profiler_agent.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_qan_mysql_perfschema_agent.go b/admin/commands/inventory/add_agent_qan_mysql_perfschema_agent.go index cf8939fc6f..82492ad33c 100644 --- a/admin/commands/inventory/add_agent_qan_mysql_perfschema_agent.go +++ b/admin/commands/inventory/add_agent_qan_mysql_perfschema_agent.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_qan_mysql_slowlog_agent.go b/admin/commands/inventory/add_agent_qan_mysql_slowlog_agent.go index c74af0a3c7..1ca83e9bbc 100644 --- a/admin/commands/inventory/add_agent_qan_mysql_slowlog_agent.go +++ b/admin/commands/inventory/add_agent_qan_mysql_slowlog_agent.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_qan_postgres_pgstatements_agent.go b/admin/commands/inventory/add_agent_qan_postgres_pgstatements_agent.go index 8c04c0f234..8800accb96 100644 --- a/admin/commands/inventory/add_agent_qan_postgres_pgstatements_agent.go +++ b/admin/commands/inventory/add_agent_qan_postgres_pgstatements_agent.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_qan_postgres_pgstatmonitor_agent.go b/admin/commands/inventory/add_agent_qan_postgres_pgstatmonitor_agent.go index f18b16506a..53df775c57 100644 --- a/admin/commands/inventory/add_agent_qan_postgres_pgstatmonitor_agent.go +++ b/admin/commands/inventory/add_agent_qan_postgres_pgstatmonitor_agent.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_agent_rds_exporter.go b/admin/commands/inventory/add_agent_rds_exporter.go index 772e415228..5d694ec7f2 100644 --- a/admin/commands/inventory/add_agent_rds_exporter.go +++ b/admin/commands/inventory/add_agent_rds_exporter.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_node_container.go b/admin/commands/inventory/add_node_container.go index 311d45ea09..18fabfe19a 100644 --- a/admin/commands/inventory/add_node_container.go +++ b/admin/commands/inventory/add_node_container.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_node_generic.go b/admin/commands/inventory/add_node_generic.go index ddd71631b3..6bd51dc15a 100644 --- a/admin/commands/inventory/add_node_generic.go +++ b/admin/commands/inventory/add_node_generic.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_node_remote.go b/admin/commands/inventory/add_node_remote.go index 0727c2712e..38fef75509 100644 --- a/admin/commands/inventory/add_node_remote.go +++ b/admin/commands/inventory/add_node_remote.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_node_remote_rds.go b/admin/commands/inventory/add_node_remote_rds.go index 7bfdba300b..fb045bfbce 100644 --- a/admin/commands/inventory/add_node_remote_rds.go +++ b/admin/commands/inventory/add_node_remote_rds.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_node_remote_rds_test.go b/admin/commands/inventory/add_node_remote_rds_test.go index f3ee4163d2..85420b49ca 100644 --- a/admin/commands/inventory/add_node_remote_rds_test.go +++ b/admin/commands/inventory/add_node_remote_rds_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_external.go b/admin/commands/inventory/add_service_external.go index 995a7bd779..4b957148f6 100644 --- a/admin/commands/inventory/add_service_external.go +++ b/admin/commands/inventory/add_service_external.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_external_test.go b/admin/commands/inventory/add_service_external_test.go index 8676261dea..659ca3aa4c 100644 --- a/admin/commands/inventory/add_service_external_test.go +++ b/admin/commands/inventory/add_service_external_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_haproxy.go b/admin/commands/inventory/add_service_haproxy.go index 4aebbf1167..a7fd48b922 100644 --- a/admin/commands/inventory/add_service_haproxy.go +++ b/admin/commands/inventory/add_service_haproxy.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_haproxy_test.go b/admin/commands/inventory/add_service_haproxy_test.go index bcec05d9f2..599aa69829 100644 --- a/admin/commands/inventory/add_service_haproxy_test.go +++ b/admin/commands/inventory/add_service_haproxy_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_mongodb.go b/admin/commands/inventory/add_service_mongodb.go index a821db8f63..3314324991 100644 --- a/admin/commands/inventory/add_service_mongodb.go +++ b/admin/commands/inventory/add_service_mongodb.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_mongodb_test.go b/admin/commands/inventory/add_service_mongodb_test.go index dbe294ddf6..40b4ac16a1 100644 --- a/admin/commands/inventory/add_service_mongodb_test.go +++ b/admin/commands/inventory/add_service_mongodb_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_mysql.go b/admin/commands/inventory/add_service_mysql.go index 7b13ba8514..ad05f1f057 100644 --- a/admin/commands/inventory/add_service_mysql.go +++ b/admin/commands/inventory/add_service_mysql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_mysql_test.go b/admin/commands/inventory/add_service_mysql_test.go index 0d9f02642a..2867984f19 100644 --- a/admin/commands/inventory/add_service_mysql_test.go +++ b/admin/commands/inventory/add_service_mysql_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_postgres_test.go b/admin/commands/inventory/add_service_postgres_test.go index 6e1927a98c..027d47aba6 100644 --- a/admin/commands/inventory/add_service_postgres_test.go +++ b/admin/commands/inventory/add_service_postgres_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_postgresql.go b/admin/commands/inventory/add_service_postgresql.go index ac94fc97a6..992c3883af 100644 --- a/admin/commands/inventory/add_service_postgresql.go +++ b/admin/commands/inventory/add_service_postgresql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_proxysql.go b/admin/commands/inventory/add_service_proxysql.go index e1db402313..60f50ea6cc 100644 --- a/admin/commands/inventory/add_service_proxysql.go +++ b/admin/commands/inventory/add_service_proxysql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/add_service_proxysql_test.go b/admin/commands/inventory/add_service_proxysql_test.go index 2749b147df..6b2e2ac2e0 100644 --- a/admin/commands/inventory/add_service_proxysql_test.go +++ b/admin/commands/inventory/add_service_proxysql_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/inventory.go b/admin/commands/inventory/inventory.go index b834ab9ae2..8de367d9f1 100644 --- a/admin/commands/inventory/inventory.go +++ b/admin/commands/inventory/inventory.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,9 +23,9 @@ import ( // InventoryCommand is used by Kong for CLI flags and commands. type InventoryCommand struct { - List ListCommand `cmd:"" hidden:"" help:"List inventory commands"` - Add AddCommand `cmd:"" hidden:"" help:"Add to inventory commands"` - Remove RemoveCommand `cmd:"" hidden:"" help:"Remove from inventory commands"` + List ListCommand `cmd:"" help:"List inventory commands"` + Add AddCommand `cmd:"" help:"Add to inventory commands"` + Remove RemoveCommand `cmd:"" help:"Remove from inventory commands"` } // ListCommand is used by Kong for CLI flags and commands. @@ -105,3 +105,6 @@ func formatTypeValue(acceptableTypeValues map[string][]string, input string) (*s } return nil, errors.Errorf("unexpected type value %q", input) } + +// RunCmd is a stub that allows to display the InventoryCommand's help. +func (cmd *InventoryCommand) RunCmd() {} diff --git a/admin/commands/inventory/list_agents.go b/admin/commands/inventory/list_agents.go index 3234b65b5a..22ffc6da64 100644 --- a/admin/commands/inventory/list_agents.go +++ b/admin/commands/inventory/list_agents.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/list_nodes.go b/admin/commands/inventory/list_nodes.go index 4f01842e02..e9febcd072 100644 --- a/admin/commands/inventory/list_nodes.go +++ b/admin/commands/inventory/list_nodes.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/list_services.go b/admin/commands/inventory/list_services.go index 15d5fb3269..d3808fb8b8 100644 --- a/admin/commands/inventory/list_services.go +++ b/admin/commands/inventory/list_services.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/remove_agent.go b/admin/commands/inventory/remove_agent.go index 36e3e6a901..ff04ba8c02 100644 --- a/admin/commands/inventory/remove_agent.go +++ b/admin/commands/inventory/remove_agent.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/remove_node.go b/admin/commands/inventory/remove_node.go index 9b1fa9f87a..6184a5974b 100644 --- a/admin/commands/inventory/remove_node.go +++ b/admin/commands/inventory/remove_node.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/inventory/remove_service.go b/admin/commands/inventory/remove_service.go index eb15114de3..551a28ca79 100644 --- a/admin/commands/inventory/remove_service.go +++ b/admin/commands/inventory/remove_service.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/list.go b/admin/commands/list.go index d508e9de02..128cd1841f 100644 --- a/admin/commands/list.go +++ b/admin/commands/list.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/list_test.go b/admin/commands/list_test.go index df3e279801..2eb4406b4c 100644 --- a/admin/commands/list_test.go +++ b/admin/commands/list_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add.go b/admin/commands/management/add.go index 59c623fe3f..e69826e8cb 100644 --- a/admin/commands/management/add.go +++ b/admin/commands/management/add.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_external.go b/admin/commands/management/add_external.go index a65f9f5582..0b9ee64ff4 100644 --- a/admin/commands/management/add_external.go +++ b/admin/commands/management/add_external.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_external_serverless.go b/admin/commands/management/add_external_serverless.go index f9893caa40..f7a7d08c0e 100644 --- a/admin/commands/management/add_external_serverless.go +++ b/admin/commands/management/add_external_serverless.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_external_test.go b/admin/commands/management/add_external_test.go index e06cf6e56d..635f74c813 100644 --- a/admin/commands/management/add_external_test.go +++ b/admin/commands/management/add_external_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_haproxy.go b/admin/commands/management/add_haproxy.go index 36ff6ba026..b6e7c556a6 100644 --- a/admin/commands/management/add_haproxy.go +++ b/admin/commands/management/add_haproxy.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_haproxy_test.go b/admin/commands/management/add_haproxy_test.go index 7e7c5e9299..3f352cd11a 100644 --- a/admin/commands/management/add_haproxy_test.go +++ b/admin/commands/management/add_haproxy_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_mongodb.go b/admin/commands/management/add_mongodb.go index bb455df47d..96af140476 100644 --- a/admin/commands/management/add_mongodb.go +++ b/admin/commands/management/add_mongodb.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_mongodb_test.go b/admin/commands/management/add_mongodb_test.go index c0b9c5424c..53b3622e13 100644 --- a/admin/commands/management/add_mongodb_test.go +++ b/admin/commands/management/add_mongodb_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_mysql.go b/admin/commands/management/add_mysql.go index 13e5cd24ba..08d5fc537d 100644 --- a/admin/commands/management/add_mysql.go +++ b/admin/commands/management/add_mysql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_mysql_test.go b/admin/commands/management/add_mysql_test.go index ce6e74c4d2..400fbced84 100644 --- a/admin/commands/management/add_mysql_test.go +++ b/admin/commands/management/add_mysql_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_postgresql.go b/admin/commands/management/add_postgresql.go index af61b7a9a4..ca5244183e 100644 --- a/admin/commands/management/add_postgresql.go +++ b/admin/commands/management/add_postgresql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_proxysql.go b/admin/commands/management/add_proxysql.go index dd4bd8d957..f02a11a5b3 100644 --- a/admin/commands/management/add_proxysql.go +++ b/admin/commands/management/add_proxysql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/add_test.go b/admin/commands/management/add_test.go index 58f1e3d62a..72fe768f50 100644 --- a/admin/commands/management/add_test.go +++ b/admin/commands/management/add_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/management.go b/admin/commands/management/management.go index 5de74c8f43..13398ca7db 100644 --- a/admin/commands/management/management.go +++ b/admin/commands/management/management.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/register.go b/admin/commands/management/register.go index 95b3bfe98a..93e16cd2d8 100644 --- a/admin/commands/management/register.go +++ b/admin/commands/management/register.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/remove.go b/admin/commands/management/remove.go index 77575aa849..94b1107e82 100644 --- a/admin/commands/management/remove.go +++ b/admin/commands/management/remove.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/management/unregister.go b/admin/commands/management/unregister.go index 2b1a751ec8..7632b34433 100644 --- a/admin/commands/management/unregister.go +++ b/admin/commands/management/unregister.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/pmm/client/base.go b/admin/commands/pmm/client/base.go index 05e4f3f511..b0546f0646 100644 --- a/admin/commands/pmm/client/base.go +++ b/admin/commands/pmm/client/base.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package client holds the "pmm client" command +// Package client holds the "pmm client" command. package client import "github.com/percona/pmm/admin/commands" diff --git a/admin/commands/pmm/client/install.go b/admin/commands/pmm/client/install.go index 391d810a43..baaa9c6689 100644 --- a/admin/commands/pmm/client/install.go +++ b/admin/commands/pmm/client/install.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/pmm/client/upgrade.go b/admin/commands/pmm/client/upgrade.go index 9b7fef7480..b61c39c5bc 100644 --- a/admin/commands/pmm/client/upgrade.go +++ b/admin/commands/pmm/client/upgrade.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/pmm/common/shutdown_result.go b/admin/commands/pmm/common/shutdown_result.go index f31a7c6a9a..1a53faa94d 100644 --- a/admin/commands/pmm/common/shutdown_result.go +++ b/admin/commands/pmm/common/shutdown_result.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/pmm/server/base.go b/admin/commands/pmm/server/base.go index 600f4e8233..b600baa843 100644 --- a/admin/commands/pmm/server/base.go +++ b/admin/commands/pmm/server/base.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package server holds the "pmm server" command +// Package server holds the "pmm server" command. package server import ( diff --git a/admin/commands/pmm/server/docker/base.go b/admin/commands/pmm/server/docker/base.go index 643fae3d71..32a16a82b5 100644 --- a/admin/commands/pmm/server/docker/base.go +++ b/admin/commands/pmm/server/docker/base.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package docker holds the "pmm server install docker" command +// Package docker holds the "pmm server install docker" command. package docker import ( diff --git a/admin/commands/pmm/server/docker/base_test.go b/admin/commands/pmm/server/docker/base_test.go index a3c778e47f..cc1b042cb4 100644 --- a/admin/commands/pmm/server/docker/base_test.go +++ b/admin/commands/pmm/server/docker/base_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package docker holds the "pmm server install docker" command +// Package docker holds the "pmm server install docker" command. package docker import ( diff --git a/admin/commands/pmm/server/docker/common.go b/admin/commands/pmm/server/docker/common.go index d720203875..d7431fac67 100644 --- a/admin/commands/pmm/server/docker/common.go +++ b/admin/commands/pmm/server/docker/common.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/pmm/server/docker/deps.go b/admin/commands/pmm/server/docker/deps.go index 45664aa57b..f87ce886c6 100644 --- a/admin/commands/pmm/server/docker/deps.go +++ b/admin/commands/pmm/server/docker/deps.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/pmm/server/docker/install.go b/admin/commands/pmm/server/docker/install.go index 00c4a9f0e9..eec6e3df77 100644 --- a/admin/commands/pmm/server/docker/install.go +++ b/admin/commands/pmm/server/docker/install.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/pmm/server/docker/install_test.go b/admin/commands/pmm/server/docker/install_test.go index 472e06f0a4..0a5721b7b5 100644 --- a/admin/commands/pmm/server/docker/install_test.go +++ b/admin/commands/pmm/server/docker/install_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/pmm/server/docker/mock_functions_test.go b/admin/commands/pmm/server/docker/mock_functions_test.go index 8841c6a2d8..938da7c866 100644 --- a/admin/commands/pmm/server/docker/mock_functions_test.go +++ b/admin/commands/pmm/server/docker/mock_functions_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package docker diff --git a/admin/commands/pmm/server/docker/upgrade.go b/admin/commands/pmm/server/docker/upgrade.go index 31e7ebeff9..c8ce3a419b 100644 --- a/admin/commands/pmm/server/docker/upgrade.go +++ b/admin/commands/pmm/server/docker/upgrade.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/pmm/server/docker/upgrade_test.go b/admin/commands/pmm/server/docker/upgrade_test.go index e9d9e04099..ea3186bd74 100644 --- a/admin/commands/pmm/server/docker/upgrade_test.go +++ b/admin/commands/pmm/server/docker/upgrade_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/status.go b/admin/commands/status.go index 9bce4969f3..b46281f068 100644 --- a/admin/commands/status.go +++ b/admin/commands/status.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/status_test.go b/admin/commands/status_test.go index c2426d9319..d83d9def8e 100644 --- a/admin/commands/status_test.go +++ b/admin/commands/status_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/summary.go b/admin/commands/summary.go index 694c1ac287..270d7b7892 100644 --- a/admin/commands/summary.go +++ b/admin/commands/summary.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -254,7 +254,7 @@ func getURL(ctx context.Context, url string) ([]byte, error) { return b, nil } -// downloadFile download file and includes into zip file +// downloadFile download file and includes into zip file. func downloadFile(ctx context.Context, zipW *zip.Writer, url, fileName string) error { b, err := getURL(ctx, url) if err != nil { diff --git a/admin/commands/summary_test.go b/admin/commands/summary_test.go index 5d84d4ea6c..3ce52965b7 100644 --- a/admin/commands/summary_test.go +++ b/admin/commands/summary_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/commands/version.go b/admin/commands/version.go index 1c6194cebb..4e229c62a2 100644 --- a/admin/commands/version.go +++ b/admin/commands/version.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/helpers/helpers.go b/admin/helpers/helpers.go index 26abe42e5d..4f90c21ff7 100644 --- a/admin/helpers/helpers.go +++ b/admin/helpers/helpers.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/logger/text_formatter.go b/admin/logger/text_formatter.go index 9c992bbe2e..41a722dd19 100644 --- a/admin/logger/text_formatter.go +++ b/admin/logger/text_formatter.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/pkg/bubbles/progress/size.go b/admin/pkg/bubbles/progress/size.go index ed95e48265..8384268baa 100644 --- a/admin/pkg/bubbles/progress/size.go +++ b/admin/pkg/bubbles/progress/size.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package progress contains progress bar programs to be rendered with BubbleTea +// Package progress contains progress bar programs to be rendered with BubbleTea. package progress import ( diff --git a/admin/pkg/bubbles/styles/styles.go b/admin/pkg/bubbles/styles/styles.go index 8f5c987f4e..b041119eac 100644 --- a/admin/pkg/bubbles/styles/styles.go +++ b/admin/pkg/bubbles/styles/styles.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package styles holds common styles for BubbleTea programs +// Package styles holds common styles for BubbleTea programs. package styles import "github.com/charmbracelet/lipgloss" diff --git a/admin/pkg/client/client.go b/admin/pkg/client/client.go index eaa0132d13..fda402a668 100644 --- a/admin/pkg/client/client.go +++ b/admin/pkg/client/client.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package client provides common methods for working with pmm-client +// Package client provides common methods for working with pmm-client. package client import ( diff --git a/admin/pkg/client/tarball/tarball.go b/admin/pkg/client/tarball/tarball.go index a6dd297a4c..f9651f8bc3 100644 --- a/admin/pkg/client/tarball/tarball.go +++ b/admin/pkg/client/tarball/tarball.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package tarball holds logic for pmm-client tarball specific operations +// Package tarball holds logic for pmm-client tarball specific operations. package tarball import ( diff --git a/admin/pkg/common/common.go b/admin/pkg/common/common.go index de6c1340fa..6e6f3fde15 100644 --- a/admin/pkg/common/common.go +++ b/admin/pkg/common/common.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package common holds common methods used in admin +// Package common holds common methods used in admin. package common import ( diff --git a/admin/pkg/common/distribution.go b/admin/pkg/common/distribution.go index 121cb2da74..0606480fe4 100644 --- a/admin/pkg/common/distribution.go +++ b/admin/pkg/common/distribution.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/admin/pkg/docker/docker.go b/admin/pkg/docker/docker.go index 75921ef2a9..9fe875ab51 100644 --- a/admin/pkg/docker/docker.go +++ b/admin/pkg/docker/docker.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package docker stores common functions for working with Docker +// Package docker stores common functions for working with Docker. package docker import ( diff --git a/admin/pkg/docker/pull_image.go b/admin/pkg/docker/pull_image.go index 8265d990c6..e28824084b 100644 --- a/admin/pkg/docker/pull_image.go +++ b/admin/pkg/docker/pull_image.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/README.md b/agent/README.md index e61e57af19..270784c308 100644 --- a/agent/README.md +++ b/agent/README.md @@ -4,7 +4,7 @@ pmm-agent for PMM 2.x. # Contributing notes -## Pre-requirements: +## Pre-requisites: git, make, curl, go, gcc, docker, docker-compose, pmm-server ## Local setup diff --git a/agent/agentlocal/agent_local.go b/agent/agentlocal/agent_local.go index d5a3c6e9c3..d23f2a8224 100644 --- a/agent/agentlocal/agent_local.go +++ b/agent/agentlocal/agent_local.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -100,7 +100,7 @@ func NewServer(cfg configGetReloader, supervisor supervisor, client client, conf // Run runs gRPC and JSON servers with API and debug endpoints until ctx is canceled. // // Run exits when ctx is canceled, or when a request to reload configuration is received. -func (s *Server) Run(ctx context.Context) { +func (s *Server) Run(ctx context.Context, reloadCh chan bool) { defer s.l.Info("Done.") serverCtx, serverCancel := context.WithCancel(ctx) @@ -125,8 +125,10 @@ func (s *Server) Run(ctx context.Context) { }() select { - case <-ctx.Done(): case <-s.reload: + s.l.Debug("Agent reload triggered") + reloadCh <- true + case <-ctx.Done(): } serverCancel() @@ -349,7 +351,7 @@ var ( _ agentlocalpb.AgentLocalServer = (*Server)(nil) ) -// addData add data to zip file +// addData add data to zip file. func addData(zipW *zip.Writer, name string, data []byte) error { f, err := zipW.Create(name) if err != nil { diff --git a/agent/agentlocal/agent_local_test.go b/agent/agentlocal/agent_local_test.go index eb151042e4..858e834072 100644 --- a/agent/agentlocal/agent_local_test.go +++ b/agent/agentlocal/agent_local_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agentlocal/deps.go b/agent/agentlocal/deps.go index b948131412..a727541b82 100644 --- a/agent/agentlocal/deps.go +++ b/agent/agentlocal/deps.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agentlocal/mock_client_test.go b/agent/agentlocal/mock_client_test.go index bbb4506d1c..0d60f8fc6b 100644 --- a/agent/agentlocal/mock_client_test.go +++ b/agent/agentlocal/mock_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package agentlocal diff --git a/agent/agentlocal/mock_supervisor_test.go b/agent/agentlocal/mock_supervisor_test.go index 442d1b4994..2ca3ccfa50 100644 --- a/agent/agentlocal/mock_supervisor_test.go +++ b/agent/agentlocal/mock_supervisor_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package agentlocal diff --git a/agent/agents/agents.go b/agent/agents/agents.go index 5a0648107f..b0ddb0aba4 100644 --- a/agent/agents/agents.go +++ b/agent/agents/agents.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/agents_test.go b/agent/agents/agents_test.go index 9801ca46ff..49a11ecaf3 100644 --- a/agent/agents/agents_test.go +++ b/agent/agents/agents_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/cache/cache.go b/agent/agents/cache/cache.go index 41c506981f..fd3708049a 100644 --- a/agent/agents/cache/cache.go +++ b/agent/agents/cache/cache.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ type Cache struct { trimmedN uint } -// cacheItem is an element stored in Cache +// cacheItem is an element stored in Cache. type cacheItem struct { key interface{} value interface{} diff --git a/agent/agents/cache/cache_test.go b/agent/agents/cache/cache_test.go index fd82ab594a..6299f736bb 100644 --- a/agent/agents/cache/cache_test.go +++ b/agent/agents/cache/cache_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/cache/metrics.go b/agent/agents/cache/metrics.go index 5d08951a81..c720e5efef 100644 --- a/agent/agents/cache/metrics.go +++ b/agent/agents/cache/metrics.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/aggregator/aggregator.go b/agent/agents/mongodb/internal/profiler/aggregator/aggregator.go index 9a2bd129e1..9bb033f840 100644 --- a/agent/agents/mongodb/internal/profiler/aggregator/aggregator.go +++ b/agent/agents/mongodb/internal/profiler/aggregator/aggregator.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/aggregator/aggregator_test.go b/agent/agents/mongodb/internal/profiler/aggregator/aggregator_test.go index d902885724..6bd641f012 100644 --- a/agent/agents/mongodb/internal/profiler/aggregator/aggregator_test.go +++ b/agent/agents/mongodb/internal/profiler/aggregator/aggregator_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/collector/collector.go b/agent/agents/mongodb/internal/profiler/collector/collector.go index 0668832223..1ac997d3e9 100644 --- a/agent/agents/mongodb/internal/profiler/collector/collector.go +++ b/agent/agents/mongodb/internal/profiler/collector/collector.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/collector/collector_test.go b/agent/agents/mongodb/internal/profiler/collector/collector_test.go index e3dcaad8f2..ba3b22eeed 100644 --- a/agent/agents/mongodb/internal/profiler/collector/collector_test.go +++ b/agent/agents/mongodb/internal/profiler/collector/collector_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/monitor.go b/agent/agents/mongodb/internal/profiler/monitor.go index 1390e6ce60..0dfe03b99b 100644 --- a/agent/agents/mongodb/internal/profiler/monitor.go +++ b/agent/agents/mongodb/internal/profiler/monitor.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/monitors.go b/agent/agents/mongodb/internal/profiler/monitors.go index 400c37e2a0..1ad90db4bd 100644 --- a/agent/agents/mongodb/internal/profiler/monitors.go +++ b/agent/agents/mongodb/internal/profiler/monitors.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/parser/parser.go b/agent/agents/mongodb/internal/profiler/parser/parser.go index 12b475f9c8..e926a66c0d 100644 --- a/agent/agents/mongodb/internal/profiler/parser/parser.go +++ b/agent/agents/mongodb/internal/profiler/parser/parser.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/parser/parser_test.go b/agent/agents/mongodb/internal/profiler/parser/parser_test.go index f46bf36607..834fe7cc19 100644 --- a/agent/agents/mongodb/internal/profiler/parser/parser_test.go +++ b/agent/agents/mongodb/internal/profiler/parser/parser_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/profiler.go b/agent/agents/mongodb/internal/profiler/profiler.go index 64c98d2e2d..66a6c6a967 100644 --- a/agent/agents/mongodb/internal/profiler/profiler.go +++ b/agent/agents/mongodb/internal/profiler/profiler.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/profiler_test.go b/agent/agents/mongodb/internal/profiler/profiler_test.go index a050820ecf..304d069ada 100644 --- a/agent/agents/mongodb/internal/profiler/profiler_test.go +++ b/agent/agents/mongodb/internal/profiler/profiler_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/sender/sender.go b/agent/agents/mongodb/internal/profiler/sender/sender.go index 7e36ba7904..abfe1f8d62 100644 --- a/agent/agents/mongodb/internal/profiler/sender/sender.go +++ b/agent/agents/mongodb/internal/profiler/sender/sender.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/profiler/sender/senter_test.go b/agent/agents/mongodb/internal/profiler/sender/senter_test.go index 162625a79b..0b87235f7d 100644 --- a/agent/agents/mongodb/internal/profiler/sender/senter_test.go +++ b/agent/agents/mongodb/internal/profiler/sender/senter_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/report/report.go b/agent/agents/mongodb/internal/report/report.go index 85d35f7ee8..ef0c2c2337 100644 --- a/agent/agents/mongodb/internal/report/report.go +++ b/agent/agents/mongodb/internal/report/report.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/internal/report/report_test.go b/agent/agents/mongodb/internal/report/report_test.go index 3bef3e859c..534f845521 100644 --- a/agent/agents/mongodb/internal/report/report_test.go +++ b/agent/agents/mongodb/internal/report/report_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mongodb/mongodb.go b/agent/agents/mongodb/mongodb.go index 0c98a8e75e..f3a0dc8d40 100644 --- a/agent/agents/mongodb/mongodb.go +++ b/agent/agents/mongodb/mongodb.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -119,7 +119,7 @@ func (m *MongoDB) Collect(ch chan<- prometheus.Metric) { // This method is needed to satisfy interface. } -// check interfaces +// check interfaces. var ( _ prometheus.Collector = (*MongoDB)(nil) ) diff --git a/agent/agents/mongodb/mongodb_test.go b/agent/agents/mongodb/mongodb_test.go index cc8a10e668..8cb15a336e 100644 --- a/agent/agents/mongodb/mongodb_test.go +++ b/agent/agents/mongodb/mongodb_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mysql/perfschema/history.go b/agent/agents/mysql/perfschema/history.go index 3581726fbc..1e3faf25fa 100644 --- a/agent/agents/mysql/perfschema/history.go +++ b/agent/agents/mysql/perfschema/history.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import ( "github.com/percona/pmm/agent/agents/cache" ) -// historyCache is a wrapper for cache.Cache to use only with historyMap type +// historyCache is a wrapper for cache.Cache to use only with historyMap type. type historyCache struct { cache *cache.Cache } @@ -53,16 +53,6 @@ func getHistory(q *reform.Querier) (historyMap, error) { return getHistoryRows(rows, q) } -func getHistory80(q *reform.Querier) (historyMap, error) { - rows, err := q.SelectRows(eventsStatementsSummaryByDigestExamplesView, "WHERE DIGEST IS NOT NULL AND QUERY_SAMPLE_TEXT IS NOT NULL") - if err != nil { - return nil, errors.Wrap(err, "failed to query events_statements_summary_by_digest") - } - defer rows.Close() //nolint:errcheck - - return getHistoryRows(rows, q) -} - func getHistoryRows(rows *sql.Rows, q *reform.Querier) (historyMap, error) { var err error res := make(historyMap) diff --git a/agent/agents/mysql/perfschema/models.go b/agent/agents/mysql/perfschema/models.go index 6bfe62b19c..721f76ff38 100644 --- a/agent/agents/mysql/perfschema/models.go +++ b/agent/agents/mysql/perfschema/models.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mysql/perfschema/perfschema.go b/agent/agents/mysql/perfschema/perfschema.go index ad300484c5..04312fcf8a 100644 --- a/agent/agents/mysql/perfschema/perfschema.go +++ b/agent/agents/mysql/perfschema/perfschema.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package perfschema import ( "context" "database/sql" + "fmt" "io" "math" "sync" @@ -46,7 +47,7 @@ type ( summaryMap map[string]*eventsStatementsSummaryByDigest ) -// mySQLVersion contains +// mySQLVersion contains. type mySQLVersion struct { version float64 vendor string @@ -106,7 +107,7 @@ type Params struct { TLSSkipVerify bool } -// newPerfSchemaParams holds all required parameters to instantiate a new PerfSchema +// newPerfSchemaParams holds all required parameters to instantiate a new PerfSchema. type newPerfSchemaParams struct { Querier *reform.Querier DBCloser io.Closer @@ -119,6 +120,39 @@ type newPerfSchemaParams struct { const queryTag = "agent='perfschema'" +// getPerfschemaSummarySize returns size of rows for perfschema summary cache. +func getPerfschemaSummarySize(q reform.Querier, l *logrus.Entry) uint { + var name string + var size uint + + query := fmt.Sprintf("SHOW VARIABLES /* %s */ LIKE 'performance_schema_digests_size'", queryTag) + err := q.QueryRow(query).Scan(&name, &size) + if err != nil { + l.Debug(err) + size = summariesCacheSize + } + + l.Infof("performance_schema_digests_size=%d", size) + + return size +} + +// getPerfschemaHistorySize returns size of rows for perfschema history cache. +func getPerfschemaHistorySize(q reform.Querier, l *logrus.Entry) uint { + var name string + var size uint + query := fmt.Sprintf("SHOW VARIABLES /* %s */ LIKE 'performance_schema_events_statements_history_long_size'", queryTag) + err := q.QueryRow(query).Scan(&name, &size) + if err != nil { + l.Debug(err) + size = historyCacheSize + } + + l.Infof("performance_schema_events_statements_history_long_size=%d", size) + + return size +} + // New creates new PerfSchema QAN service. func New(params *Params, l *logrus.Entry) (*PerfSchema, error) { if params.TextFiles != nil { @@ -152,12 +186,12 @@ func New(params *Params, l *logrus.Entry) (*PerfSchema, error) { } func newPerfSchema(params *newPerfSchemaParams) (*PerfSchema, error) { - historyCache, err := newHistoryCache(historyMap{}, retainHistory, historyCacheSize, params.LogEntry) + historyCache, err := newHistoryCache(historyMap{}, retainHistory, getPerfschemaHistorySize(*params.Querier, params.LogEntry), params.LogEntry) if err != nil { return nil, errors.Wrap(err, "cannot create cache") } - summaryCache, err := newSummaryCache(summaryMap{}, retainSummaries, summariesCacheSize, params.LogEntry) + summaryCache, err := newSummaryCache(summaryMap{}, retainSummaries, getPerfschemaSummarySize(*params.Querier, params.LogEntry), params.LogEntry) if err != nil { return nil, errors.Wrap(err, "cannot create cache") } @@ -279,16 +313,7 @@ func (m *PerfSchema) runHistoryCacheRefresher(ctx context.Context) { } func (m *PerfSchema) refreshHistoryCache() error { - mysqlVer := m.mySQLVersion() - - var err error - var current historyMap - switch { - case mysqlVer.version >= 8 && mysqlVer.vendor == "oracle": - current, err = getHistory80(m.q) - default: - current, err = getHistory(m.q) - } + current, err := getHistory(m.q) if err != nil { return err } @@ -495,7 +520,7 @@ func (m *PerfSchema) Collect(ch chan<- prometheus.Metric) { } } -// check interfaces +// check interfaces. var ( _ prometheus.Collector = (*PerfSchema)(nil) ) diff --git a/agent/agents/mysql/perfschema/perfschema_test.go b/agent/agents/mysql/perfschema/perfschema_test.go index 9db43c60ab..3351673af8 100644 --- a/agent/agents/mysql/perfschema/perfschema_test.go +++ b/agent/agents/mysql/perfschema/perfschema_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mysql/perfschema/summaries.go b/agent/agents/mysql/perfschema/summaries.go index b0f8a06e48..448b2808a8 100644 --- a/agent/agents/mysql/perfschema/summaries.go +++ b/agent/agents/mysql/perfschema/summaries.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import ( "github.com/percona/pmm/agent/agents/cache" ) -// summaryCache is a wrapper for cache.Cache to use only with summaryMap type +// summaryCache is a wrapper for cache.Cache to use only with summaryMap type. type summaryCache struct { cache *cache.Cache } diff --git a/agent/agents/mysql/slowlog/parser/continuous_file_reader.go b/agent/agents/mysql/slowlog/parser/continuous_file_reader.go index f49b1be406..04be72e572 100644 --- a/agent/agents/mysql/slowlog/parser/continuous_file_reader.go +++ b/agent/agents/mysql/slowlog/parser/continuous_file_reader.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -182,7 +182,7 @@ func (r *ContinuousFileReader) Metrics() *ReaderMetrics { return &m } -// check interfaces +// check interfaces. var ( _ Reader = (*ContinuousFileReader)(nil) ) diff --git a/agent/agents/mysql/slowlog/parser/continuous_file_reader_test.go b/agent/agents/mysql/slowlog/parser/continuous_file_reader_test.go index d2190bc7e9..f07dfb10d7 100644 --- a/agent/agents/mysql/slowlog/parser/continuous_file_reader_test.go +++ b/agent/agents/mysql/slowlog/parser/continuous_file_reader_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mysql/slowlog/parser/logger.go b/agent/agents/mysql/slowlog/parser/logger.go index 689ad527ed..2dd916f83c 100644 --- a/agent/agents/mysql/slowlog/parser/logger.go +++ b/agent/agents/mysql/slowlog/parser/logger.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mysql/slowlog/parser/logger_test.go b/agent/agents/mysql/slowlog/parser/logger_test.go index 98df8c5dd2..40e9b79f08 100644 --- a/agent/agents/mysql/slowlog/parser/logger_test.go +++ b/agent/agents/mysql/slowlog/parser/logger_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,5 +40,5 @@ func (tl *testLogger) Tracef(format string, v ...interface{}) { tl.t.Logf("TRACE: "+format, v...) } -// check interface +// check interface. var _ Logger = (*testLogger)(nil) diff --git a/agent/agents/mysql/slowlog/parser/parser.go b/agent/agents/mysql/slowlog/parser/parser.go index e7cae9ca1e..514dd8e937 100644 --- a/agent/agents/mysql/slowlog/parser/parser.go +++ b/agent/agents/mysql/slowlog/parser/parser.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mysql/slowlog/parser/parser_bench_test.go b/agent/agents/mysql/slowlog/parser/parser_bench_test.go index 624123dd98..26f466ddc0 100644 --- a/agent/agents/mysql/slowlog/parser/parser_bench_test.go +++ b/agent/agents/mysql/slowlog/parser/parser_bench_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mysql/slowlog/parser/parser_fuzz.go b/agent/agents/mysql/slowlog/parser/parser_fuzz.go index c19c366420..63e8d46fd9 100644 --- a/agent/agents/mysql/slowlog/parser/parser_fuzz.go +++ b/agent/agents/mysql/slowlog/parser/parser_fuzz.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mysql/slowlog/parser/parser_test.go b/agent/agents/mysql/slowlog/parser/parser_test.go index 2e30d4db9f..8031a327ef 100644 --- a/agent/agents/mysql/slowlog/parser/parser_test.go +++ b/agent/agents/mysql/slowlog/parser/parser_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mysql/slowlog/parser/reader.go b/agent/agents/mysql/slowlog/parser/reader.go index 89c645bcab..ae47a979d5 100644 --- a/agent/agents/mysql/slowlog/parser/reader.go +++ b/agent/agents/mysql/slowlog/parser/reader.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/mysql/slowlog/parser/simple_file_reader.go b/agent/agents/mysql/slowlog/parser/simple_file_reader.go index 25a360399a..0d32fdad18 100644 --- a/agent/agents/mysql/slowlog/parser/simple_file_reader.go +++ b/agent/agents/mysql/slowlog/parser/simple_file_reader.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -76,7 +76,7 @@ func (r *SimpleFileReader) Metrics() *ReaderMetrics { return &m } -// check interfaces +// check interfaces. var ( _ Reader = (*SimpleFileReader)(nil) ) diff --git a/agent/agents/mysql/slowlog/slowlog.go b/agent/agents/mysql/slowlog/slowlog.go index 2c7f359031..398c117d3f 100644 --- a/agent/agents/mysql/slowlog/slowlog.go +++ b/agent/agents/mysql/slowlog/slowlog.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -724,7 +724,7 @@ func (s *SlowLog) Collect(ch chan<- prometheus.Metric) { // This method is needed to satisfy interface. } -// check interfaces +// check interfaces. var ( _ prometheus.Collector = (*SlowLog)(nil) ) diff --git a/agent/agents/mysql/slowlog/slowlog_test.go b/agent/agents/mysql/slowlog/slowlog_test.go index e0c78f0208..f049ef1a66 100644 --- a/agent/agents/mysql/slowlog/slowlog_test.go +++ b/agent/agents/mysql/slowlog/slowlog_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/noop/noop.go b/agent/agents/noop/noop.go index 8578cfce01..d10817175b 100644 --- a/agent/agents/noop/noop.go +++ b/agent/agents/noop/noop.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ func (n *NoOp) Collect(ch chan<- prometheus.Metric) { // This method is needed to satisfy interface. } -// check interfaces +// check interfaces. var ( _ prometheus.Collector = (*NoOp)(nil) ) diff --git a/agent/agents/noop/noop_test.go b/agent/agents/noop/noop_test.go index 712cb1a246..ccce01930d 100644 --- a/agent/agents/noop/noop_test.go +++ b/agent/agents/noop/noop_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/postgres/parser/parser.go b/agent/agents/postgres/parser/parser.go index a0d67220cc..f57d0918cc 100644 --- a/agent/agents/postgres/parser/parser.go +++ b/agent/agents/postgres/parser/parser.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/postgres/parser/parser_fuzz.go b/agent/agents/postgres/parser/parser_fuzz.go index d96ec2fbf1..ef41184880 100644 --- a/agent/agents/postgres/parser/parser_fuzz.go +++ b/agent/agents/postgres/parser/parser_fuzz.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/postgres/parser/parser_test.go b/agent/agents/postgres/parser/parser_test.go index 4f4243f56d..289765d567 100644 --- a/agent/agents/postgres/parser/parser_test.go +++ b/agent/agents/postgres/parser/parser_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/postgres/pgstatmonitor/models.go b/agent/agents/postgres/pgstatmonitor/models.go index 218fb368ec..db1a502340 100644 --- a/agent/agents/postgres/pgstatmonitor/models.go +++ b/agent/agents/postgres/pgstatmonitor/models.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/postgres/pgstatmonitor/pgstatmonitor.go b/agent/agents/postgres/pgstatmonitor/pgstatmonitor.go index b5d4b80485..4545595db6 100644 --- a/agent/agents/postgres/pgstatmonitor/pgstatmonitor.go +++ b/agent/agents/postgres/pgstatmonitor/pgstatmonitor.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -724,5 +724,5 @@ func (m *PGStatMonitorQAN) Collect(ch chan<- prometheus.Metric) { // This method is needed to satisfy interface. } -// check interfaces +// check interfaces. var _ prometheus.Collector = (*PGStatMonitorQAN)(nil) diff --git a/agent/agents/postgres/pgstatmonitor/pgstatmonitor_models.go b/agent/agents/postgres/pgstatmonitor/pgstatmonitor_models.go index a3f865d70f..261f5d4a4b 100644 --- a/agent/agents/postgres/pgstatmonitor/pgstatmonitor_models.go +++ b/agent/agents/postgres/pgstatmonitor/pgstatmonitor_models.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ var ( v08 = version.Must(version.NewVersion("0.8")) ) -// pgStatMonitor represents a row in pg_stat_monitor view +// pgStatMonitor represents a row in pg_stat_monitor view. type pgStatMonitor struct { // PGSM < 0.6.0 DBID int64 @@ -348,7 +348,7 @@ func (s *pgStatMonitor) View() reform.View { //nolint:ireturn } var ( - // Check interfaces + // Check interfaces. _ reform.Struct = (*pgStatMonitor)(nil) _ fmt.Stringer = (*pgStatMonitor)(nil) ) diff --git a/agent/agents/postgres/pgstatmonitor/pgstatmonitor_test.go b/agent/agents/postgres/pgstatmonitor/pgstatmonitor_test.go index 9e99e1b9bc..2226e04e8b 100644 --- a/agent/agents/postgres/pgstatmonitor/pgstatmonitor_test.go +++ b/agent/agents/postgres/pgstatmonitor/pgstatmonitor_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/postgres/pgstatmonitor/stat_monitor_cache.go b/agent/agents/postgres/pgstatmonitor/stat_monitor_cache.go index 0b3801cd9d..0744b1b18d 100644 --- a/agent/agents/postgres/pgstatmonitor/stat_monitor_cache.go +++ b/agent/agents/postgres/pgstatmonitor/stat_monitor_cache.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/postgres/pgstatmonitor/stat_monitor_cache_test.go b/agent/agents/postgres/pgstatmonitor/stat_monitor_cache_test.go index bfaf963560..900ca13f21 100644 --- a/agent/agents/postgres/pgstatmonitor/stat_monitor_cache_test.go +++ b/agent/agents/postgres/pgstatmonitor/stat_monitor_cache_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/postgres/pgstatstatements/models.go b/agent/agents/postgres/pgstatstatements/models.go index 8b7b52a5aa..00746732fe 100644 --- a/agent/agents/postgres/pgstatstatements/models.go +++ b/agent/agents/postgres/pgstatstatements/models.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/postgres/pgstatstatements/pgstatstatements.go b/agent/agents/postgres/pgstatstatements/pgstatstatements.go index 2a86d4e8a4..4a912b7599 100644 --- a/agent/agents/postgres/pgstatstatements/pgstatstatements.go +++ b/agent/agents/postgres/pgstatstatements/pgstatstatements.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -423,7 +423,7 @@ func (m *PGStatStatementsQAN) Collect(ch chan<- prometheus.Metric) { } } -// check interfaces +// check interfaces. var ( _ prometheus.Collector = (*PGStatStatementsQAN)(nil) ) diff --git a/agent/agents/postgres/pgstatstatements/pgstatstatements_test.go b/agent/agents/postgres/pgstatstatements/pgstatstatements_test.go index eac93e5d3a..36b0740417 100644 --- a/agent/agents/postgres/pgstatstatements/pgstatstatements_test.go +++ b/agent/agents/postgres/pgstatstatements/pgstatstatements_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/postgres/pgstatstatements/utils.go b/agent/agents/postgres/pgstatstatements/utils.go index d1c62f5414..7c175d9547 100644 --- a/agent/agents/postgres/pgstatstatements/utils.go +++ b/agent/agents/postgres/pgstatstatements/utils.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import ( "github.com/percona/pmm/agent/utils/truncate" ) -// statementsCache is a wrapper for cache.Cache to use only with statementsMap type +// statementsCache is a wrapper for cache.Cache to use only with statementsMap type. type statementsCache struct { cache *cache.Cache } diff --git a/agent/agents/process/process.go b/agent/agents/process/process.go index 7e81a6bc7a..2ebddccf13 100644 --- a/agent/agents/process/process.go +++ b/agent/agents/process/process.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -106,8 +106,8 @@ func (p *Process) Run(ctx context.Context) { close(p.ctxDone) } -// STARTING -> RUNNING -// STARTING -> WAITING +// STARTING -> RUNNING. +// STARTING -> WAITING. func (p *Process) toStarting() { p.l.Tracef("Process: starting.") p.changes <- inventorypb.AgentStatus_STARTING @@ -149,8 +149,8 @@ func (p *Process) toStarting() { } } -// RUNNING -> STOPPING -// RUNNING -> WAITING +// RUNNING -> STOPPING. +// RUNNING -> WAITING. func (p *Process) toRunning() { p.l.Tracef("Process: running.") p.changes <- inventorypb.AgentStatus_RUNNING @@ -166,8 +166,8 @@ func (p *Process) toRunning() { } } -// WAITING -> STARTING -// WAITING -> DONE +// WAITING -> STARTING. +// WAITING -> DONE. func (p *Process) toWaiting() { delay := p.backoff.Delay() @@ -192,7 +192,7 @@ func (p *Process) toWaiting() { } } -// STOPPING -> DONE +// STOPPING -> DONE. func (p *Process) toStopping() { p.l.Tracef("Process: stopping (sending SIGTERM)...") p.changes <- inventorypb.AgentStatus_STOPPING @@ -235,7 +235,7 @@ func (p *Process) Logs() []string { return p.pl.Latest() } -// check interfaces +// check interfaces. var ( _ fmt.Stringer = (*Params)(nil) ) diff --git a/agent/agents/process/process_child.go b/agent/agents/process/process_child.go index d1ed2b3c19..3aab4cd4e7 100644 --- a/agent/agents/process/process_child.go +++ b/agent/agents/process/process_child.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/process/process_export.go b/agent/agents/process/process_export.go index 24fb606ffa..b8ea6a8951 100644 --- a/agent/agents/process/process_export.go +++ b/agent/agents/process/process_export.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/process/process_logger.go b/agent/agents/process/process_logger.go index 319bdf2ad5..865a12eaf1 100644 --- a/agent/agents/process/process_logger.go +++ b/agent/agents/process/process_logger.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -148,7 +148,7 @@ func extractLogLevel(line string) (logrus.Level, bool, error) { return level, true, nil } -// check interfaces +// check interfaces. var ( _ io.Writer = (*processLogger)(nil) ) diff --git a/agent/agents/process/process_logger_test.go b/agent/agents/process/process_logger_test.go index ccf7a53cf2..5312f6b610 100644 --- a/agent/agents/process/process_logger_test.go +++ b/agent/agents/process/process_logger_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/process/process_noterm.go b/agent/agents/process/process_noterm.go index f083b19b1c..b221d85afd 100644 --- a/agent/agents/process/process_noterm.go +++ b/agent/agents/process/process_noterm.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/process/process_test.go b/agent/agents/process/process_test.go index 719d23138e..d40d555e24 100644 --- a/agent/agents/process/process_test.go +++ b/agent/agents/process/process_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/supervisor/deps.go b/agent/agents/supervisor/deps.go index 9058ba6394..c4a6db3397 100644 --- a/agent/agents/supervisor/deps.go +++ b/agent/agents/supervisor/deps.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/supervisor/ports_registry.go b/agent/agents/supervisor/ports_registry.go index ffeaac4641..53f04a37ee 100644 --- a/agent/agents/supervisor/ports_registry.go +++ b/agent/agents/supervisor/ports_registry.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/supervisor/ports_registry_test.go b/agent/agents/supervisor/ports_registry_test.go index 4a8e4cc5d7..4528a35793 100644 --- a/agent/agents/supervisor/ports_registry_test.go +++ b/agent/agents/supervisor/ports_registry_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/agents/supervisor/supervisor.go b/agent/agents/supervisor/supervisor.go index 3538644ba4..d426980942 100644 --- a/agent/agents/supervisor/supervisor.go +++ b/agent/agents/supervisor/supervisor.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -112,7 +112,7 @@ func NewSupervisor(ctx context.Context, av agentVersioner, cfg configGetter) *Su } } -// Run waits for context and stop all agents when it's done +// Run waits for context and stop all agents when it's done. func (s *Supervisor) Run(ctx context.Context) { <-ctx.Done() s.stopAll() //nolint:contextcheck @@ -188,7 +188,7 @@ func (s *Supervisor) AgentLogByID(id string) ([]string, uint) { return nil, 0 } -// ClearChangesChannel drains state change channel +// ClearChangesChannel drains state change channel. func (s *Supervisor) ClearChangesChannel() { for { select { @@ -359,6 +359,12 @@ func (s *Supervisor) setBuiltinAgents(builtinAgents map[string]*agentpb.SetState <-agent.done delete(s.builtinAgents, agentID) + + agentTmp := filepath.Join(s.cfg.Get().Paths.TempDir, strings.ToLower(agent.requestedState.Type.String()), agentID) + err := os.RemoveAll(agentTmp) + if err != nil { + s.l.Warnf("Failed to cleanup directory '%s': %s", agentTmp, err.Error()) + } } // restart @@ -612,7 +618,7 @@ func (s *Supervisor) startBuiltin(agentID string, builtinAgent *agentpb.SetState return nil } -// agentLogger write logs to Store so can get last N +// agentLogger write logs to Store so can get last N. func (s *Supervisor) agentLogger(logStore *tailog.Store) *logrus.Logger { return &logrus.Logger{ Out: io.MultiWriter(os.Stderr, logStore), @@ -762,7 +768,7 @@ func (s *Supervisor) Collect(ch chan<- prometheus.Metric) { } } -// check interfaces +// check interfaces. var ( _ prometheus.Collector = (*Supervisor)(nil) ) diff --git a/agent/agents/supervisor/supervisor_test.go b/agent/agents/supervisor/supervisor_test.go index 33673f0462..5811e34504 100644 --- a/agent/agents/supervisor/supervisor_test.go +++ b/agent/agents/supervisor/supervisor_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/client/basic_auth.go b/agent/client/basic_auth.go index f525c8d723..5055250fc9 100644 --- a/agent/client/basic_auth.go +++ b/agent/client/basic_auth.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ func (*basicAuth) RequireTransportSecurity() bool { return false } -// check interfaces +// check interfaces. var ( _ credentials.PerRPCCredentials = (*basicAuth)(nil) ) diff --git a/agent/client/channel/channel.go b/agent/client/channel/channel.go index a7313ea584..324f8ca27b 100644 --- a/agent/client/channel/channel.go +++ b/agent/client/channel/channel.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -207,7 +207,7 @@ func (c *Channel) send(msg *agentpb.AgentMessage) { c.mSend.Inc() } -// runReader receives messages from server +// runReader receives messages from server. func (c *Channel) runReceiver() { defer func() { close(c.requests) @@ -384,7 +384,7 @@ func (c *Channel) Collect(ch chan<- prometheus.Metric) { c.mSend.Collect(ch) } -// check interfaces +// check interfaces. var ( _ prometheus.Collector = (*Channel)(nil) ) diff --git a/agent/client/channel/channel_test.go b/agent/client/channel/channel_test.go index e12fa4f860..5a785fa508 100644 --- a/agent/client/channel/channel_test.go +++ b/agent/client/channel/channel_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/client/client.go b/agent/client/client.go index e4e3b6c5ed..5e8811d9ee 100644 --- a/agent/client/client.go +++ b/agent/client/client.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -232,7 +232,7 @@ func (c *Client) Run(ctx context.Context) error { return nil } -// SendActualStatuses sends status of running agents to server +// SendActualStatuses sends status of running agents to server. func (c *Client) SendActualStatuses() { for _, agent := range c.supervisor.AgentsList() { c.l.Infof("Sending status: %s (port %d).", agent.Status, agent.ListenPort) @@ -262,6 +262,9 @@ func (c *Client) processActionResults(ctx context.Context) { for { select { case result := <-c.runner.ActionsResults(): + if result == nil { + continue + } resp, err := c.channel.SendAndWaitResponse(result) if err != nil { c.l.Error(err) @@ -281,6 +284,9 @@ func (c *Client) processJobsResults(ctx context.Context) { for { select { case message := <-c.runner.JobsMessages(): + if message == nil { + continue + } c.channel.Send(&channel.AgentResponse{ ID: 0, // Jobs send messages that don't require any responses, so we can leave message ID blank. Payload: message, @@ -302,6 +308,9 @@ func (c *Client) processSupervisorRequests(ctx context.Context) { for { select { case state := <-c.supervisor.Changes(): + if state == nil { + continue + } resp, err := c.channel.SendAndWaitResponse(state) if err != nil { c.l.Error(err) @@ -324,6 +333,9 @@ func (c *Client) processSupervisorRequests(ctx context.Context) { for { select { case collect := <-c.supervisor.QANRequests(): + if collect == nil { + continue + } resp, err := c.channel.SendAndWaitResponse(collect) if err != nil { c.l.Error(err) @@ -878,7 +890,7 @@ func (c *Client) GetServerConnectMetadata() *agentpb.ServerConnectMetadata { return md } -// GetConnectionUpTime returns connection uptime between agent and server in percentage (from 0 to 100) +// GetConnectionUpTime returns connection uptime between agent and server in percentage (from 0 to 100). func (c *Client) GetConnectionUpTime() float32 { return c.cus.GetConnectedUpTimeUntil(time.Now()) } @@ -906,7 +918,7 @@ func (c *Client) Collect(ch chan<- prometheus.Metric) { c.supervisor.Collect(ch) } -// argListFromPgParams creates an array of strings from the pointer to the parameters for pt-pg-sumamry +// argListFromPgParams creates an array of strings from the pointer to the parameters for pt-pg-sumamry. func argListFromPgParams(pParams *agentpb.StartActionRequest_PTPgSummaryParams) []string { var args []string @@ -930,7 +942,7 @@ func argListFromPgParams(pParams *agentpb.StartActionRequest_PTPgSummaryParams) return args } -// argListFromMongoDBParams creates an array of strings from the pointer to the parameters for pt-mongodb-sumamry +// argListFromMongoDBParams creates an array of strings from the pointer to the parameters for pt-mongodb-sumamry. func argListFromMongoDBParams(pParams *agentpb.StartActionRequest_PTMongoDBSummaryParams) []string { var args []string @@ -972,7 +984,7 @@ func convertAgentErrorToGrpcStatus(agentErr error) *grpcstatus.Status { return status } -// check interface +// check interface. var ( _ prometheus.Collector = (*Client)(nil) ) diff --git a/agent/client/client_test.go b/agent/client/client_test.go index afb17d091b..49c0d697d4 100644 --- a/agent/client/client_test.go +++ b/agent/client/client_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/client/deps.go b/agent/client/deps.go index 4310931445..21ecbadf43 100644 --- a/agent/client/deps.go +++ b/agent/client/deps.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/client/mock_connection_checker_test.go b/agent/client/mock_connection_checker_test.go index c1369d5718..6ce4cb51a7 100644 --- a/agent/client/mock_connection_checker_test.go +++ b/agent/client/mock_connection_checker_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package client diff --git a/agent/client/mock_supervisor_test.go b/agent/client/mock_supervisor_test.go index 84c02b68a1..b082d6685d 100644 --- a/agent/client/mock_supervisor_test.go +++ b/agent/client/mock_supervisor_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package client diff --git a/agent/client/pbm.go b/agent/client/pbm.go index 3534b9d76f..d4191d166b 100644 --- a/agent/client/pbm.go +++ b/agent/client/pbm.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/client/version.go b/agent/client/version.go index 7b5961ca0c..b2a7604394 100644 --- a/agent/client/version.go +++ b/agent/client/version.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/cmd/pmm-agent-entrypoint/main.go b/agent/cmd/pmm-agent-entrypoint/main.go index 6004cd126f..29205c30d4 100644 --- a/agent/cmd/pmm-agent-entrypoint/main.go +++ b/agent/cmd/pmm-agent-entrypoint/main.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,6 +28,8 @@ import ( "github.com/sirupsen/logrus" "golang.org/x/sys/unix" "gopkg.in/alecthomas/kingpin.v2" + + "github.com/percona/pmm/utils/logger" ) var helpText = ` @@ -131,11 +133,7 @@ func main() { var status int - logrus.SetFormatter(&logrus.TextFormatter{ - ForceColors: true, - FullTimestamp: true, - TimestampFormat: "2006-01-02T15:04:05.000-07:00", - }) + logger.SetupGlobalLogger() l := logrus.WithField("component", "entrypoint") diff --git a/agent/commands/clients.go b/agent/commands/clients.go index 32641052aa..a1552c7a5f 100644 --- a/agent/commands/clients.go +++ b/agent/commands/clients.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -206,7 +206,7 @@ func serverRegister(cfgSetup *config.Setup) (agentID, token string, _ error) { / return res.Payload.PMMAgent.AgentID, res.Payload.Token, nil } -// check interfaces +// check interfaces. var ( _ error = nginxError("") _ fmt.GoStringer = nginxError("") diff --git a/agent/commands/run.go b/agent/commands/run.go index f5acd13386..43111807b1 100644 --- a/agent/commands/run.go +++ b/agent/commands/run.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,13 +40,13 @@ import ( // Run implements `pmm-agent run` default command. func Run() { - l := logrus.WithField("component", "main") - ctx, cancel := context.WithCancel(context.Background()) - defer l.Info("Done.") - const initServerLogsMaxLength = 32 // store logs before load configuration logStore := tailog.NewStore(initServerLogsMaxLength) logrus.SetOutput(io.MultiWriter(os.Stderr, logStore)) + l := logrus.WithField("component", "main") + rootCtx, rootCancel := context.WithCancel(context.Background()) + + defer l.Info("Done.") // handle termination signals signals := make(chan os.Signal, 1) @@ -55,72 +55,89 @@ func Run() { s := <-signals signal.Stop(signals) l.Warnf("Got %s, shutting down...", unix.SignalName(s.(unix.Signal))) //nolint:forcetypeassert - cancel() + rootCancel() }() - configStorage := config.NewStorage(nil) - configFilepath, err := configStorage.Reload(l) - if err != nil { - l.Fatalf("Failed to load configuration: %s.", err) - } - - cfg := configStorage.Get() - - cleanupTmp(cfg.Paths.TempDir, l) - connectionUptimeService := connectionuptime.NewService(cfg.WindowConnectedTime) - connectionUptimeService.RunCleanupGoroutine(ctx) v := versioner.New(&versioner.RealExecFunctions{}) - supervisor := supervisor.NewSupervisor(ctx, v, configStorage) - connectionChecker := connectionchecker.New(configStorage) - r := runner.New(cfg.RunnerCapacity) - client := client.New(configStorage, supervisor, r, connectionChecker, v, connectionUptimeService, logStore) - localServer := agentlocal.NewServer(configStorage, supervisor, client, configFilepath, logStore) - - var wg sync.WaitGroup - wg.Add(3) - go func() { - defer wg.Done() - supervisor.Run(ctx) - cancel() - }() - go func() { - defer wg.Done() - r.Run(ctx) - cancel() - }() - go func() { - defer wg.Done() - localServer.Run(ctx) - cancel() - }() + configStorage, configFilepath := prepareConfig(l) for { - _, err = configStorage.Reload(l) - if err != nil { - l.Fatalf("Failed to load configuration: %s.", err) - } - + ctx, cancel := context.WithCancel(rootCtx) cfg := configStorage.Get() - config.ConfigureLogger(cfg) - logStore.Resize(cfg.LogLinesCount) - l.Debugf("Loaded configuration: %+v", cfg) + prepareLogger(cfg, logStore, l) + + supervisor := supervisor.NewSupervisor(ctx, v, configStorage) + connectionChecker := connectionchecker.New(configStorage) + r := runner.New(cfg.RunnerCapacity) + client := client.New(configStorage, supervisor, r, connectionChecker, v, prepareConnectionService(ctx, cfg), logStore) + localServer := agentlocal.NewServer(configStorage, supervisor, client, configFilepath, logStore) logrus.Infof("Window check connection time is %.2f hour(s)", cfg.WindowConnectedTime.Hours()) - connectionUptimeService.SetWindowPeriod(cfg.WindowConnectedTime) + var wg sync.WaitGroup + wg.Add(3) + reloadCh := make(chan bool, 1) + go func() { + defer wg.Done() + supervisor.Run(ctx) + cancel() + }() + go func() { + defer wg.Done() + r.Run(ctx) + cancel() + }() + go func() { + defer wg.Done() + localServer.Run(ctx, reloadCh) + cancel() + }() + + processClientUntilCancel(ctx, client, reloadCh) + + cleanupTmp(cfg.Paths.TempDir, l) + wg.Wait() + select { + case <-rootCtx.Done(): + return + default: + } + } +} + +func processClientUntilCancel(ctx context.Context, client *client.Client, reloadCh chan bool) { + for { clientCtx, cancelClientCtx := context.WithCancel(ctx) + client.Run(clientCtx) - _ = client.Run(clientCtx) cancelClientCtx() - <-client.Done() - if ctx.Err() != nil { - break + select { + case <-reloadCh: + return + case <-ctx.Done(): + return + default: } } - wg.Wait() +} + +func prepareConfig(l *logrus.Entry) (*config.Storage, string) { + configStorage := config.NewStorage(nil) + configFilepath, err := configStorage.Reload(l) + if err != nil { + l.Fatalf("Failed to load configuration: %s.", err) + } + + return configStorage, configFilepath +} + +func prepareLogger(cfg *config.Config, logStore *tailog.Store, l *logrus.Entry) { + config.ConfigureLogger(cfg) + logStore.Resize(cfg.LogLinesCount) + l.Debugf("Loaded configuration: %+v", cfg) } func cleanupTmp(tmpRoot string, log *logrus.Entry) { @@ -137,3 +154,10 @@ func cleanupTmp(tmpRoot string, log *logrus.Entry) { } } } + +func prepareConnectionService(ctx context.Context, cfg *config.Config) *connectionuptime.Service { + connectionUptimeService := connectionuptime.NewService(cfg.WindowConnectedTime) + connectionUptimeService.RunCleanupGoroutine(ctx) + + return connectionUptimeService +} diff --git a/agent/commands/setup.go b/agent/commands/setup.go index 8489a5dbf9..16db5e6fa5 100644 --- a/agent/commands/setup.go +++ b/agent/commands/setup.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/config/config.go b/agent/config/config.go index eebca14167..c81438aef5 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package config import ( "fmt" + "io/fs" "net" "net/url" "os" @@ -25,6 +26,7 @@ import ( "strings" "time" + "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" "gopkg.in/alecthomas/kingpin.v2" @@ -34,7 +36,10 @@ import ( "github.com/percona/pmm/version" ) -const pathBaseDefault = "/usr/local/percona/pmm2" +const ( + pathBaseDefault = "/usr/local/percona/pmm2" + agentTmpPath = "tmp" // temporary directory to keep exporters' config files, relative to pathBase +) // Server represents PMM Server configuration. type Server struct { @@ -179,7 +184,7 @@ func getFromCmdLine(cfg *Config, l *logrus.Entry) (string, error) { } // get is Get for unit tests: it parses args instead of command-line. -func get(args []string, cfg *Config, l *logrus.Entry) (configFileF string, err error) { //nolint:nonamedreturns +func get(args []string, cfg *Config, l *logrus.Entry) (configFileF string, err error) { //nolint:nonamedreturns,cyclop // tweak configuration on exit to cover all return points defer func() { if cfg == nil { @@ -212,7 +217,6 @@ func get(args []string, cfg *Config, l *logrus.Entry) (configFileF string, err e &cfg.Paths.RDSExporter: "rds_exporter", &cfg.Paths.AzureExporter: "azure_exporter", &cfg.Paths.VMAgent: "vmagent", - &cfg.Paths.TempDir: os.TempDir(), &cfg.Paths.PTSummary: "tools/pt-summary", &cfg.Paths.PTPGSummary: "tools/pt-pg-summary", &cfg.Paths.PTMongoDBSummary: "tools/pt-mongodb-summary", @@ -237,6 +241,16 @@ func get(args []string, cfg *Config, l *logrus.Entry) (configFileF string, err e cfg.Paths.ExportersBase = abs } + if cfg.Paths.TempDir == "" { + cfg.Paths.TempDir = filepath.Join(cfg.Paths.PathsBase, agentTmpPath) + l.Infof("Temporary directory is not configured and will be set to %s", cfg.Paths.TempDir) + } + + if !filepath.IsAbs(cfg.Paths.TempDir) { + cfg.Paths.TempDir = filepath.Join(cfg.Paths.PathsBase, cfg.Paths.TempDir) + l.Debugf("Temporary directory is configured as %s", cfg.Paths.TempDir) + } + if !filepath.IsAbs(cfg.Paths.PTSummary) { cfg.Paths.PTSummary = filepath.Join(cfg.Paths.PathsBase, cfg.Paths.PTSummary) } @@ -308,7 +322,7 @@ func get(args []string, cfg *Config, l *logrus.Entry) (configFileF string, err e } *cfg = *fileCfg - return //nolint:nakedret + return configFileF, nil } // Application returns kingpin application that will parse command-line flags and environment variables @@ -474,7 +488,7 @@ func Application(cfg *Config) (*kingpin.Application, *string) { // Other errors are returned if file exists, but configuration can't be loaded due to permission problems, // YAML parsing problems, etc. func loadFromFile(path string) (*Config, error) { - if _, err := os.Stat(path); os.IsNotExist(err) { + if _, err := os.Stat(path); errors.Is(err, fs.ErrNotExist) { return nil, ConfigFileDoesNotExistError(path) } @@ -510,8 +524,8 @@ func SaveToFile(path string, cfg *Config, comment string) error { func IsWritable(path string) error { _, err := os.Stat(path) if err != nil { - // File doesn't exists, check if folder is writable. - if os.IsNotExist(err) { + // File doesn't exist, check if folder is writable. + if errors.Is(err, fs.ErrNotExist) { return unix.Access(filepath.Dir(path), unix.W_OK) } return err diff --git a/agent/config/config_test.go b/agent/config/config_test.go index 7099e2688b..490f6c450f 100644 --- a/agent/config/config_test.go +++ b/agent/config/config_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -42,10 +42,15 @@ func removeConfig(t *testing.T, name string) { require.NoError(t, os.Remove(name)) } +func generateTempDirPath(t *testing.T, basePath string) string { + t.Helper() + return filepath.Join(basePath, agentTmpPath) +} + func TestLoadFromFile(t *testing.T) { t.Run("Normal", func(t *testing.T) { name := writeConfig(t, &Config{ID: "agent-id"}) - defer removeConfig(t, name) + t.Cleanup(func() { removeConfig(t, name) }) cfg, err := loadFromFile(name) require.NoError(t, err) @@ -61,7 +66,7 @@ func TestLoadFromFile(t *testing.T) { t.Run("PermissionDenied", func(t *testing.T) { name := writeConfig(t, &Config{ID: "agent-id"}) require.NoError(t, os.Chmod(name, 0o000)) - defer removeConfig(t, name) + t.Cleanup(func() { removeConfig(t, name) }) cfg, err := loadFromFile(name) require.IsType(t, (*os.PathError)(nil), err) @@ -73,7 +78,7 @@ func TestLoadFromFile(t *testing.T) { t.Run("NotYAML", func(t *testing.T) { name := writeConfig(t, nil) require.NoError(t, os.WriteFile(name, []byte(`not YAML`), 0o666)) //nolint:gosec - defer removeConfig(t, name) + t.Cleanup(func() { removeConfig(t, name) }) cfg, err := loadFromFile(name) require.IsType(t, (*yaml.TypeError)(nil), err) @@ -110,7 +115,7 @@ func TestGet(t *testing.T) { RDSExporter: "/usr/local/percona/pmm2/exporters/rds_exporter", AzureExporter: "/usr/local/percona/pmm2/exporters/azure_exporter", VMAgent: "/usr/local/percona/pmm2/exporters/vmagent", - TempDir: os.TempDir(), + TempDir: "/usr/local/percona/pmm2/tmp", PTSummary: "/usr/local/percona/pmm2/tools/pt-summary", PTPGSummary: "/usr/local/percona/pmm2/tools/pt-pg-summary", PTMySQLSummary: "/usr/local/percona/pmm2/tools/pt-mysql-summary", @@ -128,16 +133,25 @@ func TestGet(t *testing.T) { }) t.Run("OnlyConfig", func(t *testing.T) { - name := writeConfig(t, &Config{ + var name string + var actual Config + + tmpDir := generateTempDirPath(t, pathBaseDefault) + t.Cleanup(func() { + removeConfig(t, name) + }) + + name = writeConfig(t, &Config{ ID: "agent-id", ListenAddress: "0.0.0.0", Server: Server{ Address: "127.0.0.1", }, + Paths: Paths{ + TempDir: tmpDir, + }, }) - defer removeConfig(t, name) - var actual Config configFilepath, err := get([]string{ "--config-file=" + name, }, &actual, logrus.WithField("test", t.Name())) @@ -161,7 +175,7 @@ func TestGet(t *testing.T) { RDSExporter: "/usr/local/percona/pmm2/exporters/rds_exporter", AzureExporter: "/usr/local/percona/pmm2/exporters/azure_exporter", VMAgent: "/usr/local/percona/pmm2/exporters/vmagent", - TempDir: os.TempDir(), + TempDir: "/usr/local/percona/pmm2/tmp", PTSummary: "/usr/local/percona/pmm2/tools/pt-summary", PTPGSummary: "/usr/local/percona/pmm2/tools/pt-pg-summary", PTMongoDBSummary: "/usr/local/percona/pmm2/tools/pt-mongodb-summary", @@ -178,18 +192,24 @@ func TestGet(t *testing.T) { assert.Equal(t, name, configFilepath) }) - t.Run("Mix", func(t *testing.T) { - name := writeConfig(t, &Config{ + t.Run("BothFlagsAndConfig", func(t *testing.T) { + var name string + var actual Config + tmpDir := generateTempDirPath(t, "/foo/bar") + t.Cleanup(func() { + removeConfig(t, name) + }) + + name = writeConfig(t, &Config{ ID: "config-id", Server: Server{ Address: "127.0.0.1", }, }) - defer removeConfig(t, name) - var actual Config configFilepath, err := get([]string{ "--config-file=" + name, + "--paths-tempdir=" + tmpDir, "--id=flag-id", "--log-level=info", "--debug", @@ -214,7 +234,7 @@ func TestGet(t *testing.T) { RDSExporter: "/usr/local/percona/pmm2/exporters/rds_exporter", AzureExporter: "/usr/local/percona/pmm2/exporters/azure_exporter", VMAgent: "/usr/local/percona/pmm2/exporters/vmagent", - TempDir: os.TempDir(), + TempDir: "/foo/bar/tmp", PTSummary: "/usr/local/percona/pmm2/tools/pt-summary", PTPGSummary: "/usr/local/percona/pmm2/tools/pt-pg-summary", PTMySQLSummary: "/usr/local/percona/pmm2/tools/pt-mysql-summary", @@ -234,7 +254,14 @@ func TestGet(t *testing.T) { }) t.Run("MixExportersBase", func(t *testing.T) { - name := writeConfig(t, &Config{ + var name string + var actual Config + + t.Cleanup(func() { + removeConfig(t, name) + }) + + name = writeConfig(t, &Config{ ID: "config-id", Server: Server{ Address: "127.0.0.1", @@ -242,11 +269,10 @@ func TestGet(t *testing.T) { Paths: Paths{ PostgresExporter: "/bar/postgres_exporter", ProxySQLExporter: "pro_exporter", + TempDir: "tmp", }, }) - defer removeConfig(t, name) - var actual Config configFilepath, err := get([]string{ "--config-file=" + name, "--id=flag-id", @@ -275,7 +301,7 @@ func TestGet(t *testing.T) { RDSExporter: "/base/rds_exporter", // default value AzureExporter: "/base/azure_exporter", // default value VMAgent: "/base/vmagent", // default value - TempDir: os.TempDir(), + TempDir: "/usr/local/percona/pmm2/tmp", PTSummary: "/usr/local/percona/pmm2/tools/pt-summary", PTPGSummary: "/usr/local/percona/pmm2/tools/pt-pg-summary", PTMongoDBSummary: "/usr/local/percona/pmm2/tools/pt-mongodb-summary", @@ -294,7 +320,14 @@ func TestGet(t *testing.T) { }) t.Run("MixPathsBase", func(t *testing.T) { - name := writeConfig(t, &Config{ + var name string + var actual Config + + t.Cleanup(func() { + removeConfig(t, name) + }) + + name = writeConfig(t, &Config{ ID: "config-id", Server: Server{ Address: "127.0.0.1", @@ -304,9 +337,7 @@ func TestGet(t *testing.T) { ProxySQLExporter: "/base/exporters/pro_exporter", }, }) - defer removeConfig(t, name) - var actual Config configFilepath, err := get([]string{ "--config-file=" + name, "--id=flag-id", @@ -335,7 +366,7 @@ func TestGet(t *testing.T) { RDSExporter: "/base/exporters/rds_exporter", // default value AzureExporter: "/base/exporters/azure_exporter", // default value VMAgent: "/base/exporters/vmagent", // default value - TempDir: os.TempDir(), + TempDir: "/base/tmp", PTSummary: "/base/tools/pt-summary", PTPGSummary: "/base/tools/pt-pg-summary", PTMongoDBSummary: "/base/tools/pt-mongodb-summary", @@ -354,18 +385,24 @@ func TestGet(t *testing.T) { }) t.Run("MixPathsBaseExporterBase", func(t *testing.T) { - name := writeConfig(t, &Config{ + var name string + var actual Config + + t.Cleanup(func() { + removeConfig(t, name) + }) + + name = writeConfig(t, &Config{ ID: "config-id", Server: Server{ Address: "127.0.0.1", }, Paths: Paths{ ExportersBase: "/foo/exporters", + TempDir: "/foo/tmp", }, }) - defer removeConfig(t, name) - var actual Config configFilepath, err := get([]string{ "--config-file=" + name, "--id=flag-id", @@ -392,7 +429,7 @@ func TestGet(t *testing.T) { RDSExporter: "/foo/exporters/rds_exporter", // default value AzureExporter: "/foo/exporters/azure_exporter", // default value VMAgent: "/foo/exporters/vmagent", // default value - TempDir: os.TempDir(), + TempDir: "/foo/tmp", PTSummary: "/base/tools/pt-summary", PTPGSummary: "/base/tools/pt-pg-summary", PTMongoDBSummary: "/base/tools/pt-mongodb-summary", @@ -413,14 +450,18 @@ func TestGet(t *testing.T) { t.Run("NoFile", func(t *testing.T) { wd, err := os.Getwd() require.NoError(t, err) + name := t.Name() + tmpDir := generateTempDirPath(t, pathBaseDefault) var actual Config configFilepath, err := get([]string{ "--config-file=" + name, + "--paths-tempdir=" + tmpDir, "--id=flag-id", "--debug", - }, &actual, logrus.WithField("test", t.Name())) + }, &actual, logrus.WithField("test", name)) + expected := Config{ ID: "flag-id", ListenAddress: "127.0.0.1", @@ -436,7 +477,7 @@ func TestGet(t *testing.T) { RDSExporter: "/usr/local/percona/pmm2/exporters/rds_exporter", AzureExporter: "/usr/local/percona/pmm2/exporters/azure_exporter", VMAgent: "/usr/local/percona/pmm2/exporters/vmagent", - TempDir: os.TempDir(), + TempDir: "/usr/local/percona/pmm2/tmp", PTSummary: "/usr/local/percona/pmm2/tools/pt-summary", PTPGSummary: "/usr/local/percona/pmm2/tools/pt-pg-summary", PTMongoDBSummary: "/usr/local/percona/pmm2/tools/pt-mongodb-summary", diff --git a/agent/config/logger.go b/agent/config/logger.go index 1daa9e513b..a2930f3711 100644 --- a/agent/config/logger.go +++ b/agent/config/logger.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ func (v *gRPCLogger) V(l int) bool { return true } -// override InfoXXX methods with TraceXXX to keep gRPC and logrus levels in sync +// override InfoXXX methods with TraceXXX to keep gRPC and logrus levels in sync. func (v *gRPCLogger) Info(args ...interface{}) { v.Trace(args...) } func (v *gRPCLogger) Infoln(args ...interface{}) { v.Traceln(args...) } func (v *gRPCLogger) Infof(format string, args ...interface{}) { v.Tracef(format, args...) } @@ -63,8 +63,6 @@ func ConfigureLogger(cfg *Config) { logrus.SetLevel(level) if level == logrus.TraceLevel { - // grpclog.SetLoggerV2 is not thread-safe - // logrus.SetReportCaller thread-safe: https://github.com/sirupsen/logrus/issues/954 logrus.SetReportCaller(true) } diff --git a/agent/config/storage.go b/agent/config/storage.go index d3c8630ee2..821d425f03 100644 --- a/agent/config/storage.go +++ b/agent/config/storage.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/connectionchecker/connection_checker.go b/agent/connectionchecker/connection_checker.go index 280c406844..c59ac148e8 100644 --- a/agent/connectionchecker/connection_checker.go +++ b/agent/connectionchecker/connection_checker.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/connectionchecker/connection_checker_test.go b/agent/connectionchecker/connection_checker_test.go index 94aef528fd..cf06e94bc7 100644 --- a/agent/connectionchecker/connection_checker_test.go +++ b/agent/connectionchecker/connection_checker_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/connectionuptime/service.go b/agent/connectionuptime/service.go index 49ec3bc0b0..304c048a58 100644 --- a/agent/connectionuptime/service.go +++ b/agent/connectionuptime/service.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import ( const periodForRunningDeletingOldEvents = time.Minute // Service calculates connection uptime between agent and server -// based on the connection events +// based on the connection events. type Service struct { mx sync.Mutex events []connectionEvent @@ -39,7 +39,7 @@ type connectionEvent struct { Connected bool } -// NewService creates new instance of Service +// NewService creates new instance of Service. func NewService(windowPeriod time.Duration) *Service { return &Service{ windowPeriod: windowPeriod, @@ -47,7 +47,7 @@ func NewService(windowPeriod time.Duration) *Service { } } -// SetWindowPeriod updates window period +// SetWindowPeriod updates window period. func (c *Service) SetWindowPeriod(windowPeriod time.Duration) { c.mx.Lock() defer c.mx.Unlock() @@ -55,7 +55,7 @@ func (c *Service) SetWindowPeriod(windowPeriod time.Duration) { c.windowPeriod = windowPeriod } -// RegisterConnectionStatus adds connection event +// RegisterConnectionStatus adds connection event. func (c *Service) RegisterConnectionStatus(timestamp time.Time, connected bool) { c.mx.Lock() defer c.mx.Unlock() diff --git a/agent/connectionuptime/service_test.go b/agent/connectionuptime/service_test.go index e6ddcc1c41..b244e90618 100644 --- a/agent/connectionuptime/service_test.go +++ b/agent/connectionuptime/service_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/main.go b/agent/main.go index 0a5ea9a0dc..7bf443c56e 100644 --- a/agent/main.go +++ b/agent/main.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,15 +15,11 @@ package main import ( - "fmt" - "path/filepath" - "runtime" - - "github.com/sirupsen/logrus" "gopkg.in/alecthomas/kingpin.v2" "github.com/percona/pmm/agent/commands" "github.com/percona/pmm/agent/config" + "github.com/percona/pmm/utils/logger" "github.com/percona/pmm/version" ) @@ -33,25 +29,7 @@ func main() { panic("pmm-agent version is not set during build.") } - // we don't have configuration options for formatter, so set it once there - logrus.SetFormatter(&logrus.TextFormatter{ - // Enable multiline-friendly formatter in both development (with terminal) and production (without terminal): - // https://github.com/sirupsen/logrus/blob/839c75faf7f98a33d445d181f3018b5c3409a45e/text_formatter.go#L176-L178 - ForceColors: true, - FullTimestamp: true, - TimestampFormat: "2006-01-02T15:04:05.000-07:00", - - CallerPrettyfier: func(f *runtime.Frame) (string, string) { - _, function := filepath.Split(f.Function) - - // keep a single directory name as a compromise between brevity and unambiguity - dir, file := filepath.Split(f.File) - dir = filepath.Base(dir) - file = fmt.Sprintf("%s/%s:%d", dir, file, f.Line) - - return function, file - }, - }) + logger.SetupGlobalLogger() // check that command-line flags and environment variables are correct, // parse command, but do try not load config file diff --git a/agent/main_test.go b/agent/main_test.go index 4c6cd30161..e3eb03dacf 100644 --- a/agent/main_test.go +++ b/agent/main_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/maincover_test.go b/agent/maincover_test.go index aeecdceafc..6a751993f8 100644 --- a/agent/maincover_test.go +++ b/agent/maincover_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/queryparser/helpers.go b/agent/queryparser/helpers.go index 2862a2f3b0..e1277106e6 100644 --- a/agent/queryparser/helpers.go +++ b/agent/queryparser/helpers.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/queryparser/parser.go b/agent/queryparser/parser.go index a8e4c3e2f3..eb43d26a04 100644 --- a/agent/queryparser/parser.go +++ b/agent/queryparser/parser.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/queryparser/parser_test.go b/agent/queryparser/parser_test.go index 6528941277..2b453a6ba3 100644 --- a/agent/queryparser/parser_test.go +++ b/agent/queryparser/parser_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/action.go b/agent/runner/actions/action.go index 6ade8f3cf4..5a9625f9c8 100644 --- a/agent/runner/actions/action.go +++ b/agent/runner/actions/action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/common.go b/agent/runner/actions/common.go index adff5d5bd0..e81b843d24 100644 --- a/agent/runner/actions/common.go +++ b/agent/runner/actions/common.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ var whiteSpacesRegExp = regexp.MustCompile(`\s+`) // ["value 1", 2, …] // … // -// ] +// ]. func jsonRows(columns []string, dataRows [][]interface{}) ([]byte, error) { res := make([][]interface{}, len(dataRows)+1) diff --git a/agent/runner/actions/common_test.go b/agent/runner/actions/common_test.go index ea01fd5a72..91b2494739 100644 --- a/agent/runner/actions/common_test.go +++ b/agent/runner/actions/common_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mongodb_explain_action.go b/agent/runner/actions/mongodb_explain_action.go index 93eb10cedb..944572ee59 100644 --- a/agent/runner/actions/mongodb_explain_action.go +++ b/agent/runner/actions/mongodb_explain_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mongodb_explain_action_test.go b/agent/runner/actions/mongodb_explain_action_test.go index 1b503b5ff8..1ac5fe2764 100644 --- a/agent/runner/actions/mongodb_explain_action_test.go +++ b/agent/runner/actions/mongodb_explain_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mongodb_query_admincommand_action.go b/agent/runner/actions/mongodb_query_admincommand_action.go index c7b8e1a133..2ded20cf5e 100644 --- a/agent/runner/actions/mongodb_query_admincommand_action.go +++ b/agent/runner/actions/mongodb_query_admincommand_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mongodb_query_admincommand_action_test.go b/agent/runner/actions/mongodb_query_admincommand_action_test.go index efc306fd77..6318594b5a 100644 --- a/agent/runner/actions/mongodb_query_admincommand_action_test.go +++ b/agent/runner/actions/mongodb_query_admincommand_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mysql_explain_action.go b/agent/runner/actions/mysql_explain_action.go index ffbafcdf89..2ac3ff4ca5 100644 --- a/agent/runner/actions/mysql_explain_action.go +++ b/agent/runner/actions/mysql_explain_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -83,6 +83,11 @@ func (a *mysqlExplainAction) Run(ctx context.Context) ([]byte, error) { return nil, errors.New("Query to EXPLAIN is empty") } + // You cant run Explain on trimmed queries. + if strings.HasSuffix(a.params.Query, "...") { + return nil, errors.New("EXPLAIN failed because the query was too long and trimmed. Set max-query-length to a larger value.") + } + // Explain is supported only for DML queries. // https://dev.mysql.com/doc/refman/8.0/en/using-explain.html if !isDMLQuery(a.params.Query) { @@ -114,6 +119,13 @@ func (a *mysqlExplainAction) Run(ctx context.Context) ([]byte, error) { IsDMLQuery: changedToSelect, } + if a.params.Schema != "" { + _, err = tx.ExecContext(ctx, fmt.Sprintf("USE %#q", a.params.Schema)) + if err != nil { + return nil, err + } + } + switch a.params.OutputFormat { case agentpb.MysqlExplainOutputFormat_MYSQL_EXPLAIN_OUTPUT_FORMAT_DEFAULT: response.ExplainResult, err = a.explainDefault(ctx, tx) diff --git a/agent/runner/actions/mysql_explain_action_test.go b/agent/runner/actions/mysql_explain_action_test.go index 5ee6843eb2..b8e58f5b9a 100644 --- a/agent/runner/actions/mysql_explain_action_test.go +++ b/agent/runner/actions/mysql_explain_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -197,6 +197,22 @@ func TestMySQLExplain(t *testing.T) { assert.Equal(t, er.Query, `SELECT * FROM city WHERE Name='Rosario'`) }) + t.Run("Query longer than max-query-length", func(t *testing.T) { + t.Parallel() + + params := &agentpb.StartActionRequest_MySQLExplainParams{ + Dsn: dsn, + Query: `INSERT INTO city (Name)...`, + OutputFormat: agentpb.MysqlExplainOutputFormat_MYSQL_EXPLAIN_OUTPUT_FORMAT_DEFAULT, + } + a := NewMySQLExplainAction("", time.Second, params) + ctx, cancel := context.WithTimeout(context.Background(), a.Timeout()) + defer cancel() + + _, err := a.Run(ctx) + require.Error(t, err, "EXPLAIN failed because the query was too long and trimmed. Set max-query-length to a larger value.") + }) + t.Run("LittleBobbyTables", func(t *testing.T) { t.Parallel() diff --git a/agent/runner/actions/mysql_query_select_action.go b/agent/runner/actions/mysql_query_select_action.go index b9bdfcc52b..39833e5b11 100644 --- a/agent/runner/actions/mysql_query_select_action.go +++ b/agent/runner/actions/mysql_query_select_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mysql_query_select_action_test.go b/agent/runner/actions/mysql_query_select_action_test.go index 30d778d3d4..e5281478d8 100644 --- a/agent/runner/actions/mysql_query_select_action_test.go +++ b/agent/runner/actions/mysql_query_select_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mysql_query_show_action.go b/agent/runner/actions/mysql_query_show_action.go index a00f61b1bd..4081e1898e 100644 --- a/agent/runner/actions/mysql_query_show_action.go +++ b/agent/runner/actions/mysql_query_show_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mysql_query_show_action_test.go b/agent/runner/actions/mysql_query_show_action_test.go index f2baefee7d..dd1ce37653 100644 --- a/agent/runner/actions/mysql_query_show_action_test.go +++ b/agent/runner/actions/mysql_query_show_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mysql_show_create_table_action.go b/agent/runner/actions/mysql_show_create_table_action.go index c7fd7225a1..7ca727f2c6 100644 --- a/agent/runner/actions/mysql_show_create_table_action.go +++ b/agent/runner/actions/mysql_show_create_table_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mysql_show_create_table_action_test.go b/agent/runner/actions/mysql_show_create_table_action_test.go index f61e7abd3a..1c5bb7eaaa 100644 --- a/agent/runner/actions/mysql_show_create_table_action_test.go +++ b/agent/runner/actions/mysql_show_create_table_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mysql_show_index_action.go b/agent/runner/actions/mysql_show_index_action.go index d226951bed..1a2bc070fe 100644 --- a/agent/runner/actions/mysql_show_index_action.go +++ b/agent/runner/actions/mysql_show_index_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mysql_show_index_action_test.go b/agent/runner/actions/mysql_show_index_action_test.go index 9ddf0f7ed9..00fdbf83b9 100644 --- a/agent/runner/actions/mysql_show_index_action_test.go +++ b/agent/runner/actions/mysql_show_index_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mysql_show_table_status_action.go b/agent/runner/actions/mysql_show_table_status_action.go index 2baa53e772..1d7c5331ae 100644 --- a/agent/runner/actions/mysql_show_table_status_action.go +++ b/agent/runner/actions/mysql_show_table_status_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/mysql_show_table_status_action_test.go b/agent/runner/actions/mysql_show_table_status_action_test.go index 9c82418364..843ed282bf 100644 --- a/agent/runner/actions/mysql_show_table_status_action_test.go +++ b/agent/runner/actions/mysql_show_table_status_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/postgresql_query_select_action.go b/agent/runner/actions/postgresql_query_select_action.go index 6223aca7d3..4e21de6582 100644 --- a/agent/runner/actions/postgresql_query_select_action.go +++ b/agent/runner/actions/postgresql_query_select_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/postgresql_query_select_action_test.go b/agent/runner/actions/postgresql_query_select_action_test.go index 74451f4efc..3f52823a17 100644 --- a/agent/runner/actions/postgresql_query_select_action_test.go +++ b/agent/runner/actions/postgresql_query_select_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/postgresql_query_show_action.go b/agent/runner/actions/postgresql_query_show_action.go index 190c0928d7..c4ab4e2fdb 100644 --- a/agent/runner/actions/postgresql_query_show_action.go +++ b/agent/runner/actions/postgresql_query_show_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/postgresql_query_show_action_test.go b/agent/runner/actions/postgresql_query_show_action_test.go index e95c8b52ed..afd1196b87 100644 --- a/agent/runner/actions/postgresql_query_show_action_test.go +++ b/agent/runner/actions/postgresql_query_show_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/postgresql_show_create_table_action.go b/agent/runner/actions/postgresql_show_create_table_action.go index 3a33adce77..ad15129432 100644 --- a/agent/runner/actions/postgresql_show_create_table_action.go +++ b/agent/runner/actions/postgresql_show_create_table_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/postgresql_show_create_table_action_test.go b/agent/runner/actions/postgresql_show_create_table_action_test.go index ba74a95304..176b70ba9e 100644 --- a/agent/runner/actions/postgresql_show_create_table_action_test.go +++ b/agent/runner/actions/postgresql_show_create_table_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/postgresql_show_index_action.go b/agent/runner/actions/postgresql_show_index_action.go index 08c21ceb13..b91d823d96 100644 --- a/agent/runner/actions/postgresql_show_index_action.go +++ b/agent/runner/actions/postgresql_show_index_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/postgresql_show_index_action_test.go b/agent/runner/actions/postgresql_show_index_action_test.go index 32daae5bf3..38516865d1 100644 --- a/agent/runner/actions/postgresql_show_index_action_test.go +++ b/agent/runner/actions/postgresql_show_index_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/process_action.go b/agent/runner/actions/process_action.go index b8c04d6de2..2b0d16baa9 100644 --- a/agent/runner/actions/process_action.go +++ b/agent/runner/actions/process_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/process_action_test.go b/agent/runner/actions/process_action_test.go index a80786e7cf..52bcd13cb2 100644 --- a/agent/runner/actions/process_action_test.go +++ b/agent/runner/actions/process_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/pt_mysql_summary_action.go b/agent/runner/actions/pt_mysql_summary_action.go index a049d45b7f..bce06cc268 100644 --- a/agent/runner/actions/pt_mysql_summary_action.go +++ b/agent/runner/actions/pt_mysql_summary_action.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/pt_mysql_summary_action_test.go b/agent/runner/actions/pt_mysql_summary_action_test.go index 3a9deabc18..6226827dbe 100644 --- a/agent/runner/actions/pt_mysql_summary_action_test.go +++ b/agent/runner/actions/pt_mysql_summary_action_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/actions/query_transform.go b/agent/runner/actions/query_transform.go index 574f9e604f..8e0bd2aa33 100644 --- a/agent/runner/actions/query_transform.go +++ b/agent/runner/actions/query_transform.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import ( //nolint:lll var ( dmlVerbs = []string{"select", "insert", "update", "delete", "replace"} + commentsRe = regexp.MustCompile(`(?s)\/\*(.*?)\*\/`) selectRe = regexp.MustCompile(`(?i)^select\s+(.*?)\bfrom\s+(.*?)$`) updateRe = regexp.MustCompile(`(?i)^update\s+(?:low_priority|ignore)?\s*(.*?)\s+set\s+(.*?)(?:\s+where\s+(.*?))?(?:\s+limit\s*[0-9]+(?:\s*,\s*[0-9]+)?)?$`) deleteRe = regexp.MustCompile(`(?i)^delete\s+(.*?)\bfrom\s+(.*?)$`) @@ -31,8 +32,16 @@ var ( insertSetRe = regexp.MustCompile(`(?i)(?:insert(?:\s+ignore)?|replace)\s+(?:.*?\binto)\s+(.*?)\s*set\s+(.*?)\s*(?:\blimit\b|on\s+duplicate\s+key.*)?\s*$`) ) +func prepareQuery(query string) string { + query = commentsRe.ReplaceAllString(query, "") + query = strings.ReplaceAll(query, "\t", " ") + query = strings.ReplaceAll(query, "\n", " ") + query = strings.TrimRight(query, ";") + return strings.TrimLeft(query, " ") +} + func isDMLQuery(query string) bool { - query = strings.ToLower(strings.TrimSpace(query)) + query = strings.ToLower(prepareQuery(query)) for _, verb := range dmlVerbs { if strings.HasPrefix(query, verb) { return true @@ -51,7 +60,7 @@ it able to explain DML queries on older MySQL versions and for unprivileged user // dmlToSelect returns query converted to select and boolean, if conversion were needed. func dmlToSelect(query string) (string, bool) { - query = strings.ReplaceAll(query, "\n", " ") + query = prepareQuery(query) m := selectRe.FindStringSubmatch(query) if len(m) > 1 { diff --git a/agent/runner/actions/query_transform_test.go b/agent/runner/actions/query_transform_test.go index 84831d04d1..db31e62545 100644 --- a/agent/runner/actions/query_transform_test.go +++ b/agent/runner/actions/query_transform_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,79 +15,163 @@ package actions import ( + "fmt" "testing" "github.com/stretchr/testify/assert" ) -func TestDMLToSelect(t *testing.T) { - q, c := dmlToSelect(`SELECT nombre FROM tabla WHERE id = 0`) - assert.False(t, c) - assert.Equal(t, `SELECT nombre FROM tabla WHERE id = 0`, q) - - q, c = dmlToSelect(`update ignore tabla set nombre = "carlos" where id = 0 limit 2`) - assert.True(t, c) - assert.Equal(t, `SELECT nombre = "carlos" FROM tabla WHERE id = 0`, q) - - q, c = dmlToSelect(`update ignore tabla set nombre = "carlos" where id = 0`) - assert.True(t, c) - assert.Equal(t, `SELECT nombre = "carlos" FROM tabla WHERE id = 0`, q) - - q, c = dmlToSelect(`update ignore tabla set nombre = "carlos" limit 1`) - assert.True(t, c) - assert.Equal(t, `SELECT nombre = "carlos" FROM tabla`, q) - - q, c = dmlToSelect(`update tabla set nombre = "carlos" where id = 0 limit 2`) - assert.True(t, c) - assert.Equal(t, `SELECT nombre = "carlos" FROM tabla WHERE id = 0`, q) - - q, c = dmlToSelect(`update tabla set nombre = "carlos" where id = 0`) - assert.True(t, c) - assert.Equal(t, `SELECT nombre = "carlos" FROM tabla WHERE id = 0`, q) - - q, c = dmlToSelect(`update tabla set nombre = "carlos" limit 1`) - assert.True(t, c) - assert.Equal(t, `SELECT nombre = "carlos" FROM tabla`, q) - - q, c = dmlToSelect(`delete from tabla`) - assert.True(t, c) - assert.Equal(t, `SELECT * FROM tabla`, q) - - q, c = dmlToSelect(`delete from tabla join tabla2 on tabla.id = tabla2.tabla2_id`) - assert.True(t, c) - assert.Equal(t, `SELECT 1 FROM tabla join tabla2 on tabla.id = tabla2.tabla2_id`, q) - - q, c = dmlToSelect(`insert into tabla (f1, f2, f3) values (1,2,3)`) - assert.True(t, c) - assert.Equal(t, `SELECT * FROM tabla WHERE f1=1 and f2=2 and f3=3`, q) - - q, c = dmlToSelect(`insert into tabla (f1, f2, f3) values (1,2)`) - assert.True(t, c) - assert.Equal(t, `SELECT * FROM tabla LIMIT 1`, q) - - q, c = dmlToSelect(`insert into tabla set f1="A1", f2="A2"`) - assert.True(t, c) - assert.Equal(t, `SELECT * FROM tabla WHERE f1="A1" AND f2="A2"`, q) - - q, c = dmlToSelect(`replace into tabla set f1="A1", f2="A2"`) - assert.True(t, c) - assert.Equal(t, `SELECT * FROM tabla WHERE f1="A1" AND f2="A2"`, q) - - q, c = dmlToSelect("insert into `tabla-1` values(12)") - assert.True(t, c) - assert.Equal(t, "SELECT * FROM `tabla-1` LIMIT 1", q) - - q, c = dmlToSelect(`UPDATE - employees2 -SET - first_name = 'Joe', - emp_no = 10 -WHERE - emp_no = 3`) - assert.True(t, c) - assert.Equal(t, "SELECT first_name = 'Joe', emp_no = 10 FROM employees2 WHERE emp_no = 3", q) +func Test_dmlToSelect(t *testing.T) { + t.Parallel() + + type testCase struct { + Query string + Converted bool + Expected string + } + + testCases := []testCase{ + { + Query: `SELECT nombre FROM tabla WHERE id = 0`, + Converted: false, + Expected: `SELECT nombre FROM tabla WHERE id = 0`, + }, + { + Query: `update ignore tabla set nombre = "carlos" where id = 0 limit 2`, + Converted: true, + Expected: `SELECT nombre = "carlos" FROM tabla WHERE id = 0`, + }, + { + Query: `update ignore tabla set nombre = "carlos" where id = 0`, + Converted: true, + Expected: `SELECT nombre = "carlos" FROM tabla WHERE id = 0`, + }, + { + Query: `update ignore tabla set nombre = "carlos" limit 1`, + Converted: true, + Expected: `SELECT nombre = "carlos" FROM tabla`, + }, + { + Query: `update tabla set nombre = "carlos" where id = 0 limit 2`, + Converted: true, + Expected: `SELECT nombre = "carlos" FROM tabla WHERE id = 0`, + }, + { + Query: `update tabla set nombre = "carlos" where id = 0`, + Converted: true, + Expected: `SELECT nombre = "carlos" FROM tabla WHERE id = 0`, + }, + { + Query: `update tabla set nombre = "carlos" limit 1`, + Converted: true, + Expected: `SELECT nombre = "carlos" FROM tabla`, + }, + { + Query: `delete from tabla`, + Converted: true, + Expected: `SELECT * FROM tabla`, + }, + { + Query: `delete from tabla join tabla2 on tabla.id = tabla2.tabla2_id`, + Converted: true, + Expected: `SELECT 1 FROM tabla join tabla2 on tabla.id = tabla2.tabla2_id`, + }, + { + Query: `insert into tabla (f1, f2, f3) values (1,2,3)`, + Converted: true, + Expected: `SELECT * FROM tabla WHERE f1=1 and f2=2 and f3=3`, + }, + { + Query: `insert into tabla (f1, f2, f3) values (1,2)`, + Converted: true, + Expected: `SELECT * FROM tabla LIMIT 1`, + }, + { + Query: `insert into tabla set f1="A1", f2="A2"`, + Converted: true, + Expected: `SELECT * FROM tabla WHERE f1="A1" AND f2="A2"`, + }, + { + Query: "insert into `tabla-1` values(12)", + Converted: true, + Expected: "SELECT * FROM `tabla-1` LIMIT 1", + }, + { + Query: `UPDATE + employees2 + SET + first_name = 'Joe', + emp_no = 10 + WHERE + emp_no = 3`, + Converted: true, + Expected: `SELECT first_name = 'Joe', emp_no = 10 FROM employees2 WHERE emp_no = 3`, + }, + { + Query: ` + /* File:movie.php Line:8 Func:update_info */ + SELECT + * + FROM + movie_info + WHERE + movie_id = 68357`, + Converted: false, + Expected: `SELECT * FROM movie_info WHERE movie_id = 68357`, + }, + { + Query: `SELECT /*+ NO_RANGE_OPTIMIZATION(t3 PRIMARY, f2_idx) */ f1 + FROM t3 WHERE f1 > 30 AND f1 < 33;`, + Converted: false, + Expected: `SELECT f1 FROM t3 WHERE f1 > 30 AND f1 < 33`, + }, + { + Query: `SELECT /*+ BKA(t1) NO_BKA(t2) */ * FROM t1 INNER JOIN t2 WHERE ...;`, + Converted: false, + Expected: `SELECT * FROM t1 INNER JOIN t2 WHERE ...`, + }, + { + Query: `SELECT /*+ NO_ICP(t1, t2) */ * FROM t1 INNER JOIN t2 WHERE ...;`, + Converted: false, + Expected: `SELECT * FROM t1 INNER JOIN t2 WHERE ...`, + }, + { + Query: `SELECT /*+ SEMIJOIN(FIRSTMATCH, LOOSESCAN) */ * FROM t1 ...;`, + Converted: false, + Expected: `SELECT * FROM t1 ...`, + }, + { + Query: `EXPLAIN SELECT /*+ NO_ICP(t1) */ * FROM t1 WHERE ...;`, + Converted: false, + Expected: ``, + }, + { + Query: `SELECT /*+ MERGE(dt) */ * FROM (SELECT * FROM t1) AS dt;`, + Converted: false, + Expected: `SELECT * FROM (SELECT * FROM t1) AS dt`, + }, + { + Query: `INSERT /*+ SET_VAR(foreign_key_checks=OFF) */ INTO t2 VALUES(2);`, + Converted: true, + Expected: `SELECT * FROM t2 LIMIT 1`, + }, + } + + for i, tc := range testCases { + tc := tc + t.Run(fmt.Sprintf("TestDMLToSelect %d. %s", i, tc.Query), func(t *testing.T) { + t.Parallel() + q, c := dmlToSelect(tc.Query) + assert.Equal(t, tc.Converted, c) + assert.Equal(t, tc.Expected, q) + }) + } +} - q, c = dmlToSelect(`UPDATE employees2 SET first_name = 'Joe', emp_no = 10 WHERE emp_no = 3`) - assert.True(t, c) - assert.Equal(t, "SELECT first_name = 'Joe', emp_no = 10 FROM employees2 WHERE emp_no = 3", q) +func Test_isDMLQuery(t *testing.T) { + assert.True(t, isDMLQuery("SELECT * FROM table")) + assert.True(t, isDMLQuery(`update tabla set nombre = "carlos" where id = 0`)) + assert.True(t, isDMLQuery("delete from tabla join tabla2 on tabla.id = tabla2.tabla2_id")) + assert.True(t, isDMLQuery("/*+ SET_VAR(foreign_key_checks=OFF) */ INSERT INTO t2 VALUES(2);")) + assert.False(t, isDMLQuery("EXPLAIN SELECT * FROM table")) } diff --git a/agent/runner/jobs/backup_location.go b/agent/runner/jobs/backup_location.go index 684525ae29..d72b012102 100644 --- a/agent/runner/jobs/backup_location.go +++ b/agent/runner/jobs/backup_location.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ type S3LocationConfig struct { BucketRegion string } -// FilesystemBackupLocationConfig contains config for local storage +// FilesystemBackupLocationConfig contains config for local storage. type FilesystemBackupLocationConfig struct { Path string } diff --git a/agent/runner/jobs/common.go b/agent/runner/jobs/common.go index 57a2c2521c..f110bd309d 100644 --- a/agent/runner/jobs/common.go +++ b/agent/runner/jobs/common.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/jobs/deps.go b/agent/runner/jobs/deps.go index b161813b47..8838103192 100644 --- a/agent/runner/jobs/deps.go +++ b/agent/runner/jobs/deps.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/jobs/errors.go b/agent/runner/jobs/errors.go index 21a320008a..ce90511e8b 100644 --- a/agent/runner/jobs/errors.go +++ b/agent/runner/jobs/errors.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,3 +18,6 @@ import "github.com/pkg/errors" // ErrNotFound returned when backup record is not found by backup tool. var ErrNotFound = errors.New("backup record not found by backup tool") + +// ErrPBMArtifactProblem returned when PBM reports artifact error. +var ErrPBMArtifactProblem = errors.New("pbm artifact problem") diff --git a/agent/runner/jobs/job.go b/agent/runner/jobs/job.go index 0543f4f786..6d4c2eabdf 100644 --- a/agent/runner/jobs/job.go +++ b/agent/runner/jobs/job.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/jobs/mongodb_backup_job.go b/agent/runner/jobs/mongodb_backup_job.go index 5320fa8eab..7c321844b7 100644 --- a/agent/runner/jobs/mongodb_backup_job.go +++ b/agent/runner/jobs/mongodb_backup_job.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -158,7 +158,7 @@ func (j *MongoDBBackupJob) Run(ctx context.Context, send Send) error { return err } - backupTimestamp, err := pbmGetSnapshotTimestamp(ctx, j.dbURL, pbmBackupOut.Name) + backupTimestamp, err := pbmGetSnapshotTimestamp(ctx, j.l, j.dbURL, pbmBackupOut.Name) if err != nil { return err } diff --git a/agent/runner/jobs/mongodb_backup_job_test.go b/agent/runner/jobs/mongodb_backup_job_test.go index 70e4388275..669b3f6580 100644 --- a/agent/runner/jobs/mongodb_backup_job_test.go +++ b/agent/runner/jobs/mongodb_backup_job_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/jobs/mongodb_restore_job.go b/agent/runner/jobs/mongodb_restore_job.go index cc6edbd636..c11ae699d5 100644 --- a/agent/runner/jobs/mongodb_restore_job.go +++ b/agent/runner/jobs/mongodb_restore_job.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -134,12 +134,17 @@ func (j *MongoDBRestoreJob) Run(ctx context.Context, send Send) error { } cancel() - snapshot, err := j.findSnapshot(ctx, j.pbmBackupName) + snapshot, err := j.findCurrentSnapshot(ctx, j.pbmBackupName) if err != nil { j.jobLogger.sendLog(send, err.Error(), false) return errors.WithStack(err) } + if snapshot.Status == "error" { //nolint:goconst + j.jobLogger.sendLog(send, snapshot.Error, false) + return errors.Wrap(ErrPBMArtifactProblem, snapshot.Error) + } + defer j.agentsRestarter.RestartAgents() restoreOut, err := j.startRestore(ctx, snapshot.Name) if err != nil { @@ -172,44 +177,25 @@ func (j *MongoDBRestoreJob) Run(ctx context.Context, send Send) error { return nil } -func (j *MongoDBRestoreJob) findSnapshot(ctx context.Context, snapshotName string) (*pbmSnapshot, error) { +func (j *MongoDBRestoreJob) findCurrentSnapshot(ctx context.Context, snapshotName string) (*pbmSnapshot, error) { j.l.Info("Finding backup entity name.") - var list pbmList - ticker := time.NewTicker(listCheckInterval) - defer ticker.Stop() - - checks := 0 - for { - select { - case <-ticker.C: - checks++ - if err := execPBMCommand(ctx, j.dbURL, &list, "list"); err != nil { - return nil, err - } - - if len(list.Snapshots) == 0 { - j.l.Debugf("Try number %d of getting list of artifacts from PBM is failed.", checks) - if checks > maxListChecks { - return nil, errors.Wrap(ErrNotFound, "got no one snapshot") - } - continue - } + snapshots, err := getSnapshots(ctx, j.l, j.dbURL) + if err != nil { + return nil, err + } - // Old artifacts don't contain pbm backup name. - if snapshotName == "" { - return &list.Snapshots[len(list.Snapshots)-1], nil - } + // Old artifacts don't contain pbm backup name. + if snapshotName == "" { + return &snapshots[0], nil + } - for _, s := range list.Snapshots { - if s.Name == snapshotName { - return &s, nil - } - } - case <-ctx.Done(): - return nil, ctx.Err() + for _, s := range snapshots { + if s.Name == snapshotName { + return &s, nil } } + return nil, errors.WithStack(ErrNotFound) } func (j *MongoDBRestoreJob) startRestore(ctx context.Context, backupName string) (*pbmRestore, error) { diff --git a/agent/runner/jobs/mysql_backup_job.go b/agent/runner/jobs/mysql_backup_job.go index ac1dc27896..fd8b613aee 100644 --- a/agent/runner/jobs/mysql_backup_job.go +++ b/agent/runner/jobs/mysql_backup_job.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/jobs/mysql_restore_job.go b/agent/runner/jobs/mysql_restore_job.go index 761ce2ef5e..0c8fb7abca 100644 --- a/agent/runner/jobs/mysql_restore_job.go +++ b/agent/runner/jobs/mysql_restore_job.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ const ( xbstreamBin = "xbstream" mySQLSystemUserName = "mysql" mySQLSystemGroupName = "mysql" - // TODO make mySQLDirectory autorecognized as done in 'xtrabackup' utility; see 'xtrabackup --help' --datadir parameter + // TODO make mySQLDirectory autorecognized as done in 'xtrabackup' utility; see 'xtrabackup --help' --datadir parameter. mySQLDirectory = "/var/lib/mysql" systemctlTimeout = 10 * time.Second ) @@ -428,7 +428,7 @@ func restoreBackup(ctx context.Context, backupDirectory, mySQLDirectory string) return nil } -// getMysqlServiceName returns MySQL system service name +// getMysqlServiceName returns MySQL system service name. func getMysqlServiceName(ctx context.Context) (string, error) { ctx, cancel := context.WithTimeout(ctx, systemctlTimeout) defer cancel() diff --git a/agent/runner/jobs/pbm_helpers.go b/agent/runner/jobs/pbm_helpers.go index 241cccf2f9..0ede95084a 100644 --- a/agent/runner/jobs/pbm_helpers.go +++ b/agent/runner/jobs/pbm_helpers.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -120,14 +120,7 @@ type pbmSnapshot struct { RestoreTo int64 `json:"restoreTo"` PbmVersion string `json:"pbmVersion"` Type string `json:"type"` -} - -type pbmList struct { - Snapshots []pbmSnapshot `json:"snapshots"` - Pitr struct { - On bool `json:"on"` - Ranges interface{} `json:"ranges"` - } `json:"pitr"` + Error string `json:"error"` } type pbmListRestore struct { @@ -286,7 +279,7 @@ func waitForPBMBackup(ctx context.Context, l logrus.FieldLogger, dbURL *string, return nil case "canceled": return errors.New("backup was canceled") - case "error": //nolint:goconst + case "error": return errors.New(info.Error) } @@ -464,7 +457,7 @@ func writePBMConfigFile(conf *PBMConfig) (string, error) { return tmp.Name(), tmp.Close() } -// Serialization helpers +// Serialization helpers. // Storage represents target storage parameters. type Storage struct { @@ -556,17 +549,13 @@ func groupPartlyDoneErrors(info describeInfo) error { } // pbmGetSnapshotTimestamp returns time the backup restores target db to. -func pbmGetSnapshotTimestamp(ctx context.Context, dbURL *string, backupName string) (*time.Time, error) { - var list pbmList - if err := execPBMCommand(ctx, dbURL, &list, "list"); err != nil { +func pbmGetSnapshotTimestamp(ctx context.Context, l logrus.FieldLogger, dbURL *string, backupName string) (*time.Time, error) { + snapshots, err := getSnapshots(ctx, l, dbURL) + if err != nil { return nil, err } - if len(list.Snapshots) == 0 { - return nil, errors.Wrapf(ErrNotFound, "got no one snapshot") - } - - for _, snapshot := range list.Snapshots { + for _, snapshot := range snapshots { if snapshot.Name == backupName { return pointer.ToTime(time.Unix(snapshot.RestoreTo, 0)), nil } @@ -574,3 +563,35 @@ func pbmGetSnapshotTimestamp(ctx context.Context, dbURL *string, backupName stri return nil, errors.Wrap(ErrNotFound, "couldn't find required snapshot") } + +// getSnapshots returns all PBM snapshots found in configured location. +func getSnapshots(ctx context.Context, l logrus.FieldLogger, dbURL *string) ([]pbmSnapshot, error) { + // Sometimes PBM returns empty list of snapshots, that's why we're trying to get them several times. + ticker := time.NewTicker(listCheckInterval) + defer ticker.Stop() + + checks := 0 + for { + select { + case <-ticker.C: + checks++ + status, err := getPBMStatus(ctx, dbURL) + if err != nil { + return nil, err + } + + if len(status.Backups.Snapshot) == 0 { + l.Debugf("Attempt %d to get a list of PBM artifacts has failed.", checks) + if checks > maxListChecks { + return nil, errors.Wrap(ErrNotFound, "got no one snapshot") + } + continue + } + + return status.Backups.Snapshot, nil + + case <-ctx.Done(): + return nil, ctx.Err() + } + } +} diff --git a/agent/runner/jobs/pbm_helpers_test.go b/agent/runner/jobs/pbm_helpers_test.go index 38e8022e72..3fe1bc8be8 100644 --- a/agent/runner/jobs/pbm_helpers_test.go +++ b/agent/runner/jobs/pbm_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/jobs/pbm_job_logger.go b/agent/runner/jobs/pbm_job_logger.go index 87b27c4120..e1a1511018 100644 --- a/agent/runner/jobs/pbm_job_logger.go +++ b/agent/runner/jobs/pbm_job_logger.go @@ -1,4 +1,4 @@ -// Copyright 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/runner.go b/agent/runner/runner.go index d3efa8a177..8b89afe18b 100644 --- a/agent/runner/runner.go +++ b/agent/runner/runner.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/runner/runner_test.go b/agent/runner/runner_test.go index f731c45be9..b5ed9ddb7a 100644 --- a/agent/runner/runner_test.go +++ b/agent/runner/runner_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/tailog/store.go b/agent/tailog/store.go index 45ff99c8d9..02d56a71ea 100644 --- a/agent/tailog/store.go +++ b/agent/tailog/store.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package tailog helps store tail logs +// Package tailog helps store tail logs. package tailog import ( diff --git a/agent/tlshelpers/mysql.go b/agent/tlshelpers/mysql.go index 590cc86b9a..b16352a268 100644 --- a/agent/tlshelpers/mysql.go +++ b/agent/tlshelpers/mysql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/backoff/backoff.go b/agent/utils/backoff/backoff.go index 562c1a93af..7b4717f1f5 100644 --- a/agent/utils/backoff/backoff.go +++ b/agent/utils/backoff/backoff.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/backoff/backoff_draw.go b/agent/utils/backoff/backoff_draw.go index 3901d35bd1..a08a2063b9 100644 --- a/agent/utils/backoff/backoff_draw.go +++ b/agent/utils/backoff/backoff_draw.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/backoff/backoff_test.go b/agent/utils/backoff/backoff_test.go index 7811ddf94e..fe10a7e0d4 100644 --- a/agent/utils/backoff/backoff_test.go +++ b/agent/utils/backoff/backoff_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/depstests/depstests.go b/agent/utils/depstests/depstests.go index 6667361914..7df756679a 100644 --- a/agent/utils/depstests/depstests.go +++ b/agent/utils/depstests/depstests.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/depstests/protobuf_test.go b/agent/utils/depstests/protobuf_test.go index c930e0e539..d030b75c4c 100644 --- a/agent/utils/depstests/protobuf_test.go +++ b/agent/utils/depstests/protobuf_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/errors/errors.go b/agent/utils/errors/errors.go index 1f3d832e84..55ca35f1f4 100644 --- a/agent/utils/errors/errors.go +++ b/agent/utils/errors/errors.go @@ -1,4 +1,4 @@ -// Copyright 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/mongo_fix/mongo_fix.go b/agent/utils/mongo_fix/mongo_fix.go index 8811fb450f..ea56431b47 100644 --- a/agent/utils/mongo_fix/mongo_fix.go +++ b/agent/utils/mongo_fix/mongo_fix.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/mongo_fix/mongo_fix_test.go b/agent/utils/mongo_fix/mongo_fix_test.go index c27dbfebd9..146a6135de 100644 --- a/agent/utils/mongo_fix/mongo_fix_test.go +++ b/agent/utils/mongo_fix/mongo_fix_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/templates/template.go b/agent/utils/templates/template.go index b585f06817..78f258e448 100644 --- a/agent/utils/templates/template.go +++ b/agent/utils/templates/template.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/templates/template_test.go b/agent/utils/templates/template_test.go index 394a8bb194..43aab0ab6c 100644 --- a/agent/utils/templates/template_test.go +++ b/agent/utils/templates/template_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/tests/db.go b/agent/utils/tests/db.go index 4d1d8c40db..a38bddc8ee 100644 --- a/agent/utils/tests/db.go +++ b/agent/utils/tests/db.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/tests/log.go b/agent/utils/tests/log.go index cedca49584..534a285dc7 100644 --- a/agent/utils/tests/log.go +++ b/agent/utils/tests/log.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/tests/mongodb.go b/agent/utils/tests/mongodb.go index 7e435a0d34..6c6364a681 100644 --- a/agent/utils/tests/mongodb.go +++ b/agent/utils/tests/mongodb.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/tests/mysql.go b/agent/utils/tests/mysql.go index ee4047f90d..c0cd5e6e0a 100644 --- a/agent/utils/tests/mysql.go +++ b/agent/utils/tests/mysql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/tests/postgresql.go b/agent/utils/tests/postgresql.go index 9e7b73e5c2..e88adb9b68 100644 --- a/agent/utils/tests/postgresql.go +++ b/agent/utils/tests/postgresql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/tests/qan.go b/agent/utils/tests/qan.go index f57dcaa8ff..319950d56f 100644 --- a/agent/utils/tests/qan.go +++ b/agent/utils/tests/qan.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/truncate/query.go b/agent/utils/truncate/query.go index 8e46b29f05..3e71f6fecf 100644 --- a/agent/utils/truncate/query.go +++ b/agent/utils/truncate/query.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/truncate/query_test.go b/agent/utils/truncate/query_test.go index 27b0b57a61..7be09ebbf0 100644 --- a/agent/utils/truncate/query_test.go +++ b/agent/utils/truncate/query_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/version/mysql.go b/agent/utils/version/mysql.go index cc6ae6b33f..358cc5e875 100644 --- a/agent/utils/version/mysql.go +++ b/agent/utils/version/mysql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/version/mysql_test.go b/agent/utils/version/mysql_test.go index 043f6e699a..fac6fc456c 100644 --- a/agent/utils/version/mysql_test.go +++ b/agent/utils/version/mysql_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/utils/version/postgresql.go b/agent/utils/version/postgresql.go index a950a764eb..f88f906a13 100644 --- a/agent/utils/version/postgresql.go +++ b/agent/utils/version/postgresql.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ import ( "strings" ) -// regexps to extract version numbers from the `SELECT version()` output +// regexps to extract version numbers from the `SELECT version()` output. var ( postgresDBRegexp = regexp.MustCompile(`PostgreSQL ([\d\.]+)`) ) diff --git a/agent/utils/version/postgresql_test.go b/agent/utils/version/postgresql_test.go index 9d5001f25c..1f7df6ca85 100644 --- a/agent/utils/version/postgresql_test.go +++ b/agent/utils/version/postgresql_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/versioner/mock_exec_functions_test.go b/agent/versioner/mock_exec_functions_test.go index cef0d3136a..084b3e7f04 100644 --- a/agent/versioner/mock_exec_functions_test.go +++ b/agent/versioner/mock_exec_functions_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package versioner diff --git a/agent/versioner/versioner.go b/agent/versioner/versioner.go index 8cb4a12191..6da2eaa099 100644 --- a/agent/versioner/versioner.go +++ b/agent/versioner/versioner.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/agent/versioner/versioner_test.go b/agent/versioner/versioner_test.go index e23ccccd57..b650bdb774 100644 --- a/agent/versioner/versioner_test.go +++ b/agent/versioner/versioner_test.go @@ -1,4 +1,4 @@ -// Copyright 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api-tests/helpers.go b/api-tests/helpers.go index 20d27307a6..5ef69250b9 100644 --- a/api-tests/helpers.go +++ b/api-tests/helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -211,6 +211,21 @@ func AddRemoteNode(t TestingT, nodeName string) *nodes.AddRemoteNodeOKBody { return res.Payload } +func AddNode(t TestingT, nodeBody *nodes.AddNodeBody) *nodes.AddNodeOKBody { + t.Helper() + + params := &nodes.AddNodeParams{ + Body: *nodeBody, + Context: Context, + } + + res, err := client.Default.Nodes.AddNode(params) + assert.NoError(t, err) + require.NotNil(t, res) + + return res.Payload +} + func AddPMMAgent(t TestingT, nodeID string) *agents.AddPMMAgentOKBody { t.Helper() @@ -225,7 +240,7 @@ func AddPMMAgent(t TestingT, nodeID string) *agents.AddPMMAgentOKBody { return res.Payload } -// check interfaces +// check interfaces. var ( _ assert.TestingT = (*expectedFailureTestingT)(nil) _ require.TestingT = (*expectedFailureTestingT)(nil) diff --git a/api-tests/init.go b/api-tests/init.go index 12073e9c5c..482137381b 100644 --- a/api-tests/init.go +++ b/api-tests/init.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -226,7 +226,7 @@ func init() { } } -// check interfaces +// check interfaces. var ( _ error = (*NginxError)(nil) _ fmt.GoStringer = (*NginxError)(nil) diff --git a/api-tests/inventory/agents_azure_database_exporter_test.go b/api-tests/inventory/agents_azure_database_exporter_test.go index 8762c1866a..5228a6169e 100644 --- a/api-tests/inventory/agents_azure_database_exporter_test.go +++ b/api-tests/inventory/agents_azure_database_exporter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/inventory/agents_external_exporter_test.go b/api-tests/inventory/agents_external_exporter_test.go index a39632cc46..d1562a148e 100644 --- a/api-tests/inventory/agents_external_exporter_test.go +++ b/api-tests/inventory/agents_external_exporter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/inventory/agents_mongodb_exporter_test.go b/api-tests/inventory/agents_mongodb_exporter_test.go index 3485be366a..92e937b248 100644 --- a/api-tests/inventory/agents_mongodb_exporter_test.go +++ b/api-tests/inventory/agents_mongodb_exporter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/inventory/agents_mysqld_exporter_test.go b/api-tests/inventory/agents_mysqld_exporter_test.go index 963cbb7781..014c78d2a6 100644 --- a/api-tests/inventory/agents_mysqld_exporter_test.go +++ b/api-tests/inventory/agents_mysqld_exporter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/inventory/agents_node_exporter_test.go b/api-tests/inventory/agents_node_exporter_test.go index f1e66e7086..2cfdd8f20a 100644 --- a/api-tests/inventory/agents_node_exporter_test.go +++ b/api-tests/inventory/agents_node_exporter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/inventory/agents_postgres_exporter_test.go b/api-tests/inventory/agents_postgres_exporter_test.go index d81f5c80e4..218412fbd4 100644 --- a/api-tests/inventory/agents_postgres_exporter_test.go +++ b/api-tests/inventory/agents_postgres_exporter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/inventory/agents_proxysql_exporter_test.go b/api-tests/inventory/agents_proxysql_exporter_test.go index 472360232e..0e1bd10654 100644 --- a/api-tests/inventory/agents_proxysql_exporter_test.go +++ b/api-tests/inventory/agents_proxysql_exporter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/inventory/agents_rds_exporter_test.go b/api-tests/inventory/agents_rds_exporter_test.go index 9fd25072a6..7b59c38938 100644 --- a/api-tests/inventory/agents_rds_exporter_test.go +++ b/api-tests/inventory/agents_rds_exporter_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/inventory/agents_test.go b/api-tests/inventory/agents_test.go index f760ab10ce..5c785b77e5 100644 --- a/api-tests/inventory/agents_test.go +++ b/api-tests/inventory/agents_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/inventory/helpers.go b/api-tests/inventory/helpers.go index 0cc8d4555d..dbce94c22e 100644 --- a/api-tests/inventory/helpers.go +++ b/api-tests/inventory/helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/inventory/nodes_test.go b/api-tests/inventory/nodes_test.go index e3adc01ac9..fe7e3142ec 100644 --- a/api-tests/inventory/nodes_test.go +++ b/api-tests/inventory/nodes_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -31,7 +31,7 @@ import ( "github.com/percona/pmm/api/inventorypb/json/client/services" ) -func TestNodes(t *testing.T) { +func TestNodesDeprecated(t *testing.T) { t.Parallel() t.Run("List", func(t *testing.T) { t.Parallel() @@ -45,7 +45,7 @@ func TestNodes(t *testing.T) { res, err := client.Default.Nodes.ListNodes(nil) require.NoError(t, err) - require.NotZerof(t, len(res.Payload.Generic), "There should be at least one node") + require.NotEmptyf(t, res.Payload.Generic, "There should be at least one node") require.Conditionf(t, func() (success bool) { for _, v := range res.Payload.Generic { if v.NodeID == genericNodeID { @@ -54,7 +54,7 @@ func TestNodes(t *testing.T) { } return false }, "There should be generic node with id `%s`", genericNodeID) - require.NotZerof(t, len(res.Payload.Remote), "There should be at least one node") + require.NotEmptyf(t, res.Payload.Remote, "There should be at least one node") require.Conditionf(t, func() (success bool) { for _, v := range res.Payload.Remote { if v.NodeID == remoteNodeID { @@ -71,7 +71,7 @@ func TestNodes(t *testing.T) { Context: pmmapitests.Context, }) require.NoError(t, err) - require.NotZerof(t, len(res.Payload.Generic), "There should be at least one generic node") + require.NotEmptyf(t, res.Payload.Generic, "There should be at least one generic node") require.Conditionf(t, func() (success bool) { for _, v := range res.Payload.Generic { if v.NodeID == genericNodeID { @@ -91,6 +91,78 @@ func TestNodes(t *testing.T) { }) } +func TestNodes(t *testing.T) { + t.Parallel() + t.Run("List", func(t *testing.T) { + t.Parallel() + + remoteNode := pmmapitests.AddNode(t, &nodes.AddNodeBody{ + Remote: &nodes.AddNodeParamsBodyRemote{ + NodeName: pmmapitests.TestString(t, "Test Remote Node for List"), + Address: "10.10.10.1", + }, + }) + remoteNodeID := remoteNode.Remote.NodeID + t.Cleanup(func() { pmmapitests.RemoveNodes(t, remoteNodeID) }) + + genericNode := pmmapitests.AddNode(t, &nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{ + NodeName: pmmapitests.TestString(t, "Test Remote Node for List"), + Address: "10.10.10.2", + }, + }) + genericNodeID := genericNode.Generic.NodeID + require.NotEmpty(t, genericNodeID) + t.Cleanup(func() { pmmapitests.RemoveNodes(t, genericNodeID) }) + + res, err := client.Default.Nodes.ListNodes(nil) + require.NoError(t, err) + require.NotEmptyf(t, res.Payload.Generic, "There should be at least one node") + require.Conditionf(t, func() (success bool) { + for _, v := range res.Payload.Generic { + if v.NodeID == genericNodeID { + return true + } + } + return false + }, "There should be a generic node with id `%s`", genericNodeID) + require.NotEmptyf(t, res.Payload.Remote, "There should be at least one node") + require.Conditionf(t, func() (success bool) { + for _, v := range res.Payload.Remote { + if v.NodeID == remoteNodeID { + return true + } + } + return false + }, "There should be a remote node with id `%s`", remoteNodeID) + + res, err = client.Default.Nodes.ListNodes(&nodes.ListNodesParams{ + Body: nodes.ListNodesBody{ + NodeType: pointer.ToString(nodes.ListNodesBodyNodeTypeGENERICNODE), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + require.NotEmptyf(t, res.Payload.Generic, "There should be at least one generic node") + require.Conditionf(t, func() (success bool) { + for _, v := range res.Payload.Generic { + if v.NodeID == genericNodeID { + return true + } + } + return false + }, "There should be a generic node with id `%s`", genericNodeID) + require.Conditionf(t, func() (success bool) { + for _, v := range res.Payload.Remote { + if v.NodeID == remoteNodeID { + return false + } + } + return true + }, "There shouldn't be a remote node with id `%s`", remoteNodeID) + }) +} + func TestGetNode(t *testing.T) { t.Parallel() t.Run("Basic", func(t *testing.T) { @@ -145,7 +217,7 @@ func TestGetNode(t *testing.T) { }) } -func TestGenericNode(t *testing.T) { +func TestGenericNodeDeprecated(t *testing.T) { t.Parallel() t.Run("Basic", func(t *testing.T) { t.Parallel() @@ -205,12 +277,76 @@ func TestGenericNode(t *testing.T) { }) } -func TestContainerNode(t *testing.T) { +func TestGenericNode(t *testing.T) { t.Parallel() t.Run("Basic", func(t *testing.T) { t.Parallel() - nodeName := pmmapitests.TestString(t, "Test Container Node") + nodeName := pmmapitests.TestString(t, "Test Generic Node") + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{ + NodeName: nodeName, + Address: "10.10.10.10", + }, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + assert.NoError(t, err) + require.NotNil(t, res) + require.NotNil(t, res.Payload.Generic) + nodeID := res.Payload.Generic.NodeID + t.Cleanup(func() { pmmapitests.RemoveNodes(t, nodeID) }) + + // Check that the node exists in DB. + getNodeRes, err := client.Default.Nodes.GetNode(&nodes.GetNodeParams{ + Body: nodes.GetNodeBody{NodeID: nodeID}, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + expectedResponse := &nodes.GetNodeOK{ + Payload: &nodes.GetNodeOKBody{ + Generic: &nodes.GetNodeOKBodyGeneric{ + NodeID: res.Payload.Generic.NodeID, + NodeName: nodeName, + Address: "10.10.10.10", + }, + }, + } + require.Equal(t, expectedResponse, getNodeRes) + + // Check for duplicates. + res, err = client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, "Node with name %q already exists.", nodeName) + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Generic.NodeID) + } + }) + + t.Run("AddNameEmpty", func(t *testing.T) { + t.Parallel() + + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{NodeName: ""}, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddGenericNodeRequest.NodeName: value length must be at least 1 runes") + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Generic.NodeID) + } + }) +} + +func TestContainerNodeDeprecated(t *testing.T) { + t.Parallel() + t.Run("Basic", func(t *testing.T) { + t.Parallel() + + nodeName := pmmapitests.TestString(t, "Test Container Node Deprecated") params := &nodes.AddContainerNodeParams{ Body: nodes.AddContainerNodeBody{ NodeName: nodeName, @@ -270,7 +406,76 @@ func TestContainerNode(t *testing.T) { }) } -func TestRemoteNode(t *testing.T) { +func TestContainerNode(t *testing.T) { + t.Parallel() + t.Run("Basic", func(t *testing.T) { + t.Parallel() + + nodeName := pmmapitests.TestString(t, "Test Container Node") + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Container: &nodes.AddNodeParamsBodyContainer{ + NodeName: nodeName, + ContainerID: "docker-id", + ContainerName: "docker-name", + MachineID: "machine-id", + Address: "10.10.1.10", + }, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + require.NoError(t, err) + require.NotNil(t, res.Payload.Container) + nodeID := res.Payload.Container.NodeID + defer pmmapitests.RemoveNodes(t, nodeID) + + // Check that the node exists in DB. + getNodeRes, err := client.Default.Nodes.GetNode(&nodes.GetNodeParams{ + Body: nodes.GetNodeBody{NodeID: nodeID}, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + expectedResponse := &nodes.GetNodeOK{ + Payload: &nodes.GetNodeOKBody{ + Container: &nodes.GetNodeOKBodyContainer{ + NodeID: res.Payload.Container.NodeID, + NodeName: nodeName, + ContainerID: "docker-id", + ContainerName: "docker-name", + MachineID: "machine-id", + Address: "10.10.1.10", + }, + }, + } + require.Equal(t, expectedResponse, getNodeRes) + + // Check for duplicates. + res, err = client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, "Node with name %q already exists.", nodeName) + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Container.NodeID) + } + }) + + t.Run("AddNameEmpty", func(t *testing.T) { + t.Parallel() + + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Container: &nodes.AddNodeParamsBodyContainer{NodeName: ""}, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddContainerNodeRequest.NodeName: value length must be at least 1 runes") + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Container.NodeID) + } + }) +} + +func TestRemoteNodeDeprecated(t *testing.T) { t.Parallel() t.Run("Basic", func(t *testing.T) { t.Parallel() @@ -335,14 +540,89 @@ func TestRemoteNode(t *testing.T) { }) } +func TestRemoteNode(t *testing.T) { + t.Parallel() + t.Run("Basic", func(t *testing.T) { + t.Parallel() + + nodeName := pmmapitests.TestString(t, "Test Remote Node") + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Remote: &nodes.AddNodeParamsBodyRemote{ + NodeName: nodeName, + Az: "eu", + Region: "us-west", + Address: "10.10.10.11", + CustomLabels: map[string]string{"foo": "bar"}, + }, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + require.NoError(t, err) + require.NotNil(t, res.Payload.Remote) + nodeID := res.Payload.Remote.NodeID + defer pmmapitests.RemoveNodes(t, nodeID) + + // Check node exists in DB. + getNodeRes, err := client.Default.Nodes.GetNode(&nodes.GetNodeParams{ + Body: nodes.GetNodeBody{NodeID: nodeID}, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + expectedResponse := &nodes.GetNodeOK{ + Payload: &nodes.GetNodeOKBody{ + Remote: &nodes.GetNodeOKBodyRemote{ + NodeID: res.Payload.Remote.NodeID, + NodeName: nodeName, + Az: "eu", + Region: "us-west", + Address: "10.10.10.11", + CustomLabels: map[string]string{"foo": "bar"}, + }, + }, + } + require.Equal(t, expectedResponse, getNodeRes) + + // Check duplicates. + res, err = client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, "Node with name %q already exists.", nodeName) + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Remote.NodeID) + } + }) + + t.Run("AddNameEmpty", func(t *testing.T) { + t.Parallel() + + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Remote: &nodes.AddNodeParamsBodyRemote{NodeName: ""}, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddRemoteNodeRequest.NodeName: value length must be at least 1 runes") + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Remote.NodeID) + } + }) +} + func TestRemoveNode(t *testing.T) { t.Parallel() t.Run("Basic", func(t *testing.T) { t.Parallel() nodeName := pmmapitests.TestString(t, "Generic Node for basic remove test") - node := pmmapitests.AddGenericNode(t, nodeName) - nodeID := node.NodeID + node := pmmapitests.AddNode(t, + &nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{ + NodeName: nodeName, + Address: "10.10.10.1", + }, + }) + nodeID := node.Generic.NodeID removeResp, err := client.Default.Nodes.RemoveNode(&nodes.RemoveNodeParams{ Body: nodes.RemoveNodeBody{ @@ -358,11 +638,18 @@ func TestRemoveNode(t *testing.T) { t.Parallel() nodeName := pmmapitests.TestString(t, "Generic Node for remove test") - node := pmmapitests.AddGenericNode(t, nodeName) + node := pmmapitests.AddNode(t, + &nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{ + NodeName: nodeName, + Address: "10.10.10.1", + }, + }, + ) serviceName := pmmapitests.TestString(t, "MySQL Service for agent") service := addMySQLService(t, services.AddMySQLServiceBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, Address: "localhost", Port: 3306, ServiceName: serviceName, @@ -371,16 +658,16 @@ func TestRemoveNode(t *testing.T) { removeResp, err := client.Default.Nodes.RemoveNode(&nodes.RemoveNodeParams{ Body: nodes.RemoveNodeBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, }, Context: context.Background(), }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.FailedPrecondition, `Node with ID %q has services.`, node.NodeID) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.FailedPrecondition, `Node with ID %q has services.`, node.Generic.NodeID) assert.Nil(t, removeResp) // Check that node and service isn't removed. getServiceResp, err := client.Default.Nodes.GetNode(&nodes.GetNodeParams{ - Body: nodes.GetNodeBody{NodeID: node.NodeID}, + Body: nodes.GetNodeBody{NodeID: node.Generic.NodeID}, Context: pmmapitests.Context, }) assert.NotNil(t, getServiceResp) @@ -388,7 +675,7 @@ func TestRemoveNode(t *testing.T) { listAgentsOK, err := client.Default.Services.ListServices(&services.ListServicesParams{ Body: services.ListServicesBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, }, Context: pmmapitests.Context, }) @@ -396,11 +683,12 @@ func TestRemoveNode(t *testing.T) { assert.Equal(t, &services.ListServicesOKBody{ Mysql: []*services.ListServicesOKBodyMysqlItems0{ { - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, ServiceID: serviceID, Address: "localhost", Port: 3306, ServiceName: serviceName, + Cluster: serviceName, }, }, }, listAgentsOK.Payload) @@ -408,7 +696,7 @@ func TestRemoveNode(t *testing.T) { // Remove with force flag. params := &nodes.RemoveNodeParams{ Body: nodes.RemoveNodeBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, Force: true, }, Context: pmmapitests.Context, @@ -419,15 +707,15 @@ func TestRemoveNode(t *testing.T) { // Check that the node and agents are removed. getServiceResp, err = client.Default.Nodes.GetNode(&nodes.GetNodeParams{ - Body: nodes.GetNodeBody{NodeID: node.NodeID}, + Body: nodes.GetNodeBody{NodeID: node.Generic.NodeID}, Context: pmmapitests.Context, }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.NodeID) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.Generic.NodeID) assert.Nil(t, getServiceResp) listAgentsOK, err = client.Default.Services.ListServices(&services.ListServicesParams{ Body: services.ListServicesBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, }, Context: pmmapitests.Context, }) @@ -439,23 +727,30 @@ func TestRemoveNode(t *testing.T) { t.Parallel() nodeName := pmmapitests.TestString(t, "Generic Node for remove test") - node := pmmapitests.AddGenericNode(t, nodeName) + node := pmmapitests.AddNode(t, + &nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{ + NodeName: nodeName, + Address: "10.10.10.1", + }, + }, + ) - _ = pmmapitests.AddPMMAgent(t, node.NodeID) + _ = pmmapitests.AddPMMAgent(t, node.Generic.NodeID) removeResp, err := client.Default.Nodes.RemoveNode(&nodes.RemoveNodeParams{ Body: nodes.RemoveNodeBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, }, Context: context.Background(), }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.FailedPrecondition, `Node with ID %q has pmm-agent.`, node.NodeID) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.FailedPrecondition, `Node with ID %q has pmm-agent.`, node.Generic.NodeID) assert.Nil(t, removeResp) // Remove with force flag. params := &nodes.RemoveNodeParams{ Body: nodes.RemoveNodeBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, Force: true, }, Context: pmmapitests.Context, @@ -466,19 +761,19 @@ func TestRemoveNode(t *testing.T) { // Check that the node and agents are removed. getServiceResp, err := client.Default.Nodes.GetNode(&nodes.GetNodeParams{ - Body: nodes.GetNodeBody{NodeID: node.NodeID}, + Body: nodes.GetNodeBody{NodeID: node.Generic.NodeID}, Context: pmmapitests.Context, }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.NodeID) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.Generic.NodeID) assert.Nil(t, getServiceResp) listAgentsOK, err := client.Default.Agents.ListAgents(&agents.ListAgentsParams{ Body: agents.ListAgentsBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, }, Context: pmmapitests.Context, }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.NodeID) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.Generic.NodeID) assert.Nil(t, listAgentsOK) }) diff --git a/api-tests/inventory/services_test.go b/api-tests/inventory/services_test.go index 21c83853bf..d019fb0f46 100644 --- a/api-tests/inventory/services_test.go +++ b/api-tests/inventory/services_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -352,6 +352,7 @@ func TestMySQLService(t *testing.T) { Address: "localhost", Port: 3306, ServiceName: serviceName, + Cluster: serviceName, }, }, }, res) @@ -372,6 +373,7 @@ func TestMySQLService(t *testing.T) { Address: "localhost", Port: 3306, ServiceName: serviceName, + Cluster: serviceName, }, }, }, serviceRes) @@ -553,6 +555,7 @@ func TestMongoDBService(t *testing.T) { ServiceID: serviceID, NodeID: genericNodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "localhost", Port: 27017, }, @@ -573,6 +576,7 @@ func TestMongoDBService(t *testing.T) { ServiceID: serviceID, NodeID: genericNodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "localhost", Port: 27017, }, @@ -729,6 +733,7 @@ func TestMongoDBService(t *testing.T) { ServiceID: serviceID, NodeID: genericNodeID, ServiceName: serviceName, + Cluster: serviceName, Socket: "/tmp/mongodb-27017.sock", }, }, @@ -770,6 +775,7 @@ func TestPostgreSQLService(t *testing.T) { DatabaseName: defaultPostgresDBName, Port: 5432, ServiceName: serviceName, + Cluster: serviceName, }, }, }, res) @@ -791,6 +797,7 @@ func TestPostgreSQLService(t *testing.T) { DatabaseName: defaultPostgresDBName, Port: 5432, ServiceName: serviceName, + Cluster: serviceName, }, }, }, serviceRes) @@ -973,6 +980,7 @@ func TestProxySQLService(t *testing.T) { Address: "localhost", Port: 5432, ServiceName: serviceName, + Cluster: serviceName, }, }, }, res) @@ -993,6 +1001,7 @@ func TestProxySQLService(t *testing.T) { Address: "localhost", Port: 5432, ServiceName: serviceName, + Cluster: serviceName, }, }, }, serviceRes) @@ -1184,6 +1193,7 @@ func TestExternalService(t *testing.T) { ServiceID: serviceID, NodeID: genericNodeID, ServiceName: serviceName, + Cluster: serviceName, Group: "redis", }, }, @@ -1203,6 +1213,7 @@ func TestExternalService(t *testing.T) { ServiceID: serviceID, NodeID: genericNodeID, ServiceName: serviceName, + Cluster: serviceName, Group: "redis", }, }, @@ -1334,6 +1345,7 @@ func TestExternalService(t *testing.T) { ServiceID: serviceID, NodeID: genericNodeID, ServiceName: serviceName, + Cluster: serviceName, Group: "external", }, }, diff --git a/api-tests/management/action/explain_test.go b/api-tests/management/action/explain_test.go index 6dfe108329..23772f2ba0 100644 --- a/api-tests/management/action/explain_test.go +++ b/api-tests/management/action/explain_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/action/ptsummary_test.go b/api-tests/management/action/ptsummary_test.go index 92b82a252d..205a3f9ad6 100644 --- a/api-tests/management/action/ptsummary_test.go +++ b/api-tests/management/action/ptsummary_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/alerting/alerting_test.go b/api-tests/management/alerting/alerting_test.go index 0a8c0e0d41..fe5bc6d57c 100644 --- a/api-tests/management/alerting/alerting_test.go +++ b/api-tests/management/alerting/alerting_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -569,9 +569,393 @@ func assertTemplate(t *testing.T, expectedTemplate alert.Template, listTemplates assert.Equal(t, expectedTemplate.Labels, tmpl.Labels) assert.Equal(t, expectedTemplate.Annotations, tmpl.Annotations) + expectedYAML, err := alert.ToYAML([]alert.Template{expectedTemplate}) + require.NoError(t, err) + assert.Equal(t, expectedYAML, tmpl.Yaml) + assert.NotEmpty(t, tmpl.CreatedAt) } +func TestTemplatesAPI(t *testing.T) { + t.Parallel() + client := alertingClient.Default.Alerting + + templateData, err := os.ReadFile("../../testdata/ia/template.yaml") + require.NoError(t, err) + + multipleTemplatesData, err := os.ReadFile("../../testdata/ia/multiple-templates.yaml") + require.NoError(t, err) + + invalidTemplateData, err := os.ReadFile("../../testdata/ia/invalid-template.yaml") + require.NoError(t, err) + + t.Run("add", func(t *testing.T) { + t.Parallel() + + t.Run("normal", func(t *testing.T) { + t.Parallel() + + name := uuid.New().String() + expr := uuid.New().String() + alertTemplates, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, expr, "%", "s")) + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: yml, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + defer deleteTemplate(t, client, name) + + resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: alerting.ListTemplatesBody{ + Reload: true, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + assertTemplate(t, alertTemplates[0], resp.Payload.Templates) + }) + + t.Run("multiple templates at once", func(t *testing.T) { + t.Parallel() + + alertTemplates, yml := formatTemplateYaml(t, string(multipleTemplatesData)) + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: yml, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + require.Len(t, alertTemplates, 2) + t.Cleanup(func() { + deleteTemplate(t, client, alertTemplates[0].Name) + deleteTemplate(t, client, alertTemplates[1].Name) + }) + + resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: alerting.ListTemplatesBody{ + Reload: true, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + assertTemplate(t, alertTemplates[0], resp.Payload.Templates) + assertTemplate(t, alertTemplates[1], resp.Payload.Templates) + }) + + t.Run("duplicate", func(t *testing.T) { + t.Parallel() + + name := uuid.New().String() + yaml := fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%") + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: yaml, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + defer deleteTemplate(t, client, name) + + _, err = client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: yaml, + }, + Context: pmmapitests.Context, + }) + pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, fmt.Sprintf("Template with name \"%s\" already exists.", name)) + }) + + t.Run("invalid yaml", func(t *testing.T) { + t.Parallel() + + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: "not a yaml", + }, + Context: pmmapitests.Context, + }) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template") + }) + + t.Run("invalid template", func(t *testing.T) { + t.Parallel() + + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: fmt.Sprintf(string(invalidTemplateData), uuid.New().String(), uuid.New().String()), + }, + Context: pmmapitests.Context, + }) + + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template") + }) + }) + + t.Run("change", func(t *testing.T) { + t.Parallel() + + t.Run("normal", func(t *testing.T) { + t.Parallel() + + name := uuid.New().String() + expr := uuid.New().String() + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: fmt.Sprintf(string(templateData), name, expr, "s", "%"), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + defer deleteTemplate(t, client, name) + + newExpr := uuid.New().String() + alertTemplates, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, newExpr, "s", "%")) + _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ + Body: alerting.UpdateTemplateBody{ + Name: name, + Yaml: yml, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: alerting.ListTemplatesBody{ + Reload: true, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + assertTemplate(t, alertTemplates[0], resp.Payload.Templates) + }) + + t.Run("unknown template", func(t *testing.T) { + t.Parallel() + + name := uuid.New().String() + _, err := client.UpdateTemplate(&alerting.UpdateTemplateParams{ + Body: alerting.UpdateTemplateBody{ + Name: name, + Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), + }, + Context: pmmapitests.Context, + }) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf("Template with name \"%s\" not found.", name)) + }) + + t.Run("invalid yaml", func(t *testing.T) { + t.Parallel() + + name := uuid.New().String() + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + defer deleteTemplate(t, client, name) + + _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ + Body: alerting.UpdateTemplateBody{ + Name: name, + Yaml: "not a yaml", + }, + Context: pmmapitests.Context, + }) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") + }) + + t.Run("invalid template", func(t *testing.T) { + t.Parallel() + + name := uuid.New().String() + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + defer deleteTemplate(t, client, name) + + _, err = client.UpdateTemplate(&alerting.UpdateTemplateParams{ + Body: alerting.UpdateTemplateBody{ + Name: name, + Yaml: fmt.Sprintf(string(invalidTemplateData), name, uuid.New().String()), + }, + Context: pmmapitests.Context, + }) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "Failed to parse rule template.") + }) + }) + + t.Run("delete", func(t *testing.T) { + t.Parallel() + + t.Run("normal", func(t *testing.T) { + t.Parallel() + + name := uuid.New().String() + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: fmt.Sprintf(string(templateData), name, uuid.New().String(), "s", "%"), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + _, err = client.DeleteTemplate(&alerting.DeleteTemplateParams{ + Body: alerting.DeleteTemplateBody{ + Name: name, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: alerting.ListTemplatesBody{ + Reload: true, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + for _, template := range resp.Payload.Templates { + assert.NotEqual(t, name, template.Name) + } + }) + + t.Run("unknown template", func(t *testing.T) { + t.Parallel() + + name := uuid.New().String() + _, err := client.DeleteTemplate(&alerting.DeleteTemplateParams{ + Body: alerting.DeleteTemplateBody{ + Name: name, + }, + Context: pmmapitests.Context, + }) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf("Template with name \"%s\" not found.", name)) + }) + }) + + t.Run("list", func(t *testing.T) { + t.Run("without pagination", func(t *testing.T) { + name := uuid.New().String() + expr := uuid.New().String() + alertTemplates, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, expr, "%", "s")) + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: yml, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + defer deleteTemplate(t, client, name) + + resp, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: alerting.ListTemplatesBody{ + Reload: true, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + assertTemplate(t, alertTemplates[0], resp.Payload.Templates) + }) + + t.Run("with pagination", func(t *testing.T) { + const templatesCount = 5 + + templateNames := make(map[string]struct{}) + + for i := 0; i < templatesCount; i++ { + name := uuid.New().String() + expr := uuid.New().String() + _, yml := formatTemplateYaml(t, fmt.Sprintf(string(templateData), name, expr, "%", "s")) + _, err := client.CreateTemplate(&alerting.CreateTemplateParams{ + Body: alerting.CreateTemplateBody{ + Yaml: yml, + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + templateNames[name] = struct{}{} + } + defer func() { + for name := range templateNames { + deleteTemplate(t, client, name) + } + }() + + // list rules, so they are all on the first page + body := alerting.ListTemplatesBody{ + PageParams: &alerting.ListTemplatesParamsBodyPageParams{ + PageSize: 30, + Index: 0, + }, + } + listAllTemplates, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: body, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + + assert.GreaterOrEqual(t, len(listAllTemplates.Payload.Templates), templatesCount) + assert.Equal(t, int32(len(listAllTemplates.Payload.Templates)), listAllTemplates.Payload.Totals.TotalItems) + assert.Equal(t, int32(1), listAllTemplates.Payload.Totals.TotalPages) + + assertFindTemplate := func(list []*alerting.ListTemplatesOKBodyTemplatesItems0, name string) func() bool { + return func() bool { + for _, tmpl := range list { + if tmpl.Name == name { + return true + } + } + return false + } + } + + for name := range templateNames { + assert.Conditionf(t, assertFindTemplate(listAllTemplates.Payload.Templates, name), "template %s not found", name) + } + + // paginate page over page with page size 1 and check the order - it should be the same as in listAllTemplates. + // last iteration checks that there is no elements for not existing page. + for pageIndex := 0; pageIndex <= len(listAllTemplates.Payload.Templates); pageIndex++ { + body := alerting.ListTemplatesBody{ + PageParams: &alerting.ListTemplatesParamsBodyPageParams{ + PageSize: 1, + Index: int32(pageIndex), + }, + } + listOneTemplate, err := client.ListTemplates(&alerting.ListTemplatesParams{ + Body: body, Context: pmmapitests.Context, + }) + require.NoError(t, err) + + assert.Equal(t, listAllTemplates.Payload.Totals.TotalItems, listOneTemplate.Payload.Totals.TotalItems) + assert.GreaterOrEqual(t, listOneTemplate.Payload.Totals.TotalPages, int32(templatesCount)) + + if pageIndex != len(listAllTemplates.Payload.Templates) { + require.Len(t, listOneTemplate.Payload.Templates, 1) + assert.Equal(t, listAllTemplates.Payload.Templates[pageIndex].Name, listOneTemplate.Payload.Templates[0].Name) + } else { + assert.Len(t, listOneTemplate.Payload.Templates, 0) + } + } + }) + }) +} + func deleteTemplate(t *testing.T, client alerting.ClientService, name string) { t.Helper() diff --git a/api-tests/management/annotation_test.go b/api-tests/management/annotation_test.go index 062673b43c..e35272cb74 100644 --- a/api-tests/management/annotation_test.go +++ b/api-tests/management/annotation_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/backup/backups_test.go b/api-tests/management/backup/backups_test.go index 2faff86eaf..609989133d 100644 --- a/api-tests/management/backup/backups_test.go +++ b/api-tests/management/backup/backups_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/backup/locations_test.go b/api-tests/management/backup/locations_test.go index 9f82a6a48c..c80087b722 100644 --- a/api-tests/management/backup/locations_test.go +++ b/api-tests/management/backup/locations_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/dbaas/helpers.go b/api-tests/management/dbaas/helpers.go index 78591afb93..9d5fd87694 100644 --- a/api-tests/management/dbaas/helpers.go +++ b/api-tests/management/dbaas/helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/dbaas/kubernetes_server_test.go b/api-tests/management/dbaas/kubernetes_server_test.go index 17c90f2908..a6c663ab44 100644 --- a/api-tests/management/dbaas/kubernetes_server_test.go +++ b/api-tests/management/dbaas/kubernetes_server_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/dbaas/psmdb_cluster_test.go b/api-tests/management/dbaas/psmdb_cluster_test.go index 6a685ce5e5..4044fdfd36 100644 --- a/api-tests/management/dbaas/psmdb_cluster_test.go +++ b/api-tests/management/dbaas/psmdb_cluster_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/dbaas/pxc_cluster_test.go b/api-tests/management/dbaas/pxc_cluster_test.go index c9c8ab07d3..c12f3f665c 100644 --- a/api-tests/management/dbaas/pxc_cluster_test.go +++ b/api-tests/management/dbaas/pxc_cluster_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/external_test.go b/api-tests/management/external_test.go index 78dce3c34b..c044ee654b 100644 --- a/api-tests/management/external_test.go +++ b/api-tests/management/external_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -74,6 +74,7 @@ func TestAddExternal(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Group: "external", }, }, *serviceOK.Payload) @@ -225,6 +226,7 @@ func TestAddExternal(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Group: "external", }, }, *serviceOK.Payload) diff --git a/api-tests/management/haproxy_test.go b/api-tests/management/haproxy_test.go index 779891b82a..ceaa2bc147 100644 --- a/api-tests/management/haproxy_test.go +++ b/api-tests/management/haproxy_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -76,6 +76,7 @@ func TestAddHAProxy(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, }, }, *serviceOK.Payload) @@ -225,6 +226,7 @@ func TestAddHAProxy(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, }, }, *serviceOK.Payload) diff --git a/api-tests/management/helpers.go b/api-tests/management/helpers.go index c3c83ef115..9a69dd3eff 100644 --- a/api-tests/management/helpers.go +++ b/api-tests/management/helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/mongodb_test.go b/api-tests/management/mongodb_test.go index b65f317a03..75c6623fb9 100644 --- a/api-tests/management/mongodb_test.go +++ b/api-tests/management/mongodb_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -79,6 +79,7 @@ func TestAddMongoDB(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 27017, }, @@ -154,6 +155,7 @@ func TestAddMongoDB(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 27017, }, @@ -389,6 +391,7 @@ func TestAddMongoDB(t *testing.T) { ServiceID: serviceID, NodeID: newNodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 27017, }, @@ -607,6 +610,7 @@ func TestAddMongoDB(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Socket: "/tmp/mongodb-27017.sock", }, }, *serviceOK.Payload) @@ -678,6 +682,7 @@ func TestAddMongoDB(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 27017, }, @@ -750,6 +755,7 @@ func TestAddMongoDB(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 27017, }, @@ -821,6 +827,7 @@ func TestAddMongoDB(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 27017, }, diff --git a/api-tests/management/mysql_test.go b/api-tests/management/mysql_test.go index 12e6c0fe6e..5f7490183c 100644 --- a/api-tests/management/mysql_test.go +++ b/api-tests/management/mysql_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -80,6 +80,7 @@ func TestAddMySQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 3306, }, @@ -159,6 +160,7 @@ func TestAddMySQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 3306, }, @@ -413,6 +415,7 @@ func TestAddMySQL(t *testing.T) { ServiceID: serviceID, NodeID: newNodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 27017, }, @@ -666,6 +669,7 @@ func TestAddMySQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 3306, }, @@ -741,6 +745,7 @@ func TestAddMySQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 3306, }, @@ -815,6 +820,7 @@ func TestAddMySQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 3306, }, diff --git a/api-tests/management/nodes_test.go b/api-tests/management/nodes_test.go index 633f800d32..7c417fea83 100644 --- a/api-tests/management/nodes_test.go +++ b/api-tests/management/nodes_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/management/postgresql_test.go b/api-tests/management/postgresql_test.go index 4f21927b49..9e575730f2 100644 --- a/api-tests/management/postgresql_test.go +++ b/api-tests/management/postgresql_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -82,6 +82,7 @@ func TestAddPostgreSQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, DatabaseName: defaultPostgresDBName, Address: "10.10.10.10", Port: 5432, @@ -161,6 +162,7 @@ func TestAddPostgreSQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, DatabaseName: defaultPostgresDBName, Address: "10.10.10.10", Port: 5432, @@ -261,6 +263,7 @@ func TestAddPostgreSQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, DatabaseName: defaultPostgresDBName, Address: "10.10.10.10", Port: 5432, @@ -410,6 +413,7 @@ func TestAddPostgreSQL(t *testing.T) { ServiceID: serviceID, NodeID: newNodeID, ServiceName: serviceName, + Cluster: serviceName, DatabaseName: defaultPostgresDBName, Address: "10.10.10.10", Port: 27017, @@ -636,6 +640,7 @@ func TestAddPostgreSQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, DatabaseName: defaultPostgresDBName, Address: "10.10.10.10", Port: 5432, @@ -711,6 +716,7 @@ func TestAddPostgreSQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, DatabaseName: defaultPostgresDBName, Address: "10.10.10.10", Port: 5432, @@ -785,6 +791,7 @@ func TestAddPostgreSQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, DatabaseName: defaultPostgresDBName, Address: "10.10.10.10", Port: 5432, diff --git a/api-tests/management/proxysql_test.go b/api-tests/management/proxysql_test.go index 79c1e4962b..907987abe9 100644 --- a/api-tests/management/proxysql_test.go +++ b/api-tests/management/proxysql_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -80,6 +80,7 @@ func TestAddProxySQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 3306, }, @@ -155,6 +156,7 @@ func TestAddProxySQL(t *testing.T) { ServiceID: serviceID, NodeID: nodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 3306, }, @@ -260,13 +262,12 @@ func TestAddProxySQL(t *testing.T) { params := &proxysql.AddProxySQLParams{ Context: pmmapitests.Context, Body: proxysql.AddProxySQLBody{ - NodeID: nodeID, - PMMAgentID: pmmAgentID, - ServiceName: serviceName, - Address: "10.10.10.10", - Port: 3306, - Username: "username", - + NodeID: nodeID, + PMMAgentID: pmmAgentID, + ServiceName: serviceName, + Address: "10.10.10.10", + Port: 3306, + Username: "username", SkipConnectionCheck: true, }, } @@ -386,6 +387,7 @@ func TestAddProxySQL(t *testing.T) { ServiceID: serviceID, NodeID: newNodeID, ServiceName: serviceName, + Cluster: serviceName, Address: "10.10.10.10", Port: 27017, }, diff --git a/api-tests/management/rds_test.go b/api-tests/management/rds_test.go index 235726cb15..1adf167602 100644 --- a/api-tests/management/rds_test.go +++ b/api-tests/management/rds_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/pmm-api-tests-output.txt b/api-tests/pmm-api-tests-output.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/api-tests/server/advisor_metrics_test.go b/api-tests/server/advisor_metrics_test.go index 7d590da340..bbbb37a843 100644 --- a/api-tests/server/advisor_metrics_test.go +++ b/api-tests/server/advisor_metrics_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/advisors_test.go b/api-tests/server/advisors_test.go index 44ad3676bf..d8ca14e3a9 100644 --- a/api-tests/server/advisors_test.go +++ b/api-tests/server/advisors_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/alertmanager_test.go b/api-tests/server/alertmanager_test.go index 3b31f745a6..1a2ecadab2 100644 --- a/api-tests/server/alertmanager_test.go +++ b/api-tests/server/alertmanager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/auth_test.go b/api-tests/server/auth_test.go index f58a205190..99158daac5 100644 --- a/api-tests/server/auth_test.go +++ b/api-tests/server/auth_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/helpers.go b/api-tests/server/helpers.go index a51bab6fcf..c073820595 100644 --- a/api-tests/server/helpers.go +++ b/api-tests/server/helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/logs_test.go b/api-tests/server/logs_test.go index d0ae29faa7..5c4585836c 100644 --- a/api-tests/server/logs_test.go +++ b/api-tests/server/logs_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/panics_test.go b/api-tests/server/panics_test.go index 216a0645e7..b2c565366b 100644 --- a/api-tests/server/panics_test.go +++ b/api-tests/server/panics_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/platform_test.go b/api-tests/server/platform_test.go index 2852f8947b..4f8670156b 100644 --- a/api-tests/server/platform_test.go +++ b/api-tests/server/platform_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/readyz_test.go b/api-tests/server/readyz_test.go index 093ea8c57e..25a05f13ad 100644 --- a/api-tests/server/readyz_test.go +++ b/api-tests/server/readyz_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/settings_test.go b/api-tests/server/settings_test.go index ffdd65bf92..6d227a11ff 100644 --- a/api-tests/server/settings_test.go +++ b/api-tests/server/settings_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/updates_test.go b/api-tests/server/updates_test.go index 560408eb24..f4b8c68336 100644 --- a/api-tests/server/updates_test.go +++ b/api-tests/server/updates_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/server/version_test.go b/api-tests/server/version_test.go index 0332c31c30..3ac20024b2 100644 --- a/api-tests/server/version_test.go +++ b/api-tests/server/version_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api-tests/testdata/alerting/multiple-templates.yaml b/api-tests/testdata/alerting/multiple-templates.yaml new file mode 100644 index 0000000000..c2dcec7554 --- /dev/null +++ b/api-tests/testdata/alerting/multiple-templates.yaml @@ -0,0 +1,49 @@ +--- +templates: + - name: test_template_1 + version: 1 + summary: Test summary 1 + tiers: [ anonymous, registered ] + expr: "test expression" + params: + - name: param1 + summary: first parameter with default value and defined range + unit: s + type: float + range: [ 0, 100 ] + value: 80 + - name: param2 + summary: second parameter without default value and defined range + unit: s + type: float + for: 300s + severity: warning + labels: + foo: bar + annotations: + description: test description + summary: test summary + + - name: test_template_2 + version: 1 + summary: Test summary 2 + tiers: [ anonymous, registered ] + expr: "test expression" + params: + - name: param1 + summary: first parameter with default value and defined range + unit: s + type: float + range: [ 0, 100 ] + value: 80 + - name: param2 + summary: second parameter without default value and defined range + unit: s + type: float + for: 300s + severity: warning + labels: + foo: bar + annotations: + description: test description + summary: test summary diff --git a/api-tests/tools/tools.go b/api-tests/tools/tools.go index 4da6391791..91e91b75dc 100644 --- a/api-tests/tools/tools.go +++ b/api-tests/tools/tools.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api/agentpb/agent.go b/api/agentpb/agent.go index b866f40fe9..74cc4969e1 100644 --- a/api/agentpb/agent.go +++ b/api/agentpb/agent.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -198,7 +198,7 @@ func (m *AgentLogsRequest) ServerMessageRequestPayload() isServerMessage_Payload return &ServerMessage_AgentLogs{AgentLogs: m} } -// in alphabetical order +// in alphabetical order. func (*ActionResultRequest) sealed() {} func (*ActionResultResponse) sealed() {} func (*CheckConnectionRequest) sealed() {} @@ -230,7 +230,7 @@ func (*GetVersionsResponse) sealed() {} func (*PBMSwitchPITRRequest) sealed() {} func (*PBMSwitchPITRResponse) sealed() {} -// check interfaces +// check interfaces. var ( // A list of AgentMessage request payloads. _ AgentRequestPayload = (*Ping)(nil) diff --git a/api/agentpb/agent.pb.go b/api/agentpb/agent.pb.go index f06a953aa9..81d6fde6bb 100644 --- a/api/agentpb/agent.pb.go +++ b/api/agentpb/agent.pb.go @@ -3637,6 +3637,7 @@ type StartActionRequest_MySQLExplainParams struct { Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` Values []string `protobuf:"bytes,6,rep,name=values,proto3" json:"values,omitempty"` + Schema string `protobuf:"bytes,7,opt,name=schema,proto3" json:"schema,omitempty"` OutputFormat MysqlExplainOutputFormat `protobuf:"varint,3,opt,name=output_format,json=outputFormat,proto3,enum=agent.MysqlExplainOutputFormat" json:"output_format,omitempty"` // Contains files and their contents which can be used in DSN. TlsFiles *TextFiles `protobuf:"bytes,4,opt,name=tls_files,json=tlsFiles,proto3" json:"tls_files,omitempty"` @@ -3697,6 +3698,13 @@ func (x *StartActionRequest_MySQLExplainParams) GetValues() []string { return nil } +func (x *StartActionRequest_MySQLExplainParams) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + func (x *StartActionRequest_MySQLExplainParams) GetOutputFormat() MysqlExplainOutputFormat { if x != nil { return x.OutputFormat @@ -6726,8 +6734,8 @@ var file_agentpb_agent_proto_rawDesc = []byte{ 0x72, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x12, 0x29, 0x0a, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x52, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x22, 0xe9, - 0x2a, 0x0a, 0x12, 0x53, 0x74, 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x52, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x22, 0x81, + 0x2b, 0x0a, 0x12, 0x53, 0x74, 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x60, 0x0a, 0x14, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x65, 0x78, 0x70, 0x6c, @@ -6889,63 +6897,35 @@ var file_agentpb_agent_proto_rawDesc = []byte{ 0x72, 0x61, 0x6d, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x09, 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, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0xf1, 0x01, 0x0a, 0x12, 0x4d, 0x79, + 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x89, 0x02, 0x0a, 0x12, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x12, 0x44, 0x0a, 0x0d, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, - 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x0c, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, - 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, - 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, - 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, - 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x9b, 0x01, - 0x0a, 0x1a, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x68, 0x6f, 0x77, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, - 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, - 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, - 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, - 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x9b, 0x01, 0x0a, 0x1a, - 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x68, 0x6f, 0x77, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, - 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, - 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, - 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x95, 0x01, 0x0a, 0x14, 0x4d, 0x79, - 0x53, 0x51, 0x4c, 0x53, 0x68, 0x6f, 0x77, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, - 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, - 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, - 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x79, 0x1a, 0xa0, 0x01, 0x0a, 0x1f, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, - 0x53, 0x68, 0x6f, 0x77, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2d, 0x0a, - 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, - 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, - 0x72, 0x69, 0x66, 0x79, 0x1a, 0x9a, 0x01, 0x0a, 0x19, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, - 0x53, 0x51, 0x4c, 0x53, 0x68, 0x6f, 0x77, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x50, 0x61, 0x72, 0x61, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x44, 0x0a, 0x0d, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1f, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x45, 0x78, 0x70, + 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x52, 0x0c, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x2d, + 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, + 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, + 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x9b, 0x01, 0x0a, 0x1a, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x53, + 0x68, 0x6f, 0x77, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x09, + 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, + 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, + 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x1a, 0x9b, 0x01, 0x0a, 0x1a, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x68, 0x6f, + 0x77, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, @@ -6954,601 +6934,630 @@ var file_agentpb_agent_proto_rawDesc = []byte{ 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x79, 0x1a, 0x6f, 0x0a, 0x14, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x45, 0x78, 0x70, 0x6c, - 0x61, 0x69, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, + 0x79, 0x1a, 0x95, 0x01, 0x0a, 0x14, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x68, 0x6f, 0x77, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, - 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x73, 0x1a, 0x11, 0x0a, 0x0f, 0x50, 0x54, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x73, 0x0a, 0x11, 0x50, 0x54, 0x50, 0x67, 0x53, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, - 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x78, 0x0a, 0x16, 0x50, 0x54, - 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, - 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x8e, 0x01, 0x0a, 0x14, 0x50, 0x54, 0x4d, 0x79, 0x53, 0x51, 0x4c, - 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, - 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x95, 0x01, 0x0a, 0x14, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, - 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, - 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, - 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, - 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, - 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, - 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x97, 0x01, - 0x0a, 0x16, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, - 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, - 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, - 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x84, 0x01, 0x0a, 0x19, 0x50, 0x6f, 0x73, 0x74, - 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, - 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, - 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x9c, - 0x01, 0x0a, 0x1b, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, - 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, - 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, - 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, - 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, - 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, - 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x63, 0x0a, - 0x1e, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, - 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, - 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x73, 0x1a, 0x60, 0x0a, 0x1b, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, - 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, - 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x65, 0x0a, 0x20, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6d, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x4f, 0x70, - 0x74, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, - 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, - 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x67, 0x0a, 0x22, 0x4d, - 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x53, - 0x65, 0x74, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, + 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, + 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0xa0, 0x01, 0x0a, 0x1f, 0x50, 0x6f, + 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x53, 0x68, 0x6f, 0x77, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, + 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, + 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, + 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, + 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x9a, 0x01, 0x0a, + 0x19, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x53, 0x68, 0x6f, 0x77, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, + 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, + 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, + 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x6f, 0x0a, 0x14, 0x4d, 0x6f, 0x6e, + 0x67, 0x6f, 0x44, 0x42, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, - 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, - 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x68, 0x0a, 0x23, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, - 0x63, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, - 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, - 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, + 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, + 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x11, 0x0a, 0x0f, 0x50, 0x54, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x73, 0x0a, + 0x11, 0x50, 0x54, 0x50, 0x67, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x1a, 0x78, 0x0a, 0x16, 0x50, 0x54, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, + 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x8e, 0x01, 0x0a, + 0x14, 0x50, 0x54, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x95, 0x01, + 0x0a, 0x14, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2d, + 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, - 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0xcf, - 0x01, 0x0a, 0x1a, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x69, 0x0a, - 0x0e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x42, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x46, 0x0a, 0x0d, 0x53, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x59, 0x53, - 0x54, 0x45, 0x4d, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, - 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x4f, 0x4e, 0x47, 0x4f, 0x44, 0x10, - 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x42, 0x4d, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x10, 0x02, - 0x42, 0x08, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x30, 0x0a, 0x11, 0x53, 0x74, 0x6f, 0x70, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x70, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x74, 0x0a, 0x13, 0x41, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, - 0x16, 0x0a, 0x14, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x73, 0x0a, 0x14, 0x50, 0x42, 0x4d, 0x53, 0x77, - 0x69, 0x74, 0x63, 0x68, 0x50, 0x49, 0x54, 0x52, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, - 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, - 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x2d, 0x0a, 0x15, - 0x50, 0x42, 0x4d, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x50, 0x49, 0x54, 0x52, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x43, 0x0a, 0x10, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x22, 0x67, 0x0a, 0x11, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x3e, 0x0a, 0x1c, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x69, - 0x6e, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x18, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4c, 0x6f, 0x67, 0x4c, - 0x69, 0x6e, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xe4, 0x01, 0x0a, 0x16, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, - 0x73, 0x6e, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 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, 0x07, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, - 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, - 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, - 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, - 0x22, 0x95, 0x01, 0x0a, 0x17, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x3a, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x1a, 0x28, - 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x29, 0x0a, 0x10, 0x4a, 0x6f, 0x62, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, - 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, - 0x62, 0x49, 0x64, 0x22, 0x29, 0x0a, 0x11, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x76, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x22, 0xb2, - 0x01, 0x0a, 0x10, 0x53, 0x33, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x1d, - 0x0a, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, - 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x67, - 0x69, 0x6f, 0x6e, 0x22, 0x2e, 0x0a, 0x18, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x22, 0xc3, 0x0f, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x33, - 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 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, 0x07, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x12, 0x47, 0x0a, 0x0c, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x62, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, - 0x0b, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x5d, 0x0a, 0x14, - 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x62, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x12, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x52, 0x65, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x4d, 0x0a, 0x0e, 0x6d, - 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x6f, 0x6e, 0x67, - 0x6f, 0x44, 0x42, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0d, 0x6d, 0x6f, 0x6e, - 0x67, 0x6f, 0x64, 0x62, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x63, 0x0a, 0x16, 0x6d, 0x6f, - 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x62, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x14, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, - 0x64, 0x62, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x1a, - 0x93, 0x02, 0x0a, 0x0b, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, - 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, - 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x33, 0x5f, + 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, + 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x97, 0x01, 0x0a, 0x16, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, + 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, + 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, + 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, + 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, + 0x84, 0x01, 0x0a, 0x19, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, + 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, + 0x2d, 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, + 0x69, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, + 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x9c, 0x01, 0x0a, 0x1b, 0x50, 0x6f, 0x73, 0x74, 0x67, + 0x72, 0x65, 0x53, 0x51, 0x4c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2d, + 0x0a, 0x09, 0x74, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, + 0x6c, 0x65, 0x73, 0x52, 0x08, 0x74, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, + 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x1a, 0x63, 0x0a, 0x1e, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, + 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, + 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x60, 0x0a, 0x1b, 0x4d, 0x6f, + 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, + 0x6e, 0x66, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, + 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, + 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x65, 0x0a, 0x20, + 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, + 0x6d, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x4f, 0x70, 0x74, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, + 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, + 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, + 0x6c, 0x65, 0x73, 0x1a, 0x67, 0x0a, 0x22, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x53, 0x65, 0x74, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, + 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, + 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x68, 0x0a, 0x23, + 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x44, + 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, + 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, + 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0xcf, 0x01, 0x0a, 0x1a, 0x52, 0x65, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x69, 0x0a, 0x0e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x42, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x0d, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x22, 0x46, 0x0a, 0x0d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x53, 0x45, 0x52, 0x56, + 0x49, 0x43, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, + 0x06, 0x4d, 0x4f, 0x4e, 0x47, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x42, 0x4d, + 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x42, 0x08, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x0a, 0x11, 0x53, 0x74, 0x6f, + 0x70, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x53, + 0x74, 0x6f, 0x70, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x74, 0x0a, 0x13, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x16, 0x0a, 0x14, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x73, 0x0a, 0x14, 0x50, 0x42, 0x4d, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x50, 0x49, 0x54, 0x52, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, + 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, + 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x22, 0x2d, 0x0a, 0x15, 0x50, 0x42, 0x4d, 0x53, 0x77, 0x69, 0x74, 0x63, + 0x68, 0x50, 0x49, 0x54, 0x52, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x22, 0x43, 0x0a, 0x10, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x67, 0x0a, 0x11, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, + 0x73, 0x12, 0x3e, 0x0a, 0x1c, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x18, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x4c, 0x6f, 0x67, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x22, 0xe4, 0x01, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 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, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, + 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, + 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, + 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x53, 0x6b, + 0x69, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x22, 0x95, 0x01, 0x0a, 0x17, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3a, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x1a, 0x28, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, + 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0x29, 0x0a, 0x10, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x29, 0x0a, 0x11, 0x4a, + 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x22, 0xb2, 0x01, 0x0a, 0x10, 0x53, 0x33, 0x4c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x22, 0x2e, 0x0a, 0x18, 0x46, + 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xc3, 0x0f, 0x0a, 0x0f, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 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, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x47, 0x0a, 0x0c, 0x6d, + 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4a, + 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x42, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x12, 0x5d, 0x0a, 0x14, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, + 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, + 0x12, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x12, 0x4d, 0x0a, 0x0e, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x62, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x42, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x48, 0x00, 0x52, 0x0d, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x12, 0x63, 0x0a, 0x16, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x72, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, + 0x44, 0x42, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, + 0x00, 0x52, 0x14, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x93, 0x02, 0x0a, 0x0b, 0x4d, 0x79, 0x53, 0x51, + 0x4c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x33, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x33, 0x4c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, + 0x08, 0x73, 0x33, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, + 0x64, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, + 0x72, 0x42, 0x11, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, 0x52, 0x11, 0x66, 0x69, 0x6c, 0x65, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0xc3, 0x01, + 0x0a, 0x12, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x33, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x53, 0x33, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x08, 0x73, 0x33, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x11, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, + 0x52, 0x11, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x1a, 0xf9, 0x03, 0x0a, 0x0d, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x16, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, + 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x02, 0x18, 0x01, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, + 0x18, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x04, 0x70, + 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x70, + 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x69, + 0x74, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x50, 0x69, 0x74, 0x72, 0x12, 0x33, 0x0a, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x09, + 0x64, 0x61, 0x74, 0x61, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x33, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x33, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x08, 0x73, 0x33, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x11, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x04, 0x08, 0x0b, - 0x10, 0x0c, 0x52, 0x11, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0xc3, 0x01, 0x0a, 0x12, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, - 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x1d, 0x0a, 0x0a, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x36, 0x0a, 0x09, 0x73, 0x33, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x33, 0x4c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x08, 0x73, - 0x33, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, - 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x42, - 0x11, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, 0x52, 0x11, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, - 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0xf9, 0x03, 0x0a, 0x0d, - 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x16, 0x0a, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x08, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x06, 0x73, - 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, - 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x69, 0x74, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x69, 0x74, 0x72, 0x12, 0x33, 0x0a, 0x0a, - 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x14, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, - 0x61, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x09, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x6f, 0x64, 0x65, - 0x6c, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x33, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x33, 0x4c, + 0x67, 0x12, 0x4e, 0x0a, 0x11, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, - 0x08, 0x73, 0x33, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4e, 0x0a, 0x11, 0x66, 0x69, 0x6c, - 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, - 0x64, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, - 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, - 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, - 0x69, 0x6c, 0x65, 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0xa8, 0x04, 0x0a, 0x14, 0x4d, 0x6f, 0x6e, 0x67, - 0x6f, 0x44, 0x42, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x12, 0x16, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, - 0x18, 0x01, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x08, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, - 0x0a, 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, - 0x18, 0x01, 0x52, 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x41, - 0x0a, 0x0e, 0x70, 0x69, 0x74, 0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 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, 0x0d, 0x70, 0x69, 0x74, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x33, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x33, 0x4c, + 0x10, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, + 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, + 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x42, 0x11, 0x0a, 0x0f, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, + 0xa8, 0x04, 0x0a, 0x14, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x52, 0x65, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x16, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x12, 0x1e, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x12, 0x1c, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, + 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x02, 0x18, 0x01, + 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x06, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x73, 0x6f, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x70, 0x69, 0x74, 0x72, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 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, 0x0d, 0x70, 0x69, 0x74, 0x72, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x33, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x33, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x08, 0x73, 0x33, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x4e, 0x0a, 0x11, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, - 0x08, 0x73, 0x33, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4e, 0x0a, 0x11, 0x66, 0x69, 0x6c, - 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, - 0x64, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, - 0x72, 0x12, 0x39, 0x0a, 0x0c, 0x70, 0x62, 0x6d, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x62, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, - 0x0b, 0x70, 0x62, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, - 0x64, 0x73, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2f, - 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, - 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x42, - 0x11, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x42, 0x05, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x22, 0x28, 0x0a, 0x10, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x22, 0x27, 0x0a, 0x0e, 0x53, 0x74, 0x6f, 0x70, 0x4a, 0x6f, 0x62, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x11, 0x0a, 0x0f, - 0x53, 0x74, 0x6f, 0x70, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0xdb, 0x05, 0x0a, 0x09, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x15, 0x0a, - 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, - 0x6f, 0x62, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 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, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2e, - 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x41, - 0x0a, 0x0c, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x75, - 0x70, 0x12, 0x57, 0x0a, 0x14, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x12, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x47, 0x0a, 0x0e, 0x6d, 0x6f, - 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x48, 0x00, 0x52, 0x0d, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x42, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x12, 0x5d, 0x0a, 0x16, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x72, - 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x52, 0x65, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x14, 0x6d, 0x6f, - 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x1a, 0x21, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x6e, 0x0a, 0x0d, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, - 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x61, - 0x72, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x10, 0x69, 0x73, 0x53, 0x68, 0x61, 0x72, 0x64, 0x65, 0x64, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x3e, 0x0a, 0x0b, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x42, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2f, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x14, 0x0a, 0x12, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x16, 0x0a, 0x14, 0x4d, - 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xa7, 0x03, - 0x0a, 0x0b, 0x4a, 0x6f, 0x62, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x15, 0x0a, + 0x10, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x0c, 0x70, 0x62, 0x6d, + 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x62, 0x6d, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x70, 0x62, 0x6d, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, + 0x69, 0x6c, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x09, 0x74, 0x65, + 0x78, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x05, 0x0a, 0x03, 0x6a, 0x6f, + 0x62, 0x22, 0x28, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x27, 0x0a, 0x0e, 0x53, + 0x74, 0x6f, 0x70, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, - 0x6f, 0x62, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 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, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x43, - 0x0a, 0x0c, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, - 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x42, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x42, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x12, 0x59, 0x0a, 0x14, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x12, 0x6d, 0x79, 0x73, 0x71, - 0x6c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2d, - 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, + 0x6f, 0x62, 0x49, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x4a, 0x6f, 0x62, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdb, 0x05, 0x0a, 0x09, 0x4a, 0x6f, 0x62, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 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, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2e, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, + 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x0c, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, + 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4d, + 0x79, 0x53, 0x51, 0x4c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x79, + 0x73, 0x71, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x57, 0x0a, 0x14, 0x6d, 0x79, 0x73, + 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, + 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, + 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x12, + 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x12, 0x47, 0x0a, 0x0e, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x6f, 0x6e, + 0x67, 0x6f, 0x44, 0x42, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0d, 0x6d, 0x6f, + 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x5d, 0x0a, 0x16, 0x6d, + 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x62, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x6f, + 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x48, 0x00, 0x52, 0x14, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x52, 0x65, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x21, 0x0a, 0x05, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x6e, 0x0a, + 0x0d, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2c, + 0x0a, 0x12, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x73, 0x53, 0x68, + 0x61, 0x72, 0x64, 0x65, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x3e, 0x0a, + 0x0b, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2f, 0x0a, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x14, 0x0a, + 0x12, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x1a, 0x16, 0x0a, 0x14, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x52, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x42, 0x08, 0x0a, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xa7, 0x03, 0x0a, 0x0b, 0x4a, 0x6f, 0x62, 0x50, 0x72, 0x6f, + 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 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, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x43, 0x0a, 0x0c, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, + 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, - 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x48, 0x00, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x1a, 0x0d, 0x0a, - 0x0b, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x14, 0x0a, 0x12, - 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x1a, 0x49, 0x0a, 0x04, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, - 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x63, 0x68, - 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x42, 0x08, 0x0a, - 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x9d, 0x04, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, - 0x0a, 0x09, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x66, - 0x74, 0x77, 0x61, 0x72, 0x65, 0x52, 0x09, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x73, - 0x1a, 0x08, 0x0a, 0x06, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x64, 0x1a, 0x0c, 0x0a, 0x0a, 0x58, 0x74, - 0x72, 0x61, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x09, 0x0a, 0x07, 0x58, 0x62, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x1a, 0x08, 0x0a, 0x06, 0x51, 0x70, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x09, 0x0a, - 0x07, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x1a, 0x05, 0x0a, 0x03, 0x50, 0x42, 0x4d, 0x1a, - 0x85, 0x03, 0x0a, 0x08, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x12, 0x3a, 0x0a, 0x06, - 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x64, 0x48, 0x00, - 0x52, 0x06, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x64, 0x12, 0x46, 0x0a, 0x0a, 0x78, 0x74, 0x72, 0x61, - 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x58, 0x74, 0x72, 0x61, 0x62, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x48, 0x00, 0x52, 0x0a, 0x78, 0x74, 0x72, 0x61, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x12, 0x3d, 0x0a, 0x07, 0x78, 0x62, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x58, 0x62, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x48, 0x00, 0x52, 0x07, 0x78, 0x62, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x12, - 0x3a, 0x0a, 0x06, 0x71, 0x70, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x51, 0x70, 0x72, 0x65, 0x73, - 0x73, 0x48, 0x00, 0x52, 0x06, 0x71, 0x70, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x06, 0x6d, - 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x48, 0x00, - 0x52, 0x06, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x12, 0x31, 0x0a, 0x03, 0x70, 0x62, 0x6d, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, - 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x50, 0x42, 0x4d, 0x48, 0x00, 0x52, 0x03, 0x70, 0x62, 0x6d, 0x42, 0x0a, 0x0a, 0x08, 0x73, - 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x22, 0x90, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3e, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, - 0x39, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xbb, 0x08, 0x0a, 0x0c, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0xff, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x50, - 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x41, 0x0a, 0x0d, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, 0x3b, - 0x0a, 0x0b, 0x71, 0x61, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x51, 0x41, 0x4e, 0x43, - 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x0a, 0x71, 0x61, 0x6e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x31, - 0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x09, 0x6a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x12, 0x37, 0x0a, 0x0c, 0x6a, 0x6f, 0x62, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, - 0x4a, 0x6f, 0x62, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x6a, - 0x6f, 0x62, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x04, 0x70, 0x6f, - 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x36, 0x0a, - 0x09, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x73, 0x65, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x0b, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x70, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, - 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, - 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, - 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x33, 0x0a, 0x08, 0x73, 0x74, 0x6f, - 0x70, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x70, 0x4a, 0x6f, 0x62, 0x12, 0x39, - 0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0f, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x09, - 0x6a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x67, 0x65, 0x74, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x67, - 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x0f, 0x70, 0x62, - 0x6d, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x69, 0x74, 0x72, 0x18, 0x13, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x42, 0x4d, 0x53, - 0x77, 0x69, 0x74, 0x63, 0x68, 0x50, 0x49, 0x54, 0x52, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x62, 0x6d, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x50, 0x69, - 0x74, 0x72, 0x12, 0x39, 0x0a, 0x0a, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x73, - 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x48, 0x00, 0x52, 0x09, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x42, 0x09, 0x0a, - 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xc9, 0x07, 0x0a, 0x0d, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0xff, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x6f, - 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x42, 0x0a, 0x0d, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, - 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, 0x3c, - 0x0a, 0x0b, 0x71, 0x61, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x51, 0x41, 0x4e, 0x43, - 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, - 0x52, 0x0a, 0x71, 0x61, 0x6e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x42, 0x0a, 0x0d, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x48, 0x00, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x12, 0x21, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0b, + 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x59, 0x0a, 0x14, 0x6d, + 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x62, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x4d, 0x79, + 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x48, 0x00, 0x52, 0x12, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2d, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x14, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, + 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x48, 0x00, 0x52, + 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x1a, 0x0d, 0x0a, 0x0b, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x42, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x14, 0x0a, 0x12, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x49, 0x0a, 0x04, 0x4c, 0x6f, + 0x67, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, + 0x9d, 0x04, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x09, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, + 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x52, 0x09, 0x73, + 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x73, 0x1a, 0x08, 0x0a, 0x06, 0x4d, 0x79, 0x53, 0x51, + 0x4c, 0x64, 0x1a, 0x0c, 0x0a, 0x0a, 0x58, 0x74, 0x72, 0x61, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x1a, 0x09, 0x0a, 0x07, 0x58, 0x62, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x1a, 0x08, 0x0a, 0x06, 0x51, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x09, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, + 0x1a, 0x05, 0x0a, 0x03, 0x50, 0x42, 0x4d, 0x1a, 0x85, 0x03, 0x0a, 0x08, 0x53, 0x6f, 0x66, 0x74, + 0x77, 0x61, 0x72, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x64, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x64, + 0x12, 0x46, 0x0a, 0x0a, 0x78, 0x74, 0x72, 0x61, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x58, 0x74, 0x72, 0x61, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0a, 0x78, 0x74, + 0x72, 0x61, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x3d, 0x0a, 0x07, 0x78, 0x62, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x58, 0x62, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x48, 0x00, 0x52, 0x07, + 0x78, 0x62, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x12, 0x3a, 0x0a, 0x06, 0x71, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, + 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x51, 0x70, 0x72, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, 0x71, 0x70, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x06, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, + 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, + 0x12, 0x31, 0x0a, 0x03, 0x70, 0x62, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x42, 0x4d, 0x48, 0x00, 0x52, 0x03, + 0x70, 0x62, 0x6d, 0x42, 0x0a, 0x0a, 0x08, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x22, + 0x90, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x39, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x22, 0xbb, 0x08, 0x0a, 0x0c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0xff, 0x0f, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, + 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x21, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, - 0x69, 0x6e, 0x67, 0x12, 0x35, 0x0a, 0x09, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, - 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x08, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0b, 0x73, 0x74, - 0x6f, 0x70, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x41, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x74, 0x6f, - 0x70, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, - 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x48, 0x00, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, - 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x32, 0x0a, 0x08, 0x73, 0x74, - 0x6f, 0x70, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x70, 0x4a, 0x6f, 0x62, 0x12, 0x38, - 0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0f, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x6a, - 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3e, 0x0a, 0x0c, 0x67, 0x65, 0x74, 0x5f, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x67, 0x65, 0x74, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x45, 0x0a, 0x0f, 0x70, 0x62, 0x6d, 0x5f, - 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x69, 0x74, 0x72, 0x18, 0x11, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x42, 0x4d, 0x53, 0x77, 0x69, - 0x74, 0x63, 0x68, 0x50, 0x49, 0x54, 0x52, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x0d, 0x70, 0x62, 0x6d, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x50, 0x69, 0x74, 0x72, 0x12, - 0x38, 0x0a, 0x0a, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x13, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0xc4, 0x01, 0x0a, 0x18, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x45, 0x78, - 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x12, 0x27, 0x0a, 0x23, 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x5f, 0x45, 0x58, 0x50, 0x4c, 0x41, - 0x49, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, - 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x27, 0x0a, 0x23, 0x4d, 0x59, - 0x53, 0x51, 0x4c, 0x5f, 0x45, 0x58, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x50, - 0x55, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, - 0x54, 0x10, 0x01, 0x12, 0x24, 0x0a, 0x20, 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x5f, 0x45, 0x58, 0x50, - 0x4c, 0x41, 0x49, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, - 0x41, 0x54, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x30, 0x0a, 0x2c, 0x4d, 0x59, 0x53, + 0x69, 0x6e, 0x67, 0x12, 0x41, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x71, 0x61, 0x6e, 0x5f, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x51, 0x41, 0x4e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x71, 0x61, 0x6e, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x31, 0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x09, + 0x6a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x0a, 0x0c, 0x6a, 0x6f, 0x62, + 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x50, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x6a, 0x6f, 0x62, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x21, 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x48, 0x00, 0x52, + 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x2e, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x48, 0x00, 0x52, 0x08, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3f, 0x0a, + 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, + 0x00, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, + 0x0a, 0x0b, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x70, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, + 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x70, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, 0x10, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x43, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, + 0x62, 0x12, 0x33, 0x0a, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x70, + 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x07, 0x73, + 0x74, 0x6f, 0x70, 0x4a, 0x6f, 0x62, 0x12, 0x39, 0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x67, 0x65, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, + 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x67, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x0f, 0x70, 0x62, 0x6d, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, + 0x5f, 0x70, 0x69, 0x74, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x42, 0x4d, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x50, 0x49, 0x54, + 0x52, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x62, 0x6d, + 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x50, 0x69, 0x74, 0x72, 0x12, 0x39, 0x0a, 0x0a, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x09, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x22, 0xc9, 0x07, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0xff, 0x0f, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x21, 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, + 0x6e, 0x67, 0x12, 0x42, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x0b, 0x71, 0x61, 0x6e, 0x5f, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x51, 0x41, 0x4e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x71, 0x61, 0x6e, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x12, 0x42, 0x0a, 0x0d, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x50, + 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x35, 0x0a, 0x09, 0x73, + 0x65, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0b, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, + 0x53, 0x74, 0x6f, 0x70, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x70, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x4a, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x09, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4a, + 0x6f, 0x62, 0x12, 0x32, 0x0a, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x6f, + 0x70, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, + 0x74, 0x6f, 0x70, 0x4a, 0x6f, 0x62, 0x12, 0x38, 0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x6a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x3e, 0x0a, 0x0c, 0x67, 0x65, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, + 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x00, 0x52, 0x0b, 0x67, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x45, 0x0a, 0x0f, 0x70, 0x62, 0x6d, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x5f, 0x70, + 0x69, 0x74, 0x72, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x50, 0x42, 0x4d, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x50, 0x49, 0x54, 0x52, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x62, 0x6d, 0x53, 0x77, 0x69, + 0x74, 0x63, 0x68, 0x50, 0x69, 0x74, 0x72, 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, + 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0xc4, 0x01, 0x0a, + 0x18, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x27, 0x0a, 0x23, 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x5f, 0x45, 0x58, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x50, 0x55, - 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x54, 0x52, 0x41, 0x44, 0x49, 0x54, 0x49, - 0x4f, 0x4e, 0x41, 0x4c, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x03, 0x32, 0x41, 0x0a, 0x05, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, - 0x13, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x1a, 0x14, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x6f, - 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x0a, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, - 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, - 0x41, 0x58, 0x58, 0xaa, 0x02, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0xca, 0x02, 0x05, 0x41, 0x67, - 0x65, 0x6e, 0x74, 0xe2, 0x02, 0x11, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x10, 0x00, 0x12, 0x27, 0x0a, 0x23, 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x5f, 0x45, 0x58, 0x50, 0x4c, + 0x41, 0x49, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, + 0x54, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12, 0x24, 0x0a, 0x20, 0x4d, + 0x59, 0x53, 0x51, 0x4c, 0x5f, 0x45, 0x58, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x5f, 0x4f, 0x55, 0x54, + 0x50, 0x55, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x10, + 0x02, 0x12, 0x30, 0x0a, 0x2c, 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x5f, 0x45, 0x58, 0x50, 0x4c, 0x41, + 0x49, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, + 0x5f, 0x54, 0x52, 0x41, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x5f, 0x4a, 0x53, 0x4f, + 0x4e, 0x10, 0x03, 0x32, 0x41, 0x0a, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x07, + 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x13, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x14, 0x2e, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x6f, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x42, 0x0a, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, + 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x05, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0xca, 0x02, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0xe2, 0x02, 0x11, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/agentpb/agent.pb.validate.go b/api/agentpb/agent.pb.validate.go index a3bf0afae2..75971959e9 100644 --- a/api/agentpb/agent.pb.validate.go +++ b/api/agentpb/agent.pb.validate.go @@ -8041,6 +8041,8 @@ func (m *StartActionRequest_MySQLExplainParams) validate(all bool) error { // no validation rules for Query + // no validation rules for Schema + // no validation rules for OutputFormat if all { diff --git a/api/agentpb/agent.proto b/api/agentpb/agent.proto index 6aafb4a4ed..737640c198 100644 --- a/api/agentpb/agent.proto +++ b/api/agentpb/agent.proto @@ -157,6 +157,7 @@ message StartActionRequest { string dsn = 1; string query = 2; repeated string values = 6; + string schema = 7; MysqlExplainOutputFormat output_format = 3; // Contains files and their contents which can be used in DSN. TextFiles tls_files = 4; diff --git a/api/agentpb/metadata.go b/api/agentpb/metadata.go index 895a5d289f..0b456db85a 100644 --- a/api/agentpb/metadata.go +++ b/api/agentpb/metadata.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api/agentpb/query.go b/api/agentpb/query.go index 44d27edae6..069f020745 100644 --- a/api/agentpb/query.go +++ b/api/agentpb/query.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api/agentpb/query_test.go b/api/agentpb/query_test.go index a7c3f573e2..faaec610b9 100644 --- a/api/agentpb/query_test.go +++ b/api/agentpb/query_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api/inventorypb/agents.go b/api/inventorypb/agents.go index 7d1f103dbb..578b3f389c 100644 --- a/api/inventorypb/agents.go +++ b/api/inventorypb/agents.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -22,7 +22,7 @@ type Agent interface { sealedAgent() } -// Ordered the same as AgentType enum +// Ordered the same as AgentType enum. func (*PMMAgent) sealedAgent() {} func (*VMAgent) sealedAgent() {} diff --git a/api/inventorypb/agents_test.go b/api/inventorypb/agents_test.go index c331e999df..f8f6e46248 100644 --- a/api/inventorypb/agents_test.go +++ b/api/inventorypb/agents_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -28,7 +28,7 @@ import ( // names is up to date with the types defined in AgentType_name by the proto definition // by calling the AgentTypeName function using the values from protobuf and it expects the // result is a non-empty string, meaning that the AgentTypeNames list matches the proto -// definitions +// definitions. func TestAgentTypes(t *testing.T) { for _, val := range AgentType_name { if strings.HasSuffix(val, "INVALID") { diff --git a/api/inventorypb/json/client/nodes/add_node_parameters.go b/api/inventorypb/json/client/nodes/add_node_parameters.go new file mode 100644 index 0000000000..eb3fa2c34d --- /dev/null +++ b/api/inventorypb/json/client/nodes/add_node_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewAddNodeParams creates a new AddNodeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAddNodeParams() *AddNodeParams { + return &AddNodeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAddNodeParamsWithTimeout creates a new AddNodeParams object +// with the ability to set a timeout on a request. +func NewAddNodeParamsWithTimeout(timeout time.Duration) *AddNodeParams { + return &AddNodeParams{ + timeout: timeout, + } +} + +// NewAddNodeParamsWithContext creates a new AddNodeParams object +// with the ability to set a context for a request. +func NewAddNodeParamsWithContext(ctx context.Context) *AddNodeParams { + return &AddNodeParams{ + Context: ctx, + } +} + +// NewAddNodeParamsWithHTTPClient creates a new AddNodeParams object +// with the ability to set a custom HTTPClient for a request. +func NewAddNodeParamsWithHTTPClient(client *http.Client) *AddNodeParams { + return &AddNodeParams{ + HTTPClient: client, + } +} + +/* +AddNodeParams contains all the parameters to send to the API endpoint + + for the add node operation. + + Typically these are written to a http.Request. +*/ +type AddNodeParams struct { + // Body. + Body AddNodeBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the add node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddNodeParams) WithDefaults() *AddNodeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddNodeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the add node params +func (o *AddNodeParams) WithTimeout(timeout time.Duration) *AddNodeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add node params +func (o *AddNodeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add node params +func (o *AddNodeParams) WithContext(ctx context.Context) *AddNodeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add node params +func (o *AddNodeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add node params +func (o *AddNodeParams) WithHTTPClient(client *http.Client) *AddNodeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add node params +func (o *AddNodeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add node params +func (o *AddNodeParams) WithBody(body AddNodeBody) *AddNodeParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add node params +func (o *AddNodeParams) SetBody(body AddNodeBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AddNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/inventorypb/json/client/nodes/add_node_responses.go b/api/inventorypb/json/client/nodes/add_node_responses.go new file mode 100644 index 0000000000..6242f93d67 --- /dev/null +++ b/api/inventorypb/json/client/nodes/add_node_responses.go @@ -0,0 +1,1363 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AddNodeReader is a Reader for the AddNode structure. +type AddNodeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAddNodeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewAddNodeDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewAddNodeOK creates a AddNodeOK with default headers values +func NewAddNodeOK() *AddNodeOK { + return &AddNodeOK{} +} + +/* +AddNodeOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type AddNodeOK struct { + Payload *AddNodeOKBody +} + +func (o *AddNodeOK) Error() string { + return fmt.Sprintf("[POST /v1/inventory/Nodes/Add][%d] addNodeOk %+v", 200, o.Payload) +} + +func (o *AddNodeOK) GetPayload() *AddNodeOKBody { + return o.Payload +} + +func (o *AddNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(AddNodeOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAddNodeDefault creates a AddNodeDefault with default headers values +func NewAddNodeDefault(code int) *AddNodeDefault { + return &AddNodeDefault{ + _statusCode: code, + } +} + +/* +AddNodeDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type AddNodeDefault struct { + _statusCode int + + Payload *AddNodeDefaultBody +} + +// Code gets the status code for the add node default response +func (o *AddNodeDefault) Code() int { + return o._statusCode +} + +func (o *AddNodeDefault) Error() string { + return fmt.Sprintf("[POST /v1/inventory/Nodes/Add][%d] AddNode default %+v", o._statusCode, o.Payload) +} + +func (o *AddNodeDefault) GetPayload() *AddNodeDefaultBody { + return o.Payload +} + +func (o *AddNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(AddNodeDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/* +AddNodeBody add node body +swagger:model AddNodeBody +*/ +type AddNodeBody struct { + // container + Container *AddNodeParamsBodyContainer `json:"container,omitempty"` + + // generic + Generic *AddNodeParamsBodyGeneric `json:"generic,omitempty"` + + // remote + Remote *AddNodeParamsBodyRemote `json:"remote,omitempty"` + + // remote azure + RemoteAzure *AddNodeParamsBodyRemoteAzure `json:"remote_azure,omitempty"` + + // remote rds + RemoteRDS *AddNodeParamsBodyRemoteRDS `json:"remote_rds,omitempty"` +} + +// Validate validates this add node body +func (o *AddNodeBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateContainer(formats); err != nil { + res = append(res, err) + } + + if err := o.validateGeneric(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemote(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemoteAzure(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemoteRDS(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeBody) validateContainer(formats strfmt.Registry) error { + if swag.IsZero(o.Container) { // not required + return nil + } + + if o.Container != nil { + if err := o.Container.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "container") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) validateGeneric(formats strfmt.Registry) error { + if swag.IsZero(o.Generic) { // not required + return nil + } + + if o.Generic != nil { + if err := o.Generic.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "generic") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) validateRemote(formats strfmt.Registry) error { + if swag.IsZero(o.Remote) { // not required + return nil + } + + if o.Remote != nil { + if err := o.Remote.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) validateRemoteAzure(formats strfmt.Registry) error { + if swag.IsZero(o.RemoteAzure) { // not required + return nil + } + + if o.RemoteAzure != nil { + if err := o.RemoteAzure.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote_azure") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote_azure") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) validateRemoteRDS(formats strfmt.Registry) error { + if swag.IsZero(o.RemoteRDS) { // not required + return nil + } + + if o.RemoteRDS != nil { + if err := o.RemoteRDS.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote_rds") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add node body based on the context it is used +func (o *AddNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateContainer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateGeneric(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemote(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemoteAzure(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemoteRDS(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeBody) contextValidateContainer(ctx context.Context, formats strfmt.Registry) error { + if o.Container != nil { + if err := o.Container.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "container") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) contextValidateGeneric(ctx context.Context, formats strfmt.Registry) error { + if o.Generic != nil { + if err := o.Generic.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "generic") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { + if o.Remote != nil { + if err := o.Remote.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) contextValidateRemoteAzure(ctx context.Context, formats strfmt.Registry) error { + if o.RemoteAzure != nil { + if err := o.RemoteAzure.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote_azure") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote_azure") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) contextValidateRemoteRDS(ctx context.Context, formats strfmt.Registry) error { + if o.RemoteRDS != nil { + if err := o.RemoteRDS.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote_rds") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeBody) UnmarshalBinary(b []byte) error { + var res AddNodeBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeDefaultBody add node default body +swagger:model AddNodeDefaultBody +*/ +type AddNodeDefaultBody struct { + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*AddNodeDefaultBodyDetailsItems0 `json:"details"` +} + +// Validate validates this add node default body +func (o *AddNodeDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add node default body based on the context it is used +func (o *AddNodeDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeDefaultBody) UnmarshalBinary(b []byte) error { + var res AddNodeDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeDefaultBodyDetailsItems0 add node default body details items0 +swagger:model AddNodeDefaultBodyDetailsItems0 +*/ +type AddNodeDefaultBodyDetailsItems0 struct { + // at type + AtType string `json:"@type,omitempty"` +} + +// Validate validates this add node default body details items0 +func (o *AddNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node default body details items0 based on context it is used +func (o *AddNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddNodeDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBody add node OK body +swagger:model AddNodeOKBody +*/ +type AddNodeOKBody struct { + // container + Container *AddNodeOKBodyContainer `json:"container,omitempty"` + + // generic + Generic *AddNodeOKBodyGeneric `json:"generic,omitempty"` + + // remote + Remote *AddNodeOKBodyRemote `json:"remote,omitempty"` + + // remote azure database + RemoteAzureDatabase *AddNodeOKBodyRemoteAzureDatabase `json:"remote_azure_database,omitempty"` + + // remote rds + RemoteRDS *AddNodeOKBodyRemoteRDS `json:"remote_rds,omitempty"` +} + +// Validate validates this add node OK body +func (o *AddNodeOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateContainer(formats); err != nil { + res = append(res, err) + } + + if err := o.validateGeneric(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemote(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemoteAzureDatabase(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemoteRDS(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeOKBody) validateContainer(formats strfmt.Registry) error { + if swag.IsZero(o.Container) { // not required + return nil + } + + if o.Container != nil { + if err := o.Container.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "container") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) validateGeneric(formats strfmt.Registry) error { + if swag.IsZero(o.Generic) { // not required + return nil + } + + if o.Generic != nil { + if err := o.Generic.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "generic") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) validateRemote(formats strfmt.Registry) error { + if swag.IsZero(o.Remote) { // not required + return nil + } + + if o.Remote != nil { + if err := o.Remote.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) error { + if swag.IsZero(o.RemoteAzureDatabase) { // not required + return nil + } + + if o.RemoteAzureDatabase != nil { + if err := o.RemoteAzureDatabase.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote_azure_database") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote_azure_database") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) validateRemoteRDS(formats strfmt.Registry) error { + if swag.IsZero(o.RemoteRDS) { // not required + return nil + } + + if o.RemoteRDS != nil { + if err := o.RemoteRDS.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote_rds") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add node OK body based on the context it is used +func (o *AddNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateContainer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateGeneric(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemote(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemoteAzureDatabase(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemoteRDS(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeOKBody) contextValidateContainer(ctx context.Context, formats strfmt.Registry) error { + if o.Container != nil { + if err := o.Container.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "container") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) contextValidateGeneric(ctx context.Context, formats strfmt.Registry) error { + if o.Generic != nil { + if err := o.Generic.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "generic") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { + if o.Remote != nil { + if err := o.Remote.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) contextValidateRemoteAzureDatabase(ctx context.Context, formats strfmt.Registry) error { + if o.RemoteAzureDatabase != nil { + if err := o.RemoteAzureDatabase.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote_azure_database") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote_azure_database") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) contextValidateRemoteRDS(ctx context.Context, formats strfmt.Registry) error { + if o.RemoteRDS != nil { + if err := o.RemoteRDS.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote_rds") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBody) UnmarshalBinary(b []byte) error { + var res AddNodeOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBodyContainer ContainerNode represents a Docker container. +swagger:model AddNodeOKBodyContainer +*/ +type AddNodeOKBodyContainer struct { + // Unique randomly generated instance identifier. + NodeID string `json:"node_id,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Linux machine-id of the Generic Node where this Container Node runs. + MachineID string `json:"machine_id,omitempty"` + + // Container identifier. If specified, must be a unique Docker container identifier. + ContainerID string `json:"container_id,omitempty"` + + // Container name. + ContainerName string `json:"container_name,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node OK body container +func (o *AddNodeOKBodyContainer) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node OK body container based on context it is used +func (o *AddNodeOKBodyContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBodyContainer) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBodyContainer) UnmarshalBinary(b []byte) error { + var res AddNodeOKBodyContainer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBodyGeneric GenericNode represents a bare metal server or virtual machine. +swagger:model AddNodeOKBodyGeneric +*/ +type AddNodeOKBodyGeneric struct { + // Unique randomly generated instance identifier. + NodeID string `json:"node_id,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Linux machine-id. + MachineID string `json:"machine_id,omitempty"` + + // Linux distribution name and version. + Distro string `json:"distro,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node OK body generic +func (o *AddNodeOKBodyGeneric) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node OK body generic based on context it is used +func (o *AddNodeOKBodyGeneric) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBodyGeneric) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBodyGeneric) UnmarshalBinary(b []byte) error { + var res AddNodeOKBodyGeneric + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBodyRemote RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes. +swagger:model AddNodeOKBodyRemote +*/ +type AddNodeOKBodyRemote struct { + // Unique randomly generated instance identifier. + NodeID string `json:"node_id,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node OK body remote +func (o *AddNodeOKBodyRemote) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node OK body remote based on context it is used +func (o *AddNodeOKBodyRemote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBodyRemote) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBodyRemote) UnmarshalBinary(b []byte) error { + var res AddNodeOKBodyRemote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBodyRemoteAzureDatabase RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes. +swagger:model AddNodeOKBodyRemoteAzureDatabase +*/ +type AddNodeOKBodyRemoteAzureDatabase struct { + // Unique randomly generated instance identifier. + NodeID string `json:"node_id,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // DB instance identifier. + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node OK body remote azure database +func (o *AddNodeOKBodyRemoteAzureDatabase) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node OK body remote azure database based on context it is used +func (o *AddNodeOKBodyRemoteAzureDatabase) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBodyRemoteAzureDatabase) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBodyRemoteAzureDatabase) UnmarshalBinary(b []byte) error { + var res AddNodeOKBodyRemoteAzureDatabase + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBodyRemoteRDS RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes. +swagger:model AddNodeOKBodyRemoteRDS +*/ +type AddNodeOKBodyRemoteRDS struct { + // Unique randomly generated instance identifier. + NodeID string `json:"node_id,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // DB instance identifier. + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node OK body remote RDS +func (o *AddNodeOKBodyRemoteRDS) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node OK body remote RDS based on context it is used +func (o *AddNodeOKBodyRemoteRDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBodyRemoteRDS) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBodyRemoteRDS) UnmarshalBinary(b []byte) error { + var res AddNodeOKBodyRemoteRDS + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeParamsBodyContainer add node params body container +swagger:model AddNodeParamsBodyContainer +*/ +type AddNodeParamsBodyContainer struct { + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Linux machine-id of the Generic Node where this Container Node runs. + MachineID string `json:"machine_id,omitempty"` + + // Container identifier. If specified, must be a unique Docker container identifier. + ContainerID string `json:"container_id,omitempty"` + + // Container name. + ContainerName string `json:"container_name,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node params body container +func (o *AddNodeParamsBodyContainer) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node params body container based on context it is used +func (o *AddNodeParamsBodyContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeParamsBodyContainer) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeParamsBodyContainer) UnmarshalBinary(b []byte) error { + var res AddNodeParamsBodyContainer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeParamsBodyGeneric add node params body generic +swagger:model AddNodeParamsBodyGeneric +*/ +type AddNodeParamsBodyGeneric struct { + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Linux machine-id. + MachineID string `json:"machine_id,omitempty"` + + // Linux distribution name and version. + Distro string `json:"distro,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node params body generic +func (o *AddNodeParamsBodyGeneric) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node params body generic based on context it is used +func (o *AddNodeParamsBodyGeneric) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeParamsBodyGeneric) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeParamsBodyGeneric) UnmarshalBinary(b []byte) error { + var res AddNodeParamsBodyGeneric + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeParamsBodyRemote add node params body remote +swagger:model AddNodeParamsBodyRemote +*/ +type AddNodeParamsBodyRemote struct { + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node params body remote +func (o *AddNodeParamsBodyRemote) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node params body remote based on context it is used +func (o *AddNodeParamsBodyRemote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeParamsBodyRemote) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeParamsBodyRemote) UnmarshalBinary(b []byte) error { + var res AddNodeParamsBodyRemote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeParamsBodyRemoteAzure add node params body remote azure +swagger:model AddNodeParamsBodyRemoteAzure +*/ +type AddNodeParamsBodyRemoteAzure struct { + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // DB instance identifier. + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node params body remote azure +func (o *AddNodeParamsBodyRemoteAzure) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node params body remote azure based on context it is used +func (o *AddNodeParamsBodyRemoteAzure) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeParamsBodyRemoteAzure) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeParamsBodyRemoteAzure) UnmarshalBinary(b []byte) error { + var res AddNodeParamsBodyRemoteAzure + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeParamsBodyRemoteRDS add node params body remote RDS +swagger:model AddNodeParamsBodyRemoteRDS +*/ +type AddNodeParamsBodyRemoteRDS struct { + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // DB instance identifier. + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node params body remote RDS +func (o *AddNodeParamsBodyRemoteRDS) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node params body remote RDS based on context it is used +func (o *AddNodeParamsBodyRemoteRDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeParamsBodyRemoteRDS) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeParamsBodyRemoteRDS) UnmarshalBinary(b []byte) error { + var res AddNodeParamsBodyRemoteRDS + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go b/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go index cbdcadf303..614e87de2a 100644 --- a/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go +++ b/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go @@ -424,10 +424,6 @@ type AddRemoteRDSNodeOKBodyRemoteRDS struct { Az string `json:"az,omitempty"` // Custom user-assigned labels. - // - // TODO https://jira.percona.com/browse/PMM-4314 - // string az = 8; - // string node_model = 9; CustomLabels map[string]string `json:"custom_labels,omitempty"` } diff --git a/api/inventorypb/json/client/nodes/get_node_responses.go b/api/inventorypb/json/client/nodes/get_node_responses.go index 3f22cfb738..6e1a34baf1 100644 --- a/api/inventorypb/json/client/nodes/get_node_responses.go +++ b/api/inventorypb/json/client/nodes/get_node_responses.go @@ -824,10 +824,6 @@ type GetNodeOKBodyRemoteRDS struct { Az string `json:"az,omitempty"` // Custom user-assigned labels. - // - // TODO https://jira.percona.com/browse/PMM-4314 - // string az = 8; - // string node_model = 9; CustomLabels map[string]string `json:"custom_labels,omitempty"` } diff --git a/api/inventorypb/json/client/nodes/list_nodes_responses.go b/api/inventorypb/json/client/nodes/list_nodes_responses.go index ca9b8b4dae..e8bf829521 100644 --- a/api/inventorypb/json/client/nodes/list_nodes_responses.go +++ b/api/inventorypb/json/client/nodes/list_nodes_responses.go @@ -935,10 +935,6 @@ type ListNodesOKBodyRemoteRDSItems0 struct { Az string `json:"az,omitempty"` // Custom user-assigned labels. - // - // TODO https://jira.percona.com/browse/PMM-4314 - // string az = 8; - // string node_model = 9; CustomLabels map[string]string `json:"custom_labels,omitempty"` } diff --git a/api/inventorypb/json/client/nodes/nodes_client.go b/api/inventorypb/json/client/nodes/nodes_client.go index 48d9df9312..1088e70c62 100644 --- a/api/inventorypb/json/client/nodes/nodes_client.go +++ b/api/inventorypb/json/client/nodes/nodes_client.go @@ -32,6 +32,8 @@ type ClientService interface { AddGenericNode(params *AddGenericNodeParams, opts ...ClientOption) (*AddGenericNodeOK, error) + AddNode(params *AddNodeParams, opts ...ClientOption) (*AddNodeOK, error) + AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodeParams, opts ...ClientOption) (*AddRemoteAzureDatabaseNodeOK, error) AddRemoteNode(params *AddRemoteNodeParams, opts ...ClientOption) (*AddRemoteNodeOK, error) @@ -48,9 +50,9 @@ type ClientService interface { } /* -AddContainerNode adds container node +AddContainerNode adds a container node -Adds container Node. +Adds a container Node. */ func (a *Client) AddContainerNode(params *AddContainerNodeParams, opts ...ClientOption) (*AddContainerNodeOK, error) { // TODO: Validate the params before sending @@ -87,9 +89,9 @@ func (a *Client) AddContainerNode(params *AddContainerNodeParams, opts ...Client } /* -AddGenericNode adds generic node +AddGenericNode adds a generic node -Adds generic Node. +Adds a generic Node. */ func (a *Client) AddGenericNode(params *AddGenericNodeParams, opts ...ClientOption) (*AddGenericNodeOK, error) { // TODO: Validate the params before sending @@ -126,9 +128,48 @@ func (a *Client) AddGenericNode(params *AddGenericNodeParams, opts ...ClientOpti } /* -AddRemoteAzureDatabaseNode adds remote azure database node +AddNode adds node + +Adds a Node. +*/ +func (a *Client) AddNode(params *AddNodeParams, opts ...ClientOption) (*AddNodeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddNodeParams() + } + op := &runtime.ClientOperation{ + ID: "AddNode", + Method: "POST", + PathPattern: "/v1/inventory/Nodes/Add", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &AddNodeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AddNodeOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*AddNodeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +AddRemoteAzureDatabaseNode addas a remote azure database node -Adds remote Azure database Node. +Adds a remote Azure database Node. */ func (a *Client) AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodeParams, opts ...ClientOption) (*AddRemoteAzureDatabaseNodeOK, error) { // TODO: Validate the params before sending @@ -165,9 +206,9 @@ func (a *Client) AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodePa } /* -AddRemoteNode adds remote node +AddRemoteNode adds a remote node -Adds remote Node. +Adds a remote Node. */ func (a *Client) AddRemoteNode(params *AddRemoteNodeParams, opts ...ClientOption) (*AddRemoteNodeOK, error) { // TODO: Validate the params before sending @@ -204,9 +245,9 @@ func (a *Client) AddRemoteNode(params *AddRemoteNodeParams, opts ...ClientOption } /* -AddRemoteRDSNode adds remote RDS node +AddRemoteRDSNode adds a remote RDS node -Adds remote RDS Node. +Adds a remote RDS Node. */ func (a *Client) AddRemoteRDSNode(params *AddRemoteRDSNodeParams, opts ...ClientOption) (*AddRemoteRDSNodeOK, error) { // TODO: Validate the params before sending @@ -321,9 +362,9 @@ func (a *Client) ListNodes(params *ListNodesParams, opts ...ClientOption) (*List } /* -RemoveNode removes node +RemoveNode removes a node -Removes Node. +Removes a Node. */ func (a *Client) RemoveNode(params *RemoveNodeParams, opts ...ClientOption) (*RemoveNodeOK, error) { // TODO: Validate the params before sending diff --git a/api/inventorypb/json/client/services/change_service_parameters.go b/api/inventorypb/json/client/services/change_service_parameters.go new file mode 100644 index 0000000000..9278a10406 --- /dev/null +++ b/api/inventorypb/json/client/services/change_service_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewChangeServiceParams creates a new ChangeServiceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewChangeServiceParams() *ChangeServiceParams { + return &ChangeServiceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewChangeServiceParamsWithTimeout creates a new ChangeServiceParams object +// with the ability to set a timeout on a request. +func NewChangeServiceParamsWithTimeout(timeout time.Duration) *ChangeServiceParams { + return &ChangeServiceParams{ + timeout: timeout, + } +} + +// NewChangeServiceParamsWithContext creates a new ChangeServiceParams object +// with the ability to set a context for a request. +func NewChangeServiceParamsWithContext(ctx context.Context) *ChangeServiceParams { + return &ChangeServiceParams{ + Context: ctx, + } +} + +// NewChangeServiceParamsWithHTTPClient creates a new ChangeServiceParams object +// with the ability to set a custom HTTPClient for a request. +func NewChangeServiceParamsWithHTTPClient(client *http.Client) *ChangeServiceParams { + return &ChangeServiceParams{ + HTTPClient: client, + } +} + +/* +ChangeServiceParams contains all the parameters to send to the API endpoint + + for the change service operation. + + Typically these are written to a http.Request. +*/ +type ChangeServiceParams struct { + // Body. + Body ChangeServiceBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the change service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeServiceParams) WithDefaults() *ChangeServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeServiceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the change service params +func (o *ChangeServiceParams) WithTimeout(timeout time.Duration) *ChangeServiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the change service params +func (o *ChangeServiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the change service params +func (o *ChangeServiceParams) WithContext(ctx context.Context) *ChangeServiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the change service params +func (o *ChangeServiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the change service params +func (o *ChangeServiceParams) WithHTTPClient(client *http.Client) *ChangeServiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the change service params +func (o *ChangeServiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the change service params +func (o *ChangeServiceParams) WithBody(body ChangeServiceBody) *ChangeServiceParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the change service params +func (o *ChangeServiceParams) SetBody(body ChangeServiceBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ChangeServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/inventorypb/json/client/services/change_service_responses.go b/api/inventorypb/json/client/services/change_service_responses.go new file mode 100644 index 0000000000..c90b7cb47d --- /dev/null +++ b/api/inventorypb/json/client/services/change_service_responses.go @@ -0,0 +1,307 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ChangeServiceReader is a Reader for the ChangeService structure. +type ChangeServiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ChangeServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewChangeServiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewChangeServiceDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewChangeServiceOK creates a ChangeServiceOK with default headers values +func NewChangeServiceOK() *ChangeServiceOK { + return &ChangeServiceOK{} +} + +/* +ChangeServiceOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type ChangeServiceOK struct { + Payload interface{} +} + +func (o *ChangeServiceOK) Error() string { + return fmt.Sprintf("[POST /v1/inventory/Services/Change][%d] changeServiceOk %+v", 200, o.Payload) +} + +func (o *ChangeServiceOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ChangeServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewChangeServiceDefault creates a ChangeServiceDefault with default headers values +func NewChangeServiceDefault(code int) *ChangeServiceDefault { + return &ChangeServiceDefault{ + _statusCode: code, + } +} + +/* +ChangeServiceDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type ChangeServiceDefault struct { + _statusCode int + + Payload *ChangeServiceDefaultBody +} + +// Code gets the status code for the change service default response +func (o *ChangeServiceDefault) Code() int { + return o._statusCode +} + +func (o *ChangeServiceDefault) Error() string { + return fmt.Sprintf("[POST /v1/inventory/Services/Change][%d] ChangeService default %+v", o._statusCode, o.Payload) +} + +func (o *ChangeServiceDefault) GetPayload() *ChangeServiceDefaultBody { + return o.Payload +} + +func (o *ChangeServiceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(ChangeServiceDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/* +ChangeServiceBody change service body +swagger:model ChangeServiceBody +*/ +type ChangeServiceBody struct { + // service id + ServiceID string `json:"service_id,omitempty"` + + // environment + Environment string `json:"environment,omitempty"` + + // cluster + Cluster string `json:"cluster,omitempty"` + + // replication set + ReplicationSet string `json:"replication_set,omitempty"` + + // external group + ExternalGroup string `json:"external_group,omitempty"` +} + +// Validate validates this change service body +func (o *ChangeServiceBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change service body based on context it is used +func (o *ChangeServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeServiceBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeServiceBody) UnmarshalBinary(b []byte) error { + var res ChangeServiceBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +ChangeServiceDefaultBody change service default body +swagger:model ChangeServiceDefaultBody +*/ +type ChangeServiceDefaultBody struct { + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*ChangeServiceDefaultBodyDetailsItems0 `json:"details"` +} + +// Validate validates this change service default body +func (o *ChangeServiceDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeServiceDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeService default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change service default body based on the context it is used +func (o *ChangeServiceDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeService default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeServiceDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeServiceDefaultBody) UnmarshalBinary(b []byte) error { + var res ChangeServiceDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +ChangeServiceDefaultBodyDetailsItems0 change service default body details items0 +swagger:model ChangeServiceDefaultBodyDetailsItems0 +*/ +type ChangeServiceDefaultBodyDetailsItems0 struct { + // at type + AtType string `json:"@type,omitempty"` +} + +// Validate validates this change service default body details items0 +func (o *ChangeServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change service default body details items0 based on context it is used +func (o *ChangeServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeServiceDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/inventorypb/json/client/services/services_client.go b/api/inventorypb/json/client/services/services_client.go index 8c33b0d1cd..d168a7c976 100644 --- a/api/inventorypb/json/client/services/services_client.go +++ b/api/inventorypb/json/client/services/services_client.go @@ -42,6 +42,8 @@ type ClientService interface { AddProxySQLService(params *AddProxySQLServiceParams, opts ...ClientOption) (*AddProxySQLServiceOK, error) + ChangeService(params *ChangeServiceParams, opts ...ClientOption) (*ChangeServiceOK, error) + GetService(params *GetServiceParams, opts ...ClientOption) (*GetServiceOK, error) ListActiveServiceTypes(params *ListActiveServiceTypesParams, opts ...ClientOption) (*ListActiveServiceTypesOK, error) @@ -328,6 +330,45 @@ func (a *Client) AddProxySQLService(params *AddProxySQLServiceParams, opts ...Cl return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ChangeService changes service + +Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks. +*/ +func (a *Client) ChangeService(params *ChangeServiceParams, opts ...ClientOption) (*ChangeServiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewChangeServiceParams() + } + op := &runtime.ClientOperation{ + ID: "ChangeService", + Method: "POST", + PathPattern: "/v1/inventory/Services/Change", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ChangeServiceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ChangeServiceOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ChangeServiceDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* GetService gets service diff --git a/api/inventorypb/json/inventorypb.json b/api/inventorypb/json/inventorypb.json index 0ff9724ba6..f1cbb4024b 100644 --- a/api/inventorypb/json/inventorypb.json +++ b/api/inventorypb/json/inventorypb.json @@ -9156,14 +9156,548 @@ } } }, + "/v1/inventory/Nodes/Add": { + "post": { + "description": "Adds a Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Node", + "operationId": "AddNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "container": { + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 3 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + } + }, + "x-order": 1 + }, + "generic": { + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 6 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 4 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 5 + } + }, + "x-order": 0 + }, + "remote": { + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + } + }, + "x-order": 2 + }, + "remote_azure": { + "type": "object", + "properties": { + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + } + }, + "x-order": 4 + }, + "remote_rds": { + "type": "object", + "properties": { + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + } + }, + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "container": { + "description": "ContainerNode represents a Docker container.", + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 3 + }, + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + } + }, + "x-order": 1 + }, + "generic": { + "description": "GenericNode represents a bare metal server or virtual machine.", + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 4 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 3 + }, + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + } + }, + "x-order": 0 + }, + "remote": { + "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + }, + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + } + }, + "x-order": 2 + }, + "remote_azure_database": { + "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", + "type": "object", + "properties": { + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + }, + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + } + }, + "x-order": 4 + }, + "remote_rds": { + "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", + "type": "object", + "properties": { + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + }, + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + } + }, + "x-order": 3 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + }, + "message": { + "type": "string", + "x-order": 1 + } + } + } + } + } + } + }, "/v1/inventory/Nodes/AddContainer": { "post": { - "description": "Adds container Node.", + "description": "Adds a container Node.", "tags": [ "Nodes" ], - "summary": "Add Container Node", + "summary": "Add a Container Node", "operationId": "AddContainerNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -9329,12 +9863,13 @@ }, "/v1/inventory/Nodes/AddGeneric": { "post": { - "description": "Adds generic Node.", + "description": "Adds a generic Node.", "tags": [ "Nodes" ], - "summary": "Add Generic Node", + "summary": "Add a Generic Node", "operationId": "AddGenericNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -9490,12 +10025,13 @@ }, "/v1/inventory/Nodes/AddRemote": { "post": { - "description": "Adds remote Node.", + "description": "Adds a remote Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Node", + "summary": "Add a Remote Node", "operationId": "AddRemoteNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -9631,12 +10167,13 @@ }, "/v1/inventory/Nodes/AddRemoteAzureDatabase": { "post": { - "description": "Adds remote Azure database Node.", + "description": "Adds a remote Azure database Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Azure Database Node", + "summary": "Adda a Remote Azure Database Node", "operationId": "AddRemoteAzureDatabaseNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -9772,12 +10309,13 @@ }, "/v1/inventory/Nodes/AddRemoteRDS": { "post": { - "description": "Adds remote RDS Node.", + "description": "Adds a remote RDS Node.", "tags": [ "Nodes" ], - "summary": "Add Remote RDS Node", + "summary": "Add a Remote RDS Node", "operationId": "AddRemoteRDSNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -9844,7 +10382,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -10162,7 +10700,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -10503,7 +11041,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -10573,11 +11111,11 @@ }, "/v1/inventory/Nodes/Remove": { "post": { - "description": "Removes Node.", + "description": "Removes a Node.", "tags": [ "Nodes" ], - "summary": "Remove Node", + "summary": "Remove a Node", "operationId": "RemoveNode", "parameters": [ { @@ -11631,6 +12169,87 @@ } } }, + "/v1/inventory/Services/Change": { + "post": { + "description": "Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks.", + "tags": [ + "Services" + ], + "summary": "Change service", + "operationId": "ChangeService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "cluster": { + "type": "string", + "x-order": 2 + }, + "environment": { + "type": "string", + "x-order": 1 + }, + "external_group": { + "type": "string", + "x-order": 4 + }, + "replication_set": { + "type": "string", + "x-order": 3 + }, + "service_id": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + }, + "message": { + "type": "string", + "x-order": 1 + } + } + } + } + } + } + }, "/v1/inventory/Services/CustomLabels/Add": { "post": { "description": "Adds or replaces (if the key exists) custom labels for a Service.", diff --git a/api/inventorypb/nodes.go b/api/inventorypb/nodes.go index e92d7876ac..f51e9b9ecc 100644 --- a/api/inventorypb/nodes.go +++ b/api/inventorypb/nodes.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -22,7 +22,7 @@ type Node interface { sealedNode() } -// Ordered the same as NodeType enum +// Ordered the same as NodeType enum. func (*GenericNode) sealedNode() {} func (*ContainerNode) sealedNode() {} diff --git a/api/inventorypb/nodes.pb.go b/api/inventorypb/nodes.pb.go index afabb19136..b0589adcca 100644 --- a/api/inventorypb/nodes.pb.go +++ b/api/inventorypb/nodes.pb.go @@ -941,6 +941,252 @@ func (*GetNodeResponse_RemoteRds) isGetNodeResponse_Node() {} func (*GetNodeResponse_RemoteAzureDatabase) isGetNodeResponse_Node() {} +type AddNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Request: + // + // *AddNodeRequest_Generic + // *AddNodeRequest_Container + // *AddNodeRequest_Remote + // *AddNodeRequest_RemoteRds + // *AddNodeRequest_RemoteAzure + Request isAddNodeRequest_Request `protobuf_oneof:"request"` +} + +func (x *AddNodeRequest) Reset() { + *x = AddNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_inventorypb_nodes_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddNodeRequest) ProtoMessage() {} + +func (x *AddNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_inventorypb_nodes_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 AddNodeRequest.ProtoReflect.Descriptor instead. +func (*AddNodeRequest) Descriptor() ([]byte, []int) { + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{9} +} + +func (m *AddNodeRequest) GetRequest() isAddNodeRequest_Request { + if m != nil { + return m.Request + } + return nil +} + +func (x *AddNodeRequest) GetGeneric() *AddGenericNodeRequest { + if x, ok := x.GetRequest().(*AddNodeRequest_Generic); ok { + return x.Generic + } + return nil +} + +func (x *AddNodeRequest) GetContainer() *AddContainerNodeRequest { + if x, ok := x.GetRequest().(*AddNodeRequest_Container); ok { + return x.Container + } + return nil +} + +func (x *AddNodeRequest) GetRemote() *AddRemoteNodeRequest { + if x, ok := x.GetRequest().(*AddNodeRequest_Remote); ok { + return x.Remote + } + return nil +} + +func (x *AddNodeRequest) GetRemoteRds() *AddRemoteRDSNodeRequest { + if x, ok := x.GetRequest().(*AddNodeRequest_RemoteRds); ok { + return x.RemoteRds + } + return nil +} + +func (x *AddNodeRequest) GetRemoteAzure() *AddRemoteAzureDatabaseNodeRequest { + if x, ok := x.GetRequest().(*AddNodeRequest_RemoteAzure); ok { + return x.RemoteAzure + } + return nil +} + +type isAddNodeRequest_Request interface { + isAddNodeRequest_Request() +} + +type AddNodeRequest_Generic struct { + Generic *AddGenericNodeRequest `protobuf:"bytes,1,opt,name=generic,proto3,oneof"` +} + +type AddNodeRequest_Container struct { + Container *AddContainerNodeRequest `protobuf:"bytes,2,opt,name=container,proto3,oneof"` +} + +type AddNodeRequest_Remote struct { + Remote *AddRemoteNodeRequest `protobuf:"bytes,3,opt,name=remote,proto3,oneof"` +} + +type AddNodeRequest_RemoteRds struct { + RemoteRds *AddRemoteRDSNodeRequest `protobuf:"bytes,4,opt,name=remote_rds,json=remoteRds,proto3,oneof"` +} + +type AddNodeRequest_RemoteAzure struct { + RemoteAzure *AddRemoteAzureDatabaseNodeRequest `protobuf:"bytes,5,opt,name=remote_azure,json=remoteAzure,proto3,oneof"` +} + +func (*AddNodeRequest_Generic) isAddNodeRequest_Request() {} + +func (*AddNodeRequest_Container) isAddNodeRequest_Request() {} + +func (*AddNodeRequest_Remote) isAddNodeRequest_Request() {} + +func (*AddNodeRequest_RemoteRds) isAddNodeRequest_Request() {} + +func (*AddNodeRequest_RemoteAzure) isAddNodeRequest_Request() {} + +type AddNodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Node: + // + // *AddNodeResponse_Generic + // *AddNodeResponse_Container + // *AddNodeResponse_Remote + // *AddNodeResponse_RemoteRds + // *AddNodeResponse_RemoteAzureDatabase + Node isAddNodeResponse_Node `protobuf_oneof:"node"` +} + +func (x *AddNodeResponse) Reset() { + *x = AddNodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_inventorypb_nodes_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddNodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddNodeResponse) ProtoMessage() {} + +func (x *AddNodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_inventorypb_nodes_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 AddNodeResponse.ProtoReflect.Descriptor instead. +func (*AddNodeResponse) Descriptor() ([]byte, []int) { + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{10} +} + +func (m *AddNodeResponse) GetNode() isAddNodeResponse_Node { + if m != nil { + return m.Node + } + return nil +} + +func (x *AddNodeResponse) GetGeneric() *GenericNode { + if x, ok := x.GetNode().(*AddNodeResponse_Generic); ok { + return x.Generic + } + return nil +} + +func (x *AddNodeResponse) GetContainer() *ContainerNode { + if x, ok := x.GetNode().(*AddNodeResponse_Container); ok { + return x.Container + } + return nil +} + +func (x *AddNodeResponse) GetRemote() *RemoteNode { + if x, ok := x.GetNode().(*AddNodeResponse_Remote); ok { + return x.Remote + } + return nil +} + +func (x *AddNodeResponse) GetRemoteRds() *RemoteRDSNode { + if x, ok := x.GetNode().(*AddNodeResponse_RemoteRds); ok { + return x.RemoteRds + } + return nil +} + +func (x *AddNodeResponse) GetRemoteAzureDatabase() *RemoteAzureDatabaseNode { + if x, ok := x.GetNode().(*AddNodeResponse_RemoteAzureDatabase); ok { + return x.RemoteAzureDatabase + } + return nil +} + +type isAddNodeResponse_Node interface { + isAddNodeResponse_Node() +} + +type AddNodeResponse_Generic struct { + Generic *GenericNode `protobuf:"bytes,1,opt,name=generic,proto3,oneof"` +} + +type AddNodeResponse_Container struct { + Container *ContainerNode `protobuf:"bytes,2,opt,name=container,proto3,oneof"` +} + +type AddNodeResponse_Remote struct { + Remote *RemoteNode `protobuf:"bytes,3,opt,name=remote,proto3,oneof"` +} + +type AddNodeResponse_RemoteRds struct { + RemoteRds *RemoteRDSNode `protobuf:"bytes,4,opt,name=remote_rds,json=remoteRds,proto3,oneof"` +} + +type AddNodeResponse_RemoteAzureDatabase struct { + RemoteAzureDatabase *RemoteAzureDatabaseNode `protobuf:"bytes,5,opt,name=remote_azure_database,json=remoteAzureDatabase,proto3,oneof"` +} + +func (*AddNodeResponse_Generic) isAddNodeResponse_Node() {} + +func (*AddNodeResponse_Container) isAddNodeResponse_Node() {} + +func (*AddNodeResponse_Remote) isAddNodeResponse_Node() {} + +func (*AddNodeResponse_RemoteRds) isAddNodeResponse_Node() {} + +func (*AddNodeResponse_RemoteAzureDatabase) isAddNodeResponse_Node() {} + type AddGenericNodeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -967,7 +1213,7 @@ type AddGenericNodeRequest struct { func (x *AddGenericNodeRequest) Reset() { *x = AddGenericNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[9] + mi := &file_inventorypb_nodes_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -980,7 +1226,7 @@ func (x *AddGenericNodeRequest) String() string { func (*AddGenericNodeRequest) ProtoMessage() {} func (x *AddGenericNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[9] + mi := &file_inventorypb_nodes_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -993,7 +1239,7 @@ func (x *AddGenericNodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddGenericNodeRequest.ProtoReflect.Descriptor instead. func (*AddGenericNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{9} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{11} } func (x *AddGenericNodeRequest) GetNodeName() string { @@ -1052,6 +1298,7 @@ func (x *AddGenericNodeRequest) GetCustomLabels() map[string]string { return nil } +// Deprecated: Marked as deprecated in inventorypb/nodes.proto. type AddGenericNodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1063,7 +1310,7 @@ type AddGenericNodeResponse struct { func (x *AddGenericNodeResponse) Reset() { *x = AddGenericNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[10] + mi := &file_inventorypb_nodes_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1076,7 +1323,7 @@ func (x *AddGenericNodeResponse) String() string { func (*AddGenericNodeResponse) ProtoMessage() {} func (x *AddGenericNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[10] + mi := &file_inventorypb_nodes_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1089,7 +1336,7 @@ func (x *AddGenericNodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddGenericNodeResponse.ProtoReflect.Descriptor instead. func (*AddGenericNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{10} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{12} } func (x *AddGenericNodeResponse) GetGeneric() *GenericNode { @@ -1127,7 +1374,7 @@ type AddContainerNodeRequest struct { func (x *AddContainerNodeRequest) Reset() { *x = AddContainerNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[11] + mi := &file_inventorypb_nodes_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1140,7 +1387,7 @@ func (x *AddContainerNodeRequest) String() string { func (*AddContainerNodeRequest) ProtoMessage() {} func (x *AddContainerNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[11] + mi := &file_inventorypb_nodes_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1153,7 +1400,7 @@ func (x *AddContainerNodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddContainerNodeRequest.ProtoReflect.Descriptor instead. func (*AddContainerNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{11} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{13} } func (x *AddContainerNodeRequest) GetNodeName() string { @@ -1219,6 +1466,7 @@ func (x *AddContainerNodeRequest) GetCustomLabels() map[string]string { return nil } +// Deprecated: Marked as deprecated in inventorypb/nodes.proto. type AddContainerNodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1230,7 +1478,7 @@ type AddContainerNodeResponse struct { func (x *AddContainerNodeResponse) Reset() { *x = AddContainerNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[12] + mi := &file_inventorypb_nodes_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1243,7 +1491,7 @@ func (x *AddContainerNodeResponse) String() string { func (*AddContainerNodeResponse) ProtoMessage() {} func (x *AddContainerNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[12] + mi := &file_inventorypb_nodes_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1256,7 +1504,7 @@ func (x *AddContainerNodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddContainerNodeResponse.ProtoReflect.Descriptor instead. func (*AddContainerNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{12} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{14} } func (x *AddContainerNodeResponse) GetContainer() *ContainerNode { @@ -1288,7 +1536,7 @@ type AddRemoteNodeRequest struct { func (x *AddRemoteNodeRequest) Reset() { *x = AddRemoteNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[13] + mi := &file_inventorypb_nodes_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1301,7 +1549,7 @@ func (x *AddRemoteNodeRequest) String() string { func (*AddRemoteNodeRequest) ProtoMessage() {} func (x *AddRemoteNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[13] + mi := &file_inventorypb_nodes_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1314,7 +1562,7 @@ func (x *AddRemoteNodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddRemoteNodeRequest.ProtoReflect.Descriptor instead. func (*AddRemoteNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{13} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{15} } func (x *AddRemoteNodeRequest) GetNodeName() string { @@ -1359,6 +1607,7 @@ func (x *AddRemoteNodeRequest) GetCustomLabels() map[string]string { return nil } +// Deprecated: Marked as deprecated in inventorypb/nodes.proto. type AddRemoteNodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1370,7 +1619,7 @@ type AddRemoteNodeResponse struct { func (x *AddRemoteNodeResponse) Reset() { *x = AddRemoteNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[14] + mi := &file_inventorypb_nodes_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1383,7 +1632,7 @@ func (x *AddRemoteNodeResponse) String() string { func (*AddRemoteNodeResponse) ProtoMessage() {} func (x *AddRemoteNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[14] + mi := &file_inventorypb_nodes_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1396,7 +1645,7 @@ func (x *AddRemoteNodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddRemoteNodeResponse.ProtoReflect.Descriptor instead. func (*AddRemoteNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{14} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{16} } func (x *AddRemoteNodeResponse) GetRemote() *RemoteNode { @@ -1428,7 +1677,7 @@ type AddRemoteRDSNodeRequest struct { func (x *AddRemoteRDSNodeRequest) Reset() { *x = AddRemoteRDSNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[15] + mi := &file_inventorypb_nodes_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1441,7 +1690,7 @@ func (x *AddRemoteRDSNodeRequest) String() string { func (*AddRemoteRDSNodeRequest) ProtoMessage() {} func (x *AddRemoteRDSNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[15] + mi := &file_inventorypb_nodes_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1454,7 +1703,7 @@ func (x *AddRemoteRDSNodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddRemoteRDSNodeRequest.ProtoReflect.Descriptor instead. func (*AddRemoteRDSNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{15} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{17} } func (x *AddRemoteRDSNodeRequest) GetNodeName() string { @@ -1499,6 +1748,7 @@ func (x *AddRemoteRDSNodeRequest) GetCustomLabels() map[string]string { return nil } +// Deprecated: Marked as deprecated in inventorypb/nodes.proto. type AddRemoteRDSNodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1510,7 +1760,7 @@ type AddRemoteRDSNodeResponse struct { func (x *AddRemoteRDSNodeResponse) Reset() { *x = AddRemoteRDSNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[16] + mi := &file_inventorypb_nodes_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1523,7 +1773,7 @@ func (x *AddRemoteRDSNodeResponse) String() string { func (*AddRemoteRDSNodeResponse) ProtoMessage() {} func (x *AddRemoteRDSNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[16] + mi := &file_inventorypb_nodes_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1536,7 +1786,7 @@ func (x *AddRemoteRDSNodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddRemoteRDSNodeResponse.ProtoReflect.Descriptor instead. func (*AddRemoteRDSNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{16} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{18} } func (x *AddRemoteRDSNodeResponse) GetRemoteRds() *RemoteRDSNode { @@ -1568,7 +1818,7 @@ type AddRemoteAzureDatabaseNodeRequest struct { func (x *AddRemoteAzureDatabaseNodeRequest) Reset() { *x = AddRemoteAzureDatabaseNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[17] + mi := &file_inventorypb_nodes_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1581,7 +1831,7 @@ func (x *AddRemoteAzureDatabaseNodeRequest) String() string { func (*AddRemoteAzureDatabaseNodeRequest) ProtoMessage() {} func (x *AddRemoteAzureDatabaseNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[17] + mi := &file_inventorypb_nodes_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1594,7 +1844,7 @@ func (x *AddRemoteAzureDatabaseNodeRequest) ProtoReflect() protoreflect.Message // Deprecated: Use AddRemoteAzureDatabaseNodeRequest.ProtoReflect.Descriptor instead. func (*AddRemoteAzureDatabaseNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{17} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{19} } func (x *AddRemoteAzureDatabaseNodeRequest) GetNodeName() string { @@ -1639,6 +1889,7 @@ func (x *AddRemoteAzureDatabaseNodeRequest) GetCustomLabels() map[string]string return nil } +// Deprecated: Marked as deprecated in inventorypb/nodes.proto. type AddRemoteAzureDatabaseNodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1650,7 +1901,7 @@ type AddRemoteAzureDatabaseNodeResponse struct { func (x *AddRemoteAzureDatabaseNodeResponse) Reset() { *x = AddRemoteAzureDatabaseNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[18] + mi := &file_inventorypb_nodes_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1663,7 +1914,7 @@ func (x *AddRemoteAzureDatabaseNodeResponse) String() string { func (*AddRemoteAzureDatabaseNodeResponse) ProtoMessage() {} func (x *AddRemoteAzureDatabaseNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[18] + mi := &file_inventorypb_nodes_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1676,7 +1927,7 @@ func (x *AddRemoteAzureDatabaseNodeResponse) ProtoReflect() protoreflect.Message // Deprecated: Use AddRemoteAzureDatabaseNodeResponse.ProtoReflect.Descriptor instead. func (*AddRemoteAzureDatabaseNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{18} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{20} } func (x *AddRemoteAzureDatabaseNodeResponse) GetRemoteAzureDatabase() *RemoteAzureDatabaseNode { @@ -1700,7 +1951,7 @@ type RemoveNodeRequest struct { func (x *RemoveNodeRequest) Reset() { *x = RemoveNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[19] + mi := &file_inventorypb_nodes_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1713,7 +1964,7 @@ func (x *RemoveNodeRequest) String() string { func (*RemoveNodeRequest) ProtoMessage() {} func (x *RemoveNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[19] + mi := &file_inventorypb_nodes_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1726,7 +1977,7 @@ func (x *RemoveNodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveNodeRequest.ProtoReflect.Descriptor instead. func (*RemoveNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{19} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{21} } func (x *RemoveNodeRequest) GetNodeId() string { @@ -1752,7 +2003,7 @@ type RemoveNodeResponse struct { func (x *RemoveNodeResponse) Reset() { *x = RemoveNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[20] + mi := &file_inventorypb_nodes_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1765,7 +2016,7 @@ func (x *RemoveNodeResponse) String() string { func (*RemoveNodeResponse) ProtoMessage() {} func (x *RemoveNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[20] + mi := &file_inventorypb_nodes_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1778,7 +2029,7 @@ func (x *RemoveNodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveNodeResponse.ProtoReflect.Descriptor instead. func (*RemoveNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{20} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{22} } var File_inventorypb_nodes_proto protoreflect.FileDescriptor @@ -1950,68 +2201,165 @@ var file_inventorypb_nodes_proto_rawDesc = []byte{ 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x13, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x42, 0x06, - 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0xf8, 0x02, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0xf0, 0x02, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x07, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, + 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x12, 0x42, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x06, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x5f, 0x72, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x09, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x64, 0x73, 0x12, 0x51, 0x0a, 0x0c, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, + 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x0b, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x42, 0x09, + 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xcd, 0x02, 0x0a, 0x0f, 0x41, 0x64, + 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, + 0x07, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, + 0x63, 0x12, 0x38, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x48, 0x00, + 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x0a, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x72, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x64, 0x73, 0x12, 0x58, 0x0a, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, + 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, + 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x13, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0xf8, 0x02, 0x0a, 0x15, 0x41, 0x64, + 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, + 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x69, 0x73, 0x74, 0x72, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x73, + 0x74, 0x72, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, 0x12, 0x57, 0x0a, 0x0d, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, + 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, 0x22, 0x4e, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, + 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, + 0x3a, 0x02, 0x18, 0x01, 0x22, 0xae, 0x03, 0x0a, 0x17, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, - 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x73, 0x74, - 0x72, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x73, 0x74, 0x72, 0x6f, - 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x05, + 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, + 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x34, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, 0x22, 0x56, 0x0a, 0x18, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x36, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x09, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xbf, 0x02, + 0x0a, 0x14, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, + 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, + 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x16, + 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, 0x12, 0x56, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, + 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, 0x22, + 0x4a, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, + 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xce, 0x02, 0x0a, 0x17, + 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, - 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, 0x12, 0x57, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, - 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, 0x22, 0x4a, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x69, - 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x22, 0xae, 0x03, - 0x0a, 0x17, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, - 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, - 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, - 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x61, 0x7a, 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6e, 0x76, 0x65, - 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, - 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, 0x22, 0x52, - 0x0a, 0x18, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x22, 0xbf, 0x02, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, + 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, + 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, 0x22, 0x57, 0x0a, 0x18, + 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x5f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, + 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, + 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x64, + 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xe2, 0x02, 0x0a, 0x21, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, @@ -2019,192 +2367,152 @@ var file_inventorypb_nodes_proto_rawDesc = []byte{ 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, - 0x64, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, - 0x7a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, 0x12, 0x56, 0x0a, 0x0d, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, 0x22, 0x46, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, - 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x22, 0xce, 0x02, 0x0a, - 0x17, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x12, 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, - 0x7a, 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, - 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, 0x22, 0x53, 0x0a, - 0x18, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x5f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, - 0x64, 0x73, 0x22, 0xe2, 0x02, 0x0a, 0x21, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x12, 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, - 0x7a, 0x12, 0x63, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, - 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 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, 0x22, 0x7c, 0x0a, 0x22, 0x41, 0x64, 0x64, 0x52, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, - 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x61, - 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, - 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, - 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x13, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, - 0x61, 0x62, 0x61, 0x73, 0x65, 0x22, 0x4b, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x6e, 0x6f, - 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, - 0x63, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x8d, 0x01, 0x0a, 0x08, 0x4e, 0x6f, 0x64, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, - 0x47, 0x45, 0x4e, 0x45, 0x52, 0x49, 0x43, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x01, 0x12, 0x12, - 0x0a, 0x0e, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x44, 0x45, - 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x4e, 0x4f, 0x44, - 0x45, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x52, 0x44, - 0x53, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x45, 0x4d, 0x4f, - 0x54, 0x45, 0x5f, 0x41, 0x5a, 0x55, 0x52, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, - 0x45, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x05, 0x32, 0x82, 0x0b, 0x0a, 0x05, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x12, 0x98, 0x01, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, - 0x12, 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, - 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x2a, - 0x12, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x1a, 0x1c, 0x52, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, - 0x61, 0x6c, 0x6c, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, - 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, - 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x8f, 0x01, - 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, - 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x4d, 0x92, 0x41, 0x28, 0x12, 0x08, 0x47, 0x65, 0x74, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, - 0x1c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, - 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, - 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x12, - 0xa9, 0x01, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, - 0x64, 0x65, 0x12, 0x20, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x52, 0x92, 0x41, 0x26, 0x12, 0x10, 0x41, 0x64, - 0x64, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x12, - 0x41, 0x64, 0x64, 0x73, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20, 0x4e, 0x6f, 0x64, - 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, + 0x64, 0x65, 0x6c, 0x12, 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x72, 0x65, + 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x61, 0x7a, 0x12, 0x63, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 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, 0x22, 0x80, 0x01, 0x0a, 0x22, 0x41, + 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x56, 0x0a, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, + 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x13, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, + 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x4b, 0x0a, + 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6e, 0x6f, + 0x64, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2a, 0x8d, 0x01, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, + 0x11, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, + 0x49, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x49, 0x43, 0x5f, + 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, + 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, + 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x52, + 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x52, 0x44, 0x53, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x04, + 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x41, 0x5a, 0x55, 0x52, 0x45, + 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x05, + 0x32, 0xb6, 0x0c, 0x0a, 0x05, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x98, 0x01, 0x0a, 0x09, 0x4c, + 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, + 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, + 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x2a, 0x12, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x4e, + 0x6f, 0x64, 0x65, 0x73, 0x1a, 0x1c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, + 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x4e, 0x6f, 0x64, 0x65, + 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, - 0x2f, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x12, 0xb5, 0x01, 0x0a, 0x10, - 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, - 0x12, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, 0x41, 0x2a, 0x12, 0x12, - 0x41, 0x64, 0x64, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x4e, 0x6f, - 0x64, 0x65, 0x1a, 0x14, 0x41, 0x64, 0x64, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, - 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x12, 0xa3, 0x01, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, - 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, - 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0x92, 0x41, 0x24, 0x12, 0x0f, 0x41, - 0x64, 0x64, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x11, - 0x41, 0x64, 0x64, 0x73, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, - 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, + 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x8f, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, + 0x65, 0x12, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, + 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x69, + 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x92, 0x41, 0x28, 0x12, 0x08, 0x47, + 0x65, 0x74, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x1c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, + 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x20, 0x62, + 0x79, 0x20, 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, + 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, + 0x64, 0x65, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x12, 0x7f, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, + 0x64, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, + 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x4e, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x92, 0x41, 0x18, 0x12, 0x08, + 0x41, 0x64, 0x64, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x0c, 0x41, 0x64, 0x64, 0x73, 0x20, 0x61, + 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, + 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, + 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x12, 0xb2, 0x01, 0x0a, 0x0e, 0x41, 0x64, 0x64, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x2e, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, + 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x5b, 0x92, 0x41, 0x2c, 0x12, 0x12, 0x41, 0x64, 0x64, 0x20, 0x61, 0x20, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x69, 0x63, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x14, 0x41, 0x64, 0x64, 0x73, 0x20, + 0x61, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x58, + 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, - 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0xb7, 0x01, 0x0a, 0x10, 0x41, 0x64, - 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x22, - 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, + 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x88, 0x02, 0x01, 0x12, 0xbe, 0x01, + 0x0a, 0x10, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, + 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, + 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x61, 0x92, 0x41, 0x30, + 0x12, 0x14, 0x41, 0x64, 0x64, 0x20, 0x61, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x16, 0x41, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x58, 0x01, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x69, + 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, + 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x88, 0x02, 0x01, 0x12, 0xac, + 0x01, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x12, 0x1f, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, + 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, 0x41, 0x2a, 0x12, 0x11, 0x41, 0x64, 0x64, 0x20, 0x61, 0x20, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x13, 0x41, 0x64, 0x64, + 0x73, 0x20, 0x61, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, + 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, + 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x2f, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x88, 0x02, 0x01, 0x12, 0xc0, 0x01, + 0x0a, 0x10, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5a, 0x92, 0x41, 0x2c, 0x12, 0x13, 0x41, 0x64, - 0x64, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x52, 0x44, 0x53, 0x20, 0x4e, 0x6f, 0x64, - 0x65, 0x1a, 0x15, 0x41, 0x64, 0x64, 0x73, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x52, - 0x44, 0x53, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, - 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x52, 0x44, 0x53, 0x12, 0xf5, 0x01, 0x0a, 0x1a, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x12, 0x2c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, - 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, - 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, - 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x7a, 0x92, 0x41, 0x42, 0x12, 0x1e, 0x41, 0x64, 0x64, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x20, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x20, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x20, - 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x20, 0x41, 0x64, 0x64, 0x73, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x20, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, - 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x3a, 0x01, 0x2a, 0x22, - 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, - 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, - 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x0a, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x69, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x1c, 0x12, 0x0b, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x73, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, - 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x87, 0x01, - 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x42, - 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, - 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, - 0x6f, 0x72, 0x79, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x49, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0xca, 0x02, 0x09, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, - 0x6f, 0x72, 0x79, 0xe2, 0x02, 0x15, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x49, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, + 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x63, 0x92, 0x41, 0x32, + 0x12, 0x15, 0x41, 0x64, 0x64, 0x20, 0x61, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x52, + 0x44, 0x53, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x17, 0x41, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x52, 0x44, 0x53, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, + 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, + 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x2f, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x88, 0x02, 0x01, + 0x12, 0x80, 0x02, 0x0a, 0x1a, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, + 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, + 0x2c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, + 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x84, 0x01, 0x92, + 0x41, 0x49, 0x12, 0x21, 0x41, 0x64, 0x64, 0x61, 0x20, 0x61, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x20, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x20, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x22, 0x41, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x88, 0x02, 0x01, 0x12, 0x93, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x48, 0x92, 0x41, 0x20, 0x12, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x61, 0x20, 0x4e, + 0x6f, 0x64, 0x65, 0x1a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x20, 0x61, 0x20, 0x4e, + 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x2f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x87, 0x01, 0x0a, 0x0d, 0x63, 0x6f, + 0x6d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x0a, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, + 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x70, + 0x62, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0xca, 0x02, 0x09, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0xe2, + 0x02, 0x15, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2221,7 +2529,7 @@ func file_inventorypb_nodes_proto_rawDescGZIP() []byte { var ( file_inventorypb_nodes_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_inventorypb_nodes_proto_msgTypes = make([]protoimpl.MessageInfo, 31) + file_inventorypb_nodes_proto_msgTypes = make([]protoimpl.MessageInfo, 33) file_inventorypb_nodes_proto_goTypes = []interface{}{ (NodeType)(0), // 0: inventory.NodeType (*GenericNode)(nil), // 1: inventory.GenericNode @@ -2233,37 +2541,39 @@ var ( (*ListNodesResponse)(nil), // 7: inventory.ListNodesResponse (*GetNodeRequest)(nil), // 8: inventory.GetNodeRequest (*GetNodeResponse)(nil), // 9: inventory.GetNodeResponse - (*AddGenericNodeRequest)(nil), // 10: inventory.AddGenericNodeRequest - (*AddGenericNodeResponse)(nil), // 11: inventory.AddGenericNodeResponse - (*AddContainerNodeRequest)(nil), // 12: inventory.AddContainerNodeRequest - (*AddContainerNodeResponse)(nil), // 13: inventory.AddContainerNodeResponse - (*AddRemoteNodeRequest)(nil), // 14: inventory.AddRemoteNodeRequest - (*AddRemoteNodeResponse)(nil), // 15: inventory.AddRemoteNodeResponse - (*AddRemoteRDSNodeRequest)(nil), // 16: inventory.AddRemoteRDSNodeRequest - (*AddRemoteRDSNodeResponse)(nil), // 17: inventory.AddRemoteRDSNodeResponse - (*AddRemoteAzureDatabaseNodeRequest)(nil), // 18: inventory.AddRemoteAzureDatabaseNodeRequest - (*AddRemoteAzureDatabaseNodeResponse)(nil), // 19: inventory.AddRemoteAzureDatabaseNodeResponse - (*RemoveNodeRequest)(nil), // 20: inventory.RemoveNodeRequest - (*RemoveNodeResponse)(nil), // 21: inventory.RemoveNodeResponse - nil, // 22: inventory.GenericNode.CustomLabelsEntry - nil, // 23: inventory.ContainerNode.CustomLabelsEntry - nil, // 24: inventory.RemoteNode.CustomLabelsEntry - nil, // 25: inventory.RemoteRDSNode.CustomLabelsEntry - nil, // 26: inventory.RemoteAzureDatabaseNode.CustomLabelsEntry - nil, // 27: inventory.AddGenericNodeRequest.CustomLabelsEntry - nil, // 28: inventory.AddContainerNodeRequest.CustomLabelsEntry - nil, // 29: inventory.AddRemoteNodeRequest.CustomLabelsEntry - nil, // 30: inventory.AddRemoteRDSNodeRequest.CustomLabelsEntry - nil, // 31: inventory.AddRemoteAzureDatabaseNodeRequest.CustomLabelsEntry + (*AddNodeRequest)(nil), // 10: inventory.AddNodeRequest + (*AddNodeResponse)(nil), // 11: inventory.AddNodeResponse + (*AddGenericNodeRequest)(nil), // 12: inventory.AddGenericNodeRequest + (*AddGenericNodeResponse)(nil), // 13: inventory.AddGenericNodeResponse + (*AddContainerNodeRequest)(nil), // 14: inventory.AddContainerNodeRequest + (*AddContainerNodeResponse)(nil), // 15: inventory.AddContainerNodeResponse + (*AddRemoteNodeRequest)(nil), // 16: inventory.AddRemoteNodeRequest + (*AddRemoteNodeResponse)(nil), // 17: inventory.AddRemoteNodeResponse + (*AddRemoteRDSNodeRequest)(nil), // 18: inventory.AddRemoteRDSNodeRequest + (*AddRemoteRDSNodeResponse)(nil), // 19: inventory.AddRemoteRDSNodeResponse + (*AddRemoteAzureDatabaseNodeRequest)(nil), // 20: inventory.AddRemoteAzureDatabaseNodeRequest + (*AddRemoteAzureDatabaseNodeResponse)(nil), // 21: inventory.AddRemoteAzureDatabaseNodeResponse + (*RemoveNodeRequest)(nil), // 22: inventory.RemoveNodeRequest + (*RemoveNodeResponse)(nil), // 23: inventory.RemoveNodeResponse + nil, // 24: inventory.GenericNode.CustomLabelsEntry + nil, // 25: inventory.ContainerNode.CustomLabelsEntry + nil, // 26: inventory.RemoteNode.CustomLabelsEntry + nil, // 27: inventory.RemoteRDSNode.CustomLabelsEntry + nil, // 28: inventory.RemoteAzureDatabaseNode.CustomLabelsEntry + nil, // 29: inventory.AddGenericNodeRequest.CustomLabelsEntry + nil, // 30: inventory.AddContainerNodeRequest.CustomLabelsEntry + nil, // 31: inventory.AddRemoteNodeRequest.CustomLabelsEntry + nil, // 32: inventory.AddRemoteRDSNodeRequest.CustomLabelsEntry + nil, // 33: inventory.AddRemoteAzureDatabaseNodeRequest.CustomLabelsEntry } ) var file_inventorypb_nodes_proto_depIdxs = []int32{ - 22, // 0: inventory.GenericNode.custom_labels:type_name -> inventory.GenericNode.CustomLabelsEntry - 23, // 1: inventory.ContainerNode.custom_labels:type_name -> inventory.ContainerNode.CustomLabelsEntry - 24, // 2: inventory.RemoteNode.custom_labels:type_name -> inventory.RemoteNode.CustomLabelsEntry - 25, // 3: inventory.RemoteRDSNode.custom_labels:type_name -> inventory.RemoteRDSNode.CustomLabelsEntry - 26, // 4: inventory.RemoteAzureDatabaseNode.custom_labels:type_name -> inventory.RemoteAzureDatabaseNode.CustomLabelsEntry + 24, // 0: inventory.GenericNode.custom_labels:type_name -> inventory.GenericNode.CustomLabelsEntry + 25, // 1: inventory.ContainerNode.custom_labels:type_name -> inventory.ContainerNode.CustomLabelsEntry + 26, // 2: inventory.RemoteNode.custom_labels:type_name -> inventory.RemoteNode.CustomLabelsEntry + 27, // 3: inventory.RemoteRDSNode.custom_labels:type_name -> inventory.RemoteRDSNode.CustomLabelsEntry + 28, // 4: inventory.RemoteAzureDatabaseNode.custom_labels:type_name -> inventory.RemoteAzureDatabaseNode.CustomLabelsEntry 0, // 5: inventory.ListNodesRequest.node_type:type_name -> inventory.NodeType 1, // 6: inventory.ListNodesResponse.generic:type_name -> inventory.GenericNode 2, // 7: inventory.ListNodesResponse.container:type_name -> inventory.ContainerNode @@ -2275,37 +2585,49 @@ var file_inventorypb_nodes_proto_depIdxs = []int32{ 3, // 13: inventory.GetNodeResponse.remote:type_name -> inventory.RemoteNode 4, // 14: inventory.GetNodeResponse.remote_rds:type_name -> inventory.RemoteRDSNode 5, // 15: inventory.GetNodeResponse.remote_azure_database:type_name -> inventory.RemoteAzureDatabaseNode - 27, // 16: inventory.AddGenericNodeRequest.custom_labels:type_name -> inventory.AddGenericNodeRequest.CustomLabelsEntry - 1, // 17: inventory.AddGenericNodeResponse.generic:type_name -> inventory.GenericNode - 28, // 18: inventory.AddContainerNodeRequest.custom_labels:type_name -> inventory.AddContainerNodeRequest.CustomLabelsEntry - 2, // 19: inventory.AddContainerNodeResponse.container:type_name -> inventory.ContainerNode - 29, // 20: inventory.AddRemoteNodeRequest.custom_labels:type_name -> inventory.AddRemoteNodeRequest.CustomLabelsEntry - 3, // 21: inventory.AddRemoteNodeResponse.remote:type_name -> inventory.RemoteNode - 30, // 22: inventory.AddRemoteRDSNodeRequest.custom_labels:type_name -> inventory.AddRemoteRDSNodeRequest.CustomLabelsEntry - 4, // 23: inventory.AddRemoteRDSNodeResponse.remote_rds:type_name -> inventory.RemoteRDSNode - 31, // 24: inventory.AddRemoteAzureDatabaseNodeRequest.custom_labels:type_name -> inventory.AddRemoteAzureDatabaseNodeRequest.CustomLabelsEntry - 5, // 25: inventory.AddRemoteAzureDatabaseNodeResponse.remote_azure_database:type_name -> inventory.RemoteAzureDatabaseNode - 6, // 26: inventory.Nodes.ListNodes:input_type -> inventory.ListNodesRequest - 8, // 27: inventory.Nodes.GetNode:input_type -> inventory.GetNodeRequest - 10, // 28: inventory.Nodes.AddGenericNode:input_type -> inventory.AddGenericNodeRequest - 12, // 29: inventory.Nodes.AddContainerNode:input_type -> inventory.AddContainerNodeRequest - 14, // 30: inventory.Nodes.AddRemoteNode:input_type -> inventory.AddRemoteNodeRequest - 16, // 31: inventory.Nodes.AddRemoteRDSNode:input_type -> inventory.AddRemoteRDSNodeRequest - 18, // 32: inventory.Nodes.AddRemoteAzureDatabaseNode:input_type -> inventory.AddRemoteAzureDatabaseNodeRequest - 20, // 33: inventory.Nodes.RemoveNode:input_type -> inventory.RemoveNodeRequest - 7, // 34: inventory.Nodes.ListNodes:output_type -> inventory.ListNodesResponse - 9, // 35: inventory.Nodes.GetNode:output_type -> inventory.GetNodeResponse - 11, // 36: inventory.Nodes.AddGenericNode:output_type -> inventory.AddGenericNodeResponse - 13, // 37: inventory.Nodes.AddContainerNode:output_type -> inventory.AddContainerNodeResponse - 15, // 38: inventory.Nodes.AddRemoteNode:output_type -> inventory.AddRemoteNodeResponse - 17, // 39: inventory.Nodes.AddRemoteRDSNode:output_type -> inventory.AddRemoteRDSNodeResponse - 19, // 40: inventory.Nodes.AddRemoteAzureDatabaseNode:output_type -> inventory.AddRemoteAzureDatabaseNodeResponse - 21, // 41: inventory.Nodes.RemoveNode:output_type -> inventory.RemoveNodeResponse - 34, // [34:42] is the sub-list for method output_type - 26, // [26:34] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name + 12, // 16: inventory.AddNodeRequest.generic:type_name -> inventory.AddGenericNodeRequest + 14, // 17: inventory.AddNodeRequest.container:type_name -> inventory.AddContainerNodeRequest + 16, // 18: inventory.AddNodeRequest.remote:type_name -> inventory.AddRemoteNodeRequest + 18, // 19: inventory.AddNodeRequest.remote_rds:type_name -> inventory.AddRemoteRDSNodeRequest + 20, // 20: inventory.AddNodeRequest.remote_azure:type_name -> inventory.AddRemoteAzureDatabaseNodeRequest + 1, // 21: inventory.AddNodeResponse.generic:type_name -> inventory.GenericNode + 2, // 22: inventory.AddNodeResponse.container:type_name -> inventory.ContainerNode + 3, // 23: inventory.AddNodeResponse.remote:type_name -> inventory.RemoteNode + 4, // 24: inventory.AddNodeResponse.remote_rds:type_name -> inventory.RemoteRDSNode + 5, // 25: inventory.AddNodeResponse.remote_azure_database:type_name -> inventory.RemoteAzureDatabaseNode + 29, // 26: inventory.AddGenericNodeRequest.custom_labels:type_name -> inventory.AddGenericNodeRequest.CustomLabelsEntry + 1, // 27: inventory.AddGenericNodeResponse.generic:type_name -> inventory.GenericNode + 30, // 28: inventory.AddContainerNodeRequest.custom_labels:type_name -> inventory.AddContainerNodeRequest.CustomLabelsEntry + 2, // 29: inventory.AddContainerNodeResponse.container:type_name -> inventory.ContainerNode + 31, // 30: inventory.AddRemoteNodeRequest.custom_labels:type_name -> inventory.AddRemoteNodeRequest.CustomLabelsEntry + 3, // 31: inventory.AddRemoteNodeResponse.remote:type_name -> inventory.RemoteNode + 32, // 32: inventory.AddRemoteRDSNodeRequest.custom_labels:type_name -> inventory.AddRemoteRDSNodeRequest.CustomLabelsEntry + 4, // 33: inventory.AddRemoteRDSNodeResponse.remote_rds:type_name -> inventory.RemoteRDSNode + 33, // 34: inventory.AddRemoteAzureDatabaseNodeRequest.custom_labels:type_name -> inventory.AddRemoteAzureDatabaseNodeRequest.CustomLabelsEntry + 5, // 35: inventory.AddRemoteAzureDatabaseNodeResponse.remote_azure_database:type_name -> inventory.RemoteAzureDatabaseNode + 6, // 36: inventory.Nodes.ListNodes:input_type -> inventory.ListNodesRequest + 8, // 37: inventory.Nodes.GetNode:input_type -> inventory.GetNodeRequest + 10, // 38: inventory.Nodes.AddNode:input_type -> inventory.AddNodeRequest + 12, // 39: inventory.Nodes.AddGenericNode:input_type -> inventory.AddGenericNodeRequest + 14, // 40: inventory.Nodes.AddContainerNode:input_type -> inventory.AddContainerNodeRequest + 16, // 41: inventory.Nodes.AddRemoteNode:input_type -> inventory.AddRemoteNodeRequest + 18, // 42: inventory.Nodes.AddRemoteRDSNode:input_type -> inventory.AddRemoteRDSNodeRequest + 20, // 43: inventory.Nodes.AddRemoteAzureDatabaseNode:input_type -> inventory.AddRemoteAzureDatabaseNodeRequest + 22, // 44: inventory.Nodes.RemoveNode:input_type -> inventory.RemoveNodeRequest + 7, // 45: inventory.Nodes.ListNodes:output_type -> inventory.ListNodesResponse + 9, // 46: inventory.Nodes.GetNode:output_type -> inventory.GetNodeResponse + 11, // 47: inventory.Nodes.AddNode:output_type -> inventory.AddNodeResponse + 13, // 48: inventory.Nodes.AddGenericNode:output_type -> inventory.AddGenericNodeResponse + 15, // 49: inventory.Nodes.AddContainerNode:output_type -> inventory.AddContainerNodeResponse + 17, // 50: inventory.Nodes.AddRemoteNode:output_type -> inventory.AddRemoteNodeResponse + 19, // 51: inventory.Nodes.AddRemoteRDSNode:output_type -> inventory.AddRemoteRDSNodeResponse + 21, // 52: inventory.Nodes.AddRemoteAzureDatabaseNode:output_type -> inventory.AddRemoteAzureDatabaseNodeResponse + 23, // 53: inventory.Nodes.RemoveNode:output_type -> inventory.RemoveNodeResponse + 45, // [45:54] is the sub-list for method output_type + 36, // [36:45] is the sub-list for method input_type + 36, // [36:36] is the sub-list for extension type_name + 36, // [36:36] is the sub-list for extension extendee + 0, // [0:36] is the sub-list for field type_name } func init() { file_inventorypb_nodes_proto_init() } @@ -2423,7 +2745,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddGenericNodeRequest); i { + switch v := v.(*AddNodeRequest); i { case 0: return &v.state case 1: @@ -2435,7 +2757,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddGenericNodeResponse); i { + switch v := v.(*AddNodeResponse); i { case 0: return &v.state case 1: @@ -2447,7 +2769,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddContainerNodeRequest); i { + switch v := v.(*AddGenericNodeRequest); i { case 0: return &v.state case 1: @@ -2459,7 +2781,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddContainerNodeResponse); i { + switch v := v.(*AddGenericNodeResponse); i { case 0: return &v.state case 1: @@ -2471,7 +2793,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteNodeRequest); i { + switch v := v.(*AddContainerNodeRequest); i { case 0: return &v.state case 1: @@ -2483,7 +2805,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteNodeResponse); i { + switch v := v.(*AddContainerNodeResponse); i { case 0: return &v.state case 1: @@ -2495,7 +2817,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteRDSNodeRequest); i { + switch v := v.(*AddRemoteNodeRequest); i { case 0: return &v.state case 1: @@ -2507,7 +2829,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteRDSNodeResponse); i { + switch v := v.(*AddRemoteNodeResponse); i { case 0: return &v.state case 1: @@ -2519,7 +2841,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteAzureDatabaseNodeRequest); i { + switch v := v.(*AddRemoteRDSNodeRequest); i { case 0: return &v.state case 1: @@ -2531,7 +2853,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteAzureDatabaseNodeResponse); i { + switch v := v.(*AddRemoteRDSNodeResponse); i { case 0: return &v.state case 1: @@ -2543,7 +2865,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveNodeRequest); i { + switch v := v.(*AddRemoteAzureDatabaseNodeRequest); i { case 0: return &v.state case 1: @@ -2555,6 +2877,30 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddRemoteAzureDatabaseNodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventorypb_nodes_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventorypb_nodes_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveNodeResponse); i { case 0: return &v.state @@ -2574,13 +2920,27 @@ func file_inventorypb_nodes_proto_init() { (*GetNodeResponse_RemoteRds)(nil), (*GetNodeResponse_RemoteAzureDatabase)(nil), } + file_inventorypb_nodes_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*AddNodeRequest_Generic)(nil), + (*AddNodeRequest_Container)(nil), + (*AddNodeRequest_Remote)(nil), + (*AddNodeRequest_RemoteRds)(nil), + (*AddNodeRequest_RemoteAzure)(nil), + } + file_inventorypb_nodes_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*AddNodeResponse_Generic)(nil), + (*AddNodeResponse_Container)(nil), + (*AddNodeResponse_Remote)(nil), + (*AddNodeResponse_RemoteRds)(nil), + (*AddNodeResponse_RemoteAzureDatabase)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_inventorypb_nodes_proto_rawDesc, NumEnums: 1, - NumMessages: 31, + NumMessages: 33, NumExtensions: 0, NumServices: 1, }, diff --git a/api/inventorypb/nodes.pb.gw.go b/api/inventorypb/nodes.pb.gw.go index 91d1c6a5a5..9789ecfcb6 100644 --- a/api/inventorypb/nodes.pb.gw.go +++ b/api/inventorypb/nodes.pb.gw.go @@ -97,6 +97,38 @@ func local_request_Nodes_GetNode_0(ctx context.Context, marshaler runtime.Marsha return msg, metadata, err } +func request_Nodes_AddNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddNodeRequest + 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) + } + + msg, err := client.AddNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Nodes_AddNode_0(ctx context.Context, marshaler runtime.Marshaler, server NodesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddNodeRequest + 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) + } + + msg, err := server.AddNode(ctx, &protoReq) + return msg, metadata, err +} + func request_Nodes_AddGenericNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq AddGenericNodeRequest var metadata runtime.ServerMetadata @@ -342,6 +374,30 @@ func RegisterNodesHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv forward_Nodes_GetNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle("POST", pattern_Nodes_AddNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/inventory.Nodes/AddNode", runtime.WithHTTPPathPattern("/v1/inventory/Nodes/Add")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Nodes_AddNode_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Nodes_AddNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle("POST", pattern_Nodes_AddGenericNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -568,6 +624,27 @@ func RegisterNodesHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie forward_Nodes_GetNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle("POST", pattern_Nodes_AddNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/inventory.Nodes/AddNode", runtime.WithHTTPPathPattern("/v1/inventory/Nodes/Add")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Nodes_AddNode_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Nodes_AddNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle("POST", pattern_Nodes_AddGenericNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -702,6 +779,8 @@ var ( pattern_Nodes_GetNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "inventory", "Nodes", "Get"}, "")) + pattern_Nodes_AddNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "inventory", "Nodes", "Add"}, "")) + pattern_Nodes_AddGenericNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "inventory", "Nodes", "AddGeneric"}, "")) pattern_Nodes_AddContainerNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "inventory", "Nodes", "AddContainer"}, "")) @@ -720,6 +799,8 @@ var ( forward_Nodes_GetNode_0 = runtime.ForwardResponseMessage + forward_Nodes_AddNode_0 = runtime.ForwardResponseMessage + forward_Nodes_AddGenericNode_0 = runtime.ForwardResponseMessage forward_Nodes_AddContainerNode_0 = runtime.ForwardResponseMessage diff --git a/api/inventorypb/nodes.pb.validate.go b/api/inventorypb/nodes.pb.validate.go index 84b7fe914d..79c6ccb2fd 100644 --- a/api/inventorypb/nodes.pb.validate.go +++ b/api/inventorypb/nodes.pb.validate.go @@ -1410,6 +1410,626 @@ var _ interface { ErrorName() string } = GetNodeResponseValidationError{} +// Validate checks the field values on AddNodeRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *AddNodeRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on AddNodeRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in AddNodeRequestMultiError, +// or nil if none found. +func (m *AddNodeRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *AddNodeRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + switch v := m.Request.(type) { + case *AddNodeRequest_Generic: + if v == nil { + err := AddNodeRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetGeneric()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGeneric()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeRequestValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeRequest_Container: + if v == nil { + err := AddNodeRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetContainer()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetContainer()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeRequestValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeRequest_Remote: + if v == nil { + err := AddNodeRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemote()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemote()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeRequestValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeRequest_RemoteRds: + if v == nil { + err := AddNodeRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemoteRds()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemoteRds()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeRequestValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeRequest_RemoteAzure: + if v == nil { + err := AddNodeRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemoteAzure()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "RemoteAzure", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "RemoteAzure", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemoteAzure()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeRequestValidationError{ + field: "RemoteAzure", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return AddNodeRequestMultiError(errors) + } + + return nil +} + +// AddNodeRequestMultiError is an error wrapping multiple validation errors +// returned by AddNodeRequest.ValidateAll() if the designated constraints +// aren't met. +type AddNodeRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m AddNodeRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m AddNodeRequestMultiError) AllErrors() []error { return m } + +// AddNodeRequestValidationError is the validation error returned by +// AddNodeRequest.Validate if the designated constraints aren't met. +type AddNodeRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AddNodeRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AddNodeRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AddNodeRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AddNodeRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AddNodeRequestValidationError) ErrorName() string { return "AddNodeRequestValidationError" } + +// Error satisfies the builtin error interface +func (e AddNodeRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAddNodeRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AddNodeRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AddNodeRequestValidationError{} + +// Validate checks the field values on AddNodeResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *AddNodeResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on AddNodeResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// AddNodeResponseMultiError, or nil if none found. +func (m *AddNodeResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *AddNodeResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + switch v := m.Node.(type) { + case *AddNodeResponse_Generic: + if v == nil { + err := AddNodeResponseValidationError{ + field: "Node", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetGeneric()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGeneric()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeResponseValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeResponse_Container: + if v == nil { + err := AddNodeResponseValidationError{ + field: "Node", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetContainer()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetContainer()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeResponseValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeResponse_Remote: + if v == nil { + err := AddNodeResponseValidationError{ + field: "Node", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemote()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemote()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeResponseValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeResponse_RemoteRds: + if v == nil { + err := AddNodeResponseValidationError{ + field: "Node", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemoteRds()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemoteRds()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeResponseValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeResponse_RemoteAzureDatabase: + if v == nil { + err := AddNodeResponseValidationError{ + field: "Node", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemoteAzureDatabase()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "RemoteAzureDatabase", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "RemoteAzureDatabase", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemoteAzureDatabase()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeResponseValidationError{ + field: "RemoteAzureDatabase", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return AddNodeResponseMultiError(errors) + } + + return nil +} + +// AddNodeResponseMultiError is an error wrapping multiple validation errors +// returned by AddNodeResponse.ValidateAll() if the designated constraints +// aren't met. +type AddNodeResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m AddNodeResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m AddNodeResponseMultiError) AllErrors() []error { return m } + +// AddNodeResponseValidationError is the validation error returned by +// AddNodeResponse.Validate if the designated constraints aren't met. +type AddNodeResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AddNodeResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AddNodeResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AddNodeResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AddNodeResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AddNodeResponseValidationError) ErrorName() string { return "AddNodeResponseValidationError" } + +// Error satisfies the builtin error interface +func (e AddNodeResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAddNodeResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AddNodeResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AddNodeResponseValidationError{} + // Validate checks the field values on AddGenericNodeRequest with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. diff --git a/api/inventorypb/nodes.proto b/api/inventorypb/nodes.proto index 8ad0c3d36f..e14a3446d0 100644 --- a/api/inventorypb/nodes.proto +++ b/api/inventorypb/nodes.proto @@ -98,9 +98,6 @@ message RemoteRDSNode { string az = 6; // Custom user-assigned labels. map custom_labels = 7; - // TODO https://jira.percona.com/browse/PMM-4314 - // string az = 8; - // string node_model = 9; } // RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes. @@ -153,6 +150,28 @@ message GetNodeResponse { } } +// Add any Node + +message AddNodeRequest { + oneof request { + AddGenericNodeRequest generic = 1; + AddContainerNodeRequest container = 2; + AddRemoteNodeRequest remote = 3; + AddRemoteRDSNodeRequest remote_rds = 4; + AddRemoteAzureDatabaseNodeRequest remote_azure = 5; + } +} + +message AddNodeResponse { + oneof node { + GenericNode generic = 1; + ContainerNode container = 2; + RemoteNode remote = 3; + RemoteRDSNode remote_rds = 4; + RemoteAzureDatabaseNode remote_azure_database = 5; + } +} + // Add Generic message AddGenericNodeRequest { @@ -175,6 +194,8 @@ message AddGenericNodeRequest { } message AddGenericNodeResponse { + option deprecated = true; + GenericNode generic = 1; } @@ -202,6 +223,8 @@ message AddContainerNodeRequest { } message AddContainerNodeResponse { + option deprecated = true; + ContainerNode container = 1; } @@ -223,6 +246,8 @@ message AddRemoteNodeRequest { } message AddRemoteNodeResponse { + option deprecated = true; + RemoteNode remote = 1; } @@ -244,6 +269,8 @@ message AddRemoteRDSNodeRequest { } message AddRemoteRDSNodeResponse { + option deprecated = true; + RemoteRDSNode remote_rds = 1; } @@ -265,6 +292,8 @@ message AddRemoteAzureDatabaseNodeRequest { } message AddRemoteAzureDatabaseNodeResponse { + option deprecated = true; + RemoteAzureDatabaseNode remote_azure_database = 1; } @@ -303,70 +332,91 @@ service Nodes { description: "Returns a single Node by ID." }; } - // AddGenericNode adds generic Node. + // AddNode adds any type of Node. + rpc AddNode(AddNodeRequest) returns (AddNodeResponse) { + option (google.api.http) = { + post: "/v1/inventory/Nodes/Add" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Add Node" + description: "Adds a Node." + }; + } + // AddGenericNode adds a generic Node. rpc AddGenericNode(AddGenericNodeRequest) returns (AddGenericNodeResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/inventory/Nodes/AddGeneric" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Generic Node" - description: "Adds generic Node." + deprecated: true + summary: "Add a Generic Node" + description: "Adds a generic Node." }; } - // AddContainerNode adds Container Node. + // AddContainerNode adds a container Node. rpc AddContainerNode(AddContainerNodeRequest) returns (AddContainerNodeResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/inventory/Nodes/AddContainer" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Container Node" - description: "Adds container Node." + deprecated: true + summary: "Add a Container Node" + description: "Adds a container Node." }; } - // AddRemoteNode adds remote Node. + // AddRemoteNode adds a remote Node. rpc AddRemoteNode(AddRemoteNodeRequest) returns (AddRemoteNodeResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/inventory/Nodes/AddRemote" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Remote Node" - description: "Adds remote Node." + deprecated: true + summary: "Add a Remote Node" + description: "Adds a remote Node." }; } - // AddRemoteRDSNode adds remote RDS Node. + // AddRemoteRDSNode adds a remote RDS Node. rpc AddRemoteRDSNode(AddRemoteRDSNodeRequest) returns (AddRemoteRDSNodeResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/inventory/Nodes/AddRemoteRDS" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Remote RDS Node" - description: "Adds remote RDS Node." + deprecated: true + summary: "Add a Remote RDS Node" + description: "Adds a remote RDS Node." }; } - // AddRemoteAzureDatabaseNode adds remote Azure database Node. + // AddRemoteAzureDatabaseNode adds a remote Azure database Node. rpc AddRemoteAzureDatabaseNode(AddRemoteAzureDatabaseNodeRequest) returns (AddRemoteAzureDatabaseNodeResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/inventory/Nodes/AddRemoteAzureDatabase" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Remote Azure Database Node" - description: "Adds remote Azure database Node." + deprecated: true + summary: "Adda a Remote Azure Database Node" + description: "Adds a remote Azure database Node." }; } - // RemoveNode removes Node. + // RemoveNode removes a Node. rpc RemoveNode(RemoveNodeRequest) returns (RemoveNodeResponse) { option (google.api.http) = { post: "/v1/inventory/Nodes/Remove" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Remove Node" - description: "Removes Node." + summary: "Remove a Node" + description: "Removes a Node." }; } } diff --git a/api/inventorypb/nodes_grpc.pb.go b/api/inventorypb/nodes_grpc.pb.go index 372069998c..1cf7c5bed6 100644 --- a/api/inventorypb/nodes_grpc.pb.go +++ b/api/inventorypb/nodes_grpc.pb.go @@ -22,6 +22,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( Nodes_ListNodes_FullMethodName = "/inventory.Nodes/ListNodes" Nodes_GetNode_FullMethodName = "/inventory.Nodes/GetNode" + Nodes_AddNode_FullMethodName = "/inventory.Nodes/AddNode" Nodes_AddGenericNode_FullMethodName = "/inventory.Nodes/AddGenericNode" Nodes_AddContainerNode_FullMethodName = "/inventory.Nodes/AddContainerNode" Nodes_AddRemoteNode_FullMethodName = "/inventory.Nodes/AddRemoteNode" @@ -38,17 +39,24 @@ type NodesClient interface { ListNodes(ctx context.Context, in *ListNodesRequest, opts ...grpc.CallOption) (*ListNodesResponse, error) // GetNode returns a single Node by ID. GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) - // AddGenericNode adds generic Node. + // AddNode adds any type of Node. + AddNode(ctx context.Context, in *AddNodeRequest, opts ...grpc.CallOption) (*AddNodeResponse, error) + // Deprecated: Do not use. + // AddGenericNode adds a generic Node. AddGenericNode(ctx context.Context, in *AddGenericNodeRequest, opts ...grpc.CallOption) (*AddGenericNodeResponse, error) - // AddContainerNode adds Container Node. + // Deprecated: Do not use. + // AddContainerNode adds a container Node. AddContainerNode(ctx context.Context, in *AddContainerNodeRequest, opts ...grpc.CallOption) (*AddContainerNodeResponse, error) - // AddRemoteNode adds remote Node. + // Deprecated: Do not use. + // AddRemoteNode adds a remote Node. AddRemoteNode(ctx context.Context, in *AddRemoteNodeRequest, opts ...grpc.CallOption) (*AddRemoteNodeResponse, error) - // AddRemoteRDSNode adds remote RDS Node. + // Deprecated: Do not use. + // AddRemoteRDSNode adds a remote RDS Node. AddRemoteRDSNode(ctx context.Context, in *AddRemoteRDSNodeRequest, opts ...grpc.CallOption) (*AddRemoteRDSNodeResponse, error) - // AddRemoteAzureDatabaseNode adds remote Azure database Node. + // Deprecated: Do not use. + // AddRemoteAzureDatabaseNode adds a remote Azure database Node. AddRemoteAzureDatabaseNode(ctx context.Context, in *AddRemoteAzureDatabaseNodeRequest, opts ...grpc.CallOption) (*AddRemoteAzureDatabaseNodeResponse, error) - // RemoveNode removes Node. + // RemoveNode removes a Node. RemoveNode(ctx context.Context, in *RemoveNodeRequest, opts ...grpc.CallOption) (*RemoveNodeResponse, error) } @@ -78,6 +86,16 @@ func (c *nodesClient) GetNode(ctx context.Context, in *GetNodeRequest, opts ...g return out, nil } +func (c *nodesClient) AddNode(ctx context.Context, in *AddNodeRequest, opts ...grpc.CallOption) (*AddNodeResponse, error) { + out := new(AddNodeResponse) + err := c.cc.Invoke(ctx, Nodes_AddNode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. func (c *nodesClient) AddGenericNode(ctx context.Context, in *AddGenericNodeRequest, opts ...grpc.CallOption) (*AddGenericNodeResponse, error) { out := new(AddGenericNodeResponse) err := c.cc.Invoke(ctx, Nodes_AddGenericNode_FullMethodName, in, out, opts...) @@ -87,6 +105,7 @@ func (c *nodesClient) AddGenericNode(ctx context.Context, in *AddGenericNodeRequ return out, nil } +// Deprecated: Do not use. func (c *nodesClient) AddContainerNode(ctx context.Context, in *AddContainerNodeRequest, opts ...grpc.CallOption) (*AddContainerNodeResponse, error) { out := new(AddContainerNodeResponse) err := c.cc.Invoke(ctx, Nodes_AddContainerNode_FullMethodName, in, out, opts...) @@ -96,6 +115,7 @@ func (c *nodesClient) AddContainerNode(ctx context.Context, in *AddContainerNode return out, nil } +// Deprecated: Do not use. func (c *nodesClient) AddRemoteNode(ctx context.Context, in *AddRemoteNodeRequest, opts ...grpc.CallOption) (*AddRemoteNodeResponse, error) { out := new(AddRemoteNodeResponse) err := c.cc.Invoke(ctx, Nodes_AddRemoteNode_FullMethodName, in, out, opts...) @@ -105,6 +125,7 @@ func (c *nodesClient) AddRemoteNode(ctx context.Context, in *AddRemoteNodeReques return out, nil } +// Deprecated: Do not use. func (c *nodesClient) AddRemoteRDSNode(ctx context.Context, in *AddRemoteRDSNodeRequest, opts ...grpc.CallOption) (*AddRemoteRDSNodeResponse, error) { out := new(AddRemoteRDSNodeResponse) err := c.cc.Invoke(ctx, Nodes_AddRemoteRDSNode_FullMethodName, in, out, opts...) @@ -114,6 +135,7 @@ func (c *nodesClient) AddRemoteRDSNode(ctx context.Context, in *AddRemoteRDSNode return out, nil } +// Deprecated: Do not use. func (c *nodesClient) AddRemoteAzureDatabaseNode(ctx context.Context, in *AddRemoteAzureDatabaseNodeRequest, opts ...grpc.CallOption) (*AddRemoteAzureDatabaseNodeResponse, error) { out := new(AddRemoteAzureDatabaseNodeResponse) err := c.cc.Invoke(ctx, Nodes_AddRemoteAzureDatabaseNode_FullMethodName, in, out, opts...) @@ -140,17 +162,24 @@ type NodesServer interface { ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) // GetNode returns a single Node by ID. GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) - // AddGenericNode adds generic Node. + // AddNode adds any type of Node. + AddNode(context.Context, *AddNodeRequest) (*AddNodeResponse, error) + // Deprecated: Do not use. + // AddGenericNode adds a generic Node. AddGenericNode(context.Context, *AddGenericNodeRequest) (*AddGenericNodeResponse, error) - // AddContainerNode adds Container Node. + // Deprecated: Do not use. + // AddContainerNode adds a container Node. AddContainerNode(context.Context, *AddContainerNodeRequest) (*AddContainerNodeResponse, error) - // AddRemoteNode adds remote Node. + // Deprecated: Do not use. + // AddRemoteNode adds a remote Node. AddRemoteNode(context.Context, *AddRemoteNodeRequest) (*AddRemoteNodeResponse, error) - // AddRemoteRDSNode adds remote RDS Node. + // Deprecated: Do not use. + // AddRemoteRDSNode adds a remote RDS Node. AddRemoteRDSNode(context.Context, *AddRemoteRDSNodeRequest) (*AddRemoteRDSNodeResponse, error) - // AddRemoteAzureDatabaseNode adds remote Azure database Node. + // Deprecated: Do not use. + // AddRemoteAzureDatabaseNode adds a remote Azure database Node. AddRemoteAzureDatabaseNode(context.Context, *AddRemoteAzureDatabaseNodeRequest) (*AddRemoteAzureDatabaseNodeResponse, error) - // RemoveNode removes Node. + // RemoveNode removes a Node. RemoveNode(context.Context, *RemoveNodeRequest) (*RemoveNodeResponse, error) mustEmbedUnimplementedNodesServer() } @@ -166,6 +195,10 @@ func (UnimplementedNodesServer) GetNode(context.Context, *GetNodeRequest) (*GetN return nil, status.Errorf(codes.Unimplemented, "method GetNode not implemented") } +func (UnimplementedNodesServer) AddNode(context.Context, *AddNodeRequest) (*AddNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddNode not implemented") +} + func (UnimplementedNodesServer) AddGenericNode(context.Context, *AddGenericNodeRequest) (*AddGenericNodeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddGenericNode not implemented") } @@ -238,6 +271,24 @@ func _Nodes_GetNode_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Nodes_AddNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodesServer).AddNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Nodes_AddNode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodesServer).AddNode(ctx, req.(*AddNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Nodes_AddGenericNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddGenericNodeRequest) if err := dec(in); err != nil { @@ -361,6 +412,10 @@ var Nodes_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetNode", Handler: _Nodes_GetNode_Handler, }, + { + MethodName: "AddNode", + Handler: _Nodes_AddNode_Handler, + }, { MethodName: "AddGenericNode", Handler: _Nodes_AddGenericNode_Handler, diff --git a/api/inventorypb/nodes_test.go b/api/inventorypb/nodes_test.go index b677e27239..722cae686d 100644 --- a/api/inventorypb/nodes_test.go +++ b/api/inventorypb/nodes_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -28,7 +28,7 @@ import ( // names is up to date with the types defined in Nodetype_name by the proto definition // by calling the NodetypeName function using the values from protobuf and it expects the // result is a non-empty string, meaning that the NodetypeNames list matches the proto -// definitions +// definitions. func TestNodeTypes(t *testing.T) { for _, val := range NodeType_name { if strings.HasSuffix(val, "INVALID") { diff --git a/api/inventorypb/services.go b/api/inventorypb/services.go index 2c2162b87c..fba1cb6495 100644 --- a/api/inventorypb/services.go +++ b/api/inventorypb/services.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -22,7 +22,7 @@ type Service interface { sealedService() } -// Ordered the same as ServiceType enum +// Ordered the same as ServiceType enum. func (*MySQLService) sealedService() {} func (*MongoDBService) sealedService() {} diff --git a/api/inventorypb/services.pb.go b/api/inventorypb/services.pb.go index f187ecaec2..bf39b9164e 100644 --- a/api/inventorypb/services.pb.go +++ b/api/inventorypb/services.pb.go @@ -2519,6 +2519,123 @@ func (*RemoveCustomLabelsResponse) Descriptor() ([]byte, []int) { return file_inventorypb_services_proto_rawDescGZIP(), []int{29} } +type ChangeServiceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + Environment *string `protobuf:"bytes,2,opt,name=environment,proto3,oneof" json:"environment,omitempty"` + Cluster *string `protobuf:"bytes,3,opt,name=cluster,proto3,oneof" json:"cluster,omitempty"` + ReplicationSet *string `protobuf:"bytes,4,opt,name=replication_set,json=replicationSet,proto3,oneof" json:"replication_set,omitempty"` + ExternalGroup *string `protobuf:"bytes,5,opt,name=external_group,json=externalGroup,proto3,oneof" json:"external_group,omitempty"` +} + +func (x *ChangeServiceRequest) Reset() { + *x = ChangeServiceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_inventorypb_services_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeServiceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeServiceRequest) ProtoMessage() {} + +func (x *ChangeServiceRequest) ProtoReflect() protoreflect.Message { + mi := &file_inventorypb_services_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeServiceRequest.ProtoReflect.Descriptor instead. +func (*ChangeServiceRequest) Descriptor() ([]byte, []int) { + return file_inventorypb_services_proto_rawDescGZIP(), []int{30} +} + +func (x *ChangeServiceRequest) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +func (x *ChangeServiceRequest) GetEnvironment() string { + if x != nil && x.Environment != nil { + return *x.Environment + } + return "" +} + +func (x *ChangeServiceRequest) GetCluster() string { + if x != nil && x.Cluster != nil { + return *x.Cluster + } + return "" +} + +func (x *ChangeServiceRequest) GetReplicationSet() string { + if x != nil && x.ReplicationSet != nil { + return *x.ReplicationSet + } + return "" +} + +func (x *ChangeServiceRequest) GetExternalGroup() string { + if x != nil && x.ExternalGroup != nil { + return *x.ExternalGroup + } + return "" +} + +type ChangeServiceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChangeServiceResponse) Reset() { + *x = ChangeServiceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_inventorypb_services_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeServiceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeServiceResponse) ProtoMessage() {} + +func (x *ChangeServiceResponse) ProtoReflect() protoreflect.Message { + mi := &file_inventorypb_services_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeServiceResponse.ProtoReflect.Descriptor instead. +func (*ChangeServiceResponse) Descriptor() ([]byte, []int) { + return file_inventorypb_services_proto_rawDescGZIP(), []int{31} +} + var File_inventorypb_services_proto protoreflect.FileDescriptor var file_inventorypb_services_proto_rawDesc = []byte{ @@ -2972,167 +3089,208 @@ var file_inventorypb_services_proto_rawDesc = []byte{ 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x1c, 0x0a, 0x1a, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2a, 0xa8, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4d, - 0x59, 0x53, 0x51, 0x4c, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x01, 0x12, 0x13, - 0x0a, 0x0f, 0x4d, 0x4f, 0x4e, 0x47, 0x4f, 0x44, 0x42, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, - 0x45, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45, 0x53, 0x51, - 0x4c, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x50, - 0x52, 0x4f, 0x58, 0x59, 0x53, 0x51, 0x4c, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, - 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x48, 0x41, 0x50, 0x52, 0x4f, 0x58, 0x59, 0x5f, 0x53, 0x45, 0x52, - 0x56, 0x49, 0x43, 0x45, 0x10, 0x06, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, - 0x41, 0x4c, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x05, 0x32, 0xd7, 0x12, 0x0a, - 0x08, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0xb7, 0x01, 0x0a, 0x0c, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x69, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x69, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x66, 0x92, 0x41, 0x3d, - 0x12, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x1a, - 0x2c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, - 0x6f, 0x66, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, - 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x4c, - 0x69, 0x73, 0x74, 0x12, 0xe1, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x28, - 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x72, 0x92, 0x41, 0x44, 0x12, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x54, 0x79, - 0x70, 0x65, 0x73, 0x1a, 0x27, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, - 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x4c, 0x69, - 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, - 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x56, 0x92, 0x41, 0x2e, 0x12, 0x0b, 0x47, 0x65, 0x74, 0x20, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x1f, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, - 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, - 0x62, 0x79, 0x20, 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, - 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x12, 0xaf, 0x01, 0x0a, 0x0f, - 0x41, 0x64, 0x64, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x21, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x4d, - 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x92, 0x41, 0x28, 0x12, 0x11, 0x41, 0x64, 0x64, - 0x20, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x13, - 0x41, 0x64, 0x64, 0x73, 0x20, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, + 0x65, 0x22, 0xa1, 0x02, 0x0a, 0x14, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, + 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x07, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x02, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x74, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, + 0x52, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x88, + 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, + 0x6e, 0x74, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x42, 0x12, + 0x0a, 0x10, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, + 0x65, 0x74, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x17, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0xa8, + 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, + 0x0a, 0x14, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4d, 0x59, 0x53, 0x51, + 0x4c, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x4d, + 0x4f, 0x4e, 0x47, 0x4f, 0x44, 0x42, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x02, + 0x12, 0x16, 0x0a, 0x12, 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45, 0x53, 0x51, 0x4c, 0x5f, 0x53, + 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x52, 0x4f, 0x58, + 0x59, 0x53, 0x51, 0x4c, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x04, 0x12, 0x13, + 0x0a, 0x0f, 0x48, 0x41, 0x50, 0x52, 0x4f, 0x58, 0x59, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, + 0x45, 0x10, 0x06, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, + 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x05, 0x32, 0xaa, 0x15, 0x0a, 0x08, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0xb7, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x66, 0x92, 0x41, 0x3d, 0x12, 0x0d, 0x4c, + 0x69, 0x73, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x2c, 0x52, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, + 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, + 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, + 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0xe1, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x28, 0x2e, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, + 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x72, 0x92, 0x41, 0x44, 0x12, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x54, 0x79, 0x70, 0x65, 0x73, + 0x1a, 0x27, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, + 0x20, 0x6f, 0x66, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, + 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, + 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, + 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x56, 0x92, 0x41, 0x2e, 0x12, 0x0b, 0x47, 0x65, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x1a, 0x1f, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x62, 0x79, 0x20, + 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x12, 0xbb, 0x01, - 0x0a, 0x11, 0x41, 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, - 0x41, 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5b, - 0x92, 0x41, 0x2c, 0x12, 0x13, 0x41, 0x64, 0x64, 0x20, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, - 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x15, 0x41, 0x64, 0x64, 0x73, 0x20, 0x4d, - 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2f, 0x41, 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x12, 0xcd, 0x01, 0x0a, 0x14, - 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x26, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x69, - 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x74, - 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x92, 0x41, 0x32, 0x12, 0x16, 0x41, 0x64, 0x64, 0x20, - 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x1a, 0x18, 0x41, 0x64, 0x64, 0x73, 0x20, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, - 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, + 0x69, 0x63, 0x65, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x12, 0xaf, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x64, + 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x21, 0x2e, 0x69, + 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x79, 0x53, 0x51, + 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x4d, + 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x55, 0x92, 0x41, 0x28, 0x12, 0x11, 0x41, 0x64, 0x64, 0x20, 0x4d, 0x79, + 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x13, 0x41, 0x64, 0x64, + 0x73, 0x20, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x69, + 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x2f, 0x41, 0x64, 0x64, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x12, 0xbb, 0x01, 0x0a, 0x11, 0x41, + 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, + 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, + 0x79, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5b, 0x92, 0x41, 0x2c, + 0x12, 0x13, 0x41, 0x64, 0x64, 0x20, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x20, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x15, 0x41, 0x64, 0x64, 0x73, 0x20, 0x4d, 0x6f, 0x6e, 0x67, + 0x6f, 0x44, 0x42, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x41, 0x64, - 0x64, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x12, 0xc1, 0x01, 0x0a, 0x12, - 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x24, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x5e, 0x92, 0x41, 0x2e, 0x12, 0x14, 0x41, 0x64, 0x64, 0x20, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, - 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x16, 0x41, 0x64, 0x64, 0x73, - 0x20, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, - 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x12, - 0xc2, 0x01, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, - 0x79, 0x2e, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x69, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, - 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x62, 0x92, 0x41, 0x2c, 0x12, 0x13, 0x41, 0x64, 0x64, 0x20, 0x48, 0x41, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x15, 0x41, 0x64, 0x64, 0x73, - 0x20, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x2f, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0xc8, 0x01, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x45, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, - 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x65, 0x92, 0x41, 0x2e, 0x12, 0x14, 0x41, - 0x64, 0x64, 0x20, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x1a, 0x16, 0x41, 0x64, 0x64, 0x73, 0x20, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x2e, 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, - 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, - 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0xa1, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x1f, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x92, 0x41, 0x22, 0x12, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x10, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, - 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x12, 0xee, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x21, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x64, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x44, 0x42, 0x12, 0xcd, 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, + 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x26, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, + 0x64, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x69, 0x6e, 0x76, 0x65, + 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, + 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x64, 0x92, 0x41, 0x32, 0x12, 0x16, 0x41, 0x64, 0x64, 0x20, 0x50, 0x6f, 0x73, + 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, + 0x18, 0x41, 0x64, 0x64, 0x73, 0x20, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, + 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, + 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, + 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x50, 0x6f, + 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, 0x4c, 0x12, 0xc1, 0x01, 0x0a, 0x12, 0x41, 0x64, 0x64, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x24, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x50, + 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, + 0x79, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0x92, 0x41, + 0x2e, 0x12, 0x14, 0x41, 0x64, 0x64, 0x20, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x20, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x16, 0x41, 0x64, 0x64, 0x73, 0x20, 0x50, 0x72, + 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2f, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x12, 0xc2, 0x01, 0x0a, + 0x11, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, + 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x62, 0x92, + 0x41, 0x2c, 0x12, 0x13, 0x41, 0x64, 0x64, 0x20, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x20, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x15, 0x41, 0x64, 0x64, 0x73, 0x20, 0x48, 0x41, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, + 0x41, 0x64, 0x64, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0xc8, 0x01, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, + 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, + 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x65, 0x92, 0x41, 0x2e, 0x12, 0x14, 0x41, 0x64, 0x64, 0x20, + 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x1a, 0x16, 0x41, 0x64, 0x64, 0x73, 0x20, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x3a, 0x01, + 0x2a, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, + 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x45, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xa1, 0x01, 0x0a, + 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, + 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x4d, 0x92, 0x41, 0x22, 0x12, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x10, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x20, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, + 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, + 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x12, 0xee, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x12, 0x21, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, + 0x2e, 0x41, 0x64, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x69, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x93, - 0x01, 0x92, 0x41, 0x5e, 0x12, 0x19, 0x41, 0x64, 0x64, 0x2f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, - 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, - 0x41, 0x41, 0x64, 0x64, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, - 0x73, 0x20, 0x28, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x65, 0x78, - 0x69, 0x73, 0x74, 0x73, 0x29, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a, 0x01, 0x2a, 0x22, 0x27, 0x2f, 0x76, 0x31, - 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x2f, 0x41, 0x64, 0x64, 0x12, 0xdf, 0x01, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, 0x92, 0x41, 0x44, 0x12, 0x14, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x1a, 0x2c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x20, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, - 0x61, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x62, 0x79, 0x20, 0x6b, 0x65, 0x79, - 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2f, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x8a, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x69, + 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x93, 0x01, 0x92, 0x41, + 0x5e, 0x12, 0x19, 0x41, 0x64, 0x64, 0x2f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x20, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x41, 0x41, 0x64, + 0x64, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x20, 0x28, + 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, + 0x73, 0x29, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a, 0x01, 0x2a, 0x22, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2f, 0x41, 0x64, + 0x64, 0x12, 0xdf, 0x01, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, + 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, + 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, 0x92, 0x41, 0x44, 0x12, 0x14, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x1a, 0x2c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x61, 0x20, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x62, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, + 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2f, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x12, 0xd0, 0x02, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, + 0x79, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, + 0x72, 0x79, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xfb, 0x01, 0x92, 0x41, 0xcf, 0x01, 0x12, + 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, + 0xbc, 0x01, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x20, 0x49, 0x66, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x20, 0x69, 0x73, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, + 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x72, 0x65, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x20, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x20, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x65, 0x64, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x20, 0x46, 0x61, + 0x69, 0x6c, 0x73, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x72, 0x65, + 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2f, + 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x8a, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, @@ -3158,7 +3316,7 @@ func file_inventorypb_services_proto_rawDescGZIP() []byte { var ( file_inventorypb_services_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_inventorypb_services_proto_msgTypes = make([]protoimpl.MessageInfo, 43) + file_inventorypb_services_proto_msgTypes = make([]protoimpl.MessageInfo, 45) file_inventorypb_services_proto_goTypes = []interface{}{ (ServiceType)(0), // 0: inventory.ServiceType (*MySQLService)(nil), // 1: inventory.MySQLService @@ -3191,29 +3349,31 @@ var ( (*AddCustomLabelsResponse)(nil), // 28: inventory.AddCustomLabelsResponse (*RemoveCustomLabelsRequest)(nil), // 29: inventory.RemoveCustomLabelsRequest (*RemoveCustomLabelsResponse)(nil), // 30: inventory.RemoveCustomLabelsResponse - nil, // 31: inventory.MySQLService.CustomLabelsEntry - nil, // 32: inventory.MongoDBService.CustomLabelsEntry - nil, // 33: inventory.PostgreSQLService.CustomLabelsEntry - nil, // 34: inventory.ProxySQLService.CustomLabelsEntry - nil, // 35: inventory.HAProxyService.CustomLabelsEntry - nil, // 36: inventory.ExternalService.CustomLabelsEntry - nil, // 37: inventory.AddMySQLServiceRequest.CustomLabelsEntry - nil, // 38: inventory.AddMongoDBServiceRequest.CustomLabelsEntry - nil, // 39: inventory.AddPostgreSQLServiceRequest.CustomLabelsEntry - nil, // 40: inventory.AddProxySQLServiceRequest.CustomLabelsEntry - nil, // 41: inventory.AddHAProxyServiceRequest.CustomLabelsEntry - nil, // 42: inventory.AddExternalServiceRequest.CustomLabelsEntry - nil, // 43: inventory.AddCustomLabelsRequest.CustomLabelsEntry + (*ChangeServiceRequest)(nil), // 31: inventory.ChangeServiceRequest + (*ChangeServiceResponse)(nil), // 32: inventory.ChangeServiceResponse + nil, // 33: inventory.MySQLService.CustomLabelsEntry + nil, // 34: inventory.MongoDBService.CustomLabelsEntry + nil, // 35: inventory.PostgreSQLService.CustomLabelsEntry + nil, // 36: inventory.ProxySQLService.CustomLabelsEntry + nil, // 37: inventory.HAProxyService.CustomLabelsEntry + nil, // 38: inventory.ExternalService.CustomLabelsEntry + nil, // 39: inventory.AddMySQLServiceRequest.CustomLabelsEntry + nil, // 40: inventory.AddMongoDBServiceRequest.CustomLabelsEntry + nil, // 41: inventory.AddPostgreSQLServiceRequest.CustomLabelsEntry + nil, // 42: inventory.AddProxySQLServiceRequest.CustomLabelsEntry + nil, // 43: inventory.AddHAProxyServiceRequest.CustomLabelsEntry + nil, // 44: inventory.AddExternalServiceRequest.CustomLabelsEntry + nil, // 45: inventory.AddCustomLabelsRequest.CustomLabelsEntry } ) var file_inventorypb_services_proto_depIdxs = []int32{ - 31, // 0: inventory.MySQLService.custom_labels:type_name -> inventory.MySQLService.CustomLabelsEntry - 32, // 1: inventory.MongoDBService.custom_labels:type_name -> inventory.MongoDBService.CustomLabelsEntry - 33, // 2: inventory.PostgreSQLService.custom_labels:type_name -> inventory.PostgreSQLService.CustomLabelsEntry - 34, // 3: inventory.ProxySQLService.custom_labels:type_name -> inventory.ProxySQLService.CustomLabelsEntry - 35, // 4: inventory.HAProxyService.custom_labels:type_name -> inventory.HAProxyService.CustomLabelsEntry - 36, // 5: inventory.ExternalService.custom_labels:type_name -> inventory.ExternalService.CustomLabelsEntry + 33, // 0: inventory.MySQLService.custom_labels:type_name -> inventory.MySQLService.CustomLabelsEntry + 34, // 1: inventory.MongoDBService.custom_labels:type_name -> inventory.MongoDBService.CustomLabelsEntry + 35, // 2: inventory.PostgreSQLService.custom_labels:type_name -> inventory.PostgreSQLService.CustomLabelsEntry + 36, // 3: inventory.ProxySQLService.custom_labels:type_name -> inventory.ProxySQLService.CustomLabelsEntry + 37, // 4: inventory.HAProxyService.custom_labels:type_name -> inventory.HAProxyService.CustomLabelsEntry + 38, // 5: inventory.ExternalService.custom_labels:type_name -> inventory.ExternalService.CustomLabelsEntry 0, // 6: inventory.ListServicesRequest.service_type:type_name -> inventory.ServiceType 1, // 7: inventory.ListServicesResponse.mysql:type_name -> inventory.MySQLService 2, // 8: inventory.ListServicesResponse.mongodb:type_name -> inventory.MongoDBService @@ -3228,19 +3388,19 @@ var file_inventorypb_services_proto_depIdxs = []int32{ 4, // 17: inventory.GetServiceResponse.proxysql:type_name -> inventory.ProxySQLService 5, // 18: inventory.GetServiceResponse.haproxy:type_name -> inventory.HAProxyService 6, // 19: inventory.GetServiceResponse.external:type_name -> inventory.ExternalService - 37, // 20: inventory.AddMySQLServiceRequest.custom_labels:type_name -> inventory.AddMySQLServiceRequest.CustomLabelsEntry + 39, // 20: inventory.AddMySQLServiceRequest.custom_labels:type_name -> inventory.AddMySQLServiceRequest.CustomLabelsEntry 1, // 21: inventory.AddMySQLServiceResponse.mysql:type_name -> inventory.MySQLService - 38, // 22: inventory.AddMongoDBServiceRequest.custom_labels:type_name -> inventory.AddMongoDBServiceRequest.CustomLabelsEntry + 40, // 22: inventory.AddMongoDBServiceRequest.custom_labels:type_name -> inventory.AddMongoDBServiceRequest.CustomLabelsEntry 2, // 23: inventory.AddMongoDBServiceResponse.mongodb:type_name -> inventory.MongoDBService - 39, // 24: inventory.AddPostgreSQLServiceRequest.custom_labels:type_name -> inventory.AddPostgreSQLServiceRequest.CustomLabelsEntry + 41, // 24: inventory.AddPostgreSQLServiceRequest.custom_labels:type_name -> inventory.AddPostgreSQLServiceRequest.CustomLabelsEntry 3, // 25: inventory.AddPostgreSQLServiceResponse.postgresql:type_name -> inventory.PostgreSQLService - 40, // 26: inventory.AddProxySQLServiceRequest.custom_labels:type_name -> inventory.AddProxySQLServiceRequest.CustomLabelsEntry + 42, // 26: inventory.AddProxySQLServiceRequest.custom_labels:type_name -> inventory.AddProxySQLServiceRequest.CustomLabelsEntry 4, // 27: inventory.AddProxySQLServiceResponse.proxysql:type_name -> inventory.ProxySQLService - 41, // 28: inventory.AddHAProxyServiceRequest.custom_labels:type_name -> inventory.AddHAProxyServiceRequest.CustomLabelsEntry + 43, // 28: inventory.AddHAProxyServiceRequest.custom_labels:type_name -> inventory.AddHAProxyServiceRequest.CustomLabelsEntry 5, // 29: inventory.AddHAProxyServiceResponse.haproxy:type_name -> inventory.HAProxyService - 42, // 30: inventory.AddExternalServiceRequest.custom_labels:type_name -> inventory.AddExternalServiceRequest.CustomLabelsEntry + 44, // 30: inventory.AddExternalServiceRequest.custom_labels:type_name -> inventory.AddExternalServiceRequest.CustomLabelsEntry 6, // 31: inventory.AddExternalServiceResponse.external:type_name -> inventory.ExternalService - 43, // 32: inventory.AddCustomLabelsRequest.custom_labels:type_name -> inventory.AddCustomLabelsRequest.CustomLabelsEntry + 45, // 32: inventory.AddCustomLabelsRequest.custom_labels:type_name -> inventory.AddCustomLabelsRequest.CustomLabelsEntry 7, // 33: inventory.Services.ListServices:input_type -> inventory.ListServicesRequest 9, // 34: inventory.Services.ListActiveServiceTypes:input_type -> inventory.ListActiveServiceTypesRequest 11, // 35: inventory.Services.GetService:input_type -> inventory.GetServiceRequest @@ -3253,20 +3413,22 @@ var file_inventorypb_services_proto_depIdxs = []int32{ 25, // 42: inventory.Services.RemoveService:input_type -> inventory.RemoveServiceRequest 27, // 43: inventory.Services.AddCustomLabels:input_type -> inventory.AddCustomLabelsRequest 29, // 44: inventory.Services.RemoveCustomLabels:input_type -> inventory.RemoveCustomLabelsRequest - 8, // 45: inventory.Services.ListServices:output_type -> inventory.ListServicesResponse - 10, // 46: inventory.Services.ListActiveServiceTypes:output_type -> inventory.ListActiveServiceTypesResponse - 12, // 47: inventory.Services.GetService:output_type -> inventory.GetServiceResponse - 14, // 48: inventory.Services.AddMySQLService:output_type -> inventory.AddMySQLServiceResponse - 16, // 49: inventory.Services.AddMongoDBService:output_type -> inventory.AddMongoDBServiceResponse - 18, // 50: inventory.Services.AddPostgreSQLService:output_type -> inventory.AddPostgreSQLServiceResponse - 20, // 51: inventory.Services.AddProxySQLService:output_type -> inventory.AddProxySQLServiceResponse - 22, // 52: inventory.Services.AddHAProxyService:output_type -> inventory.AddHAProxyServiceResponse - 24, // 53: inventory.Services.AddExternalService:output_type -> inventory.AddExternalServiceResponse - 26, // 54: inventory.Services.RemoveService:output_type -> inventory.RemoveServiceResponse - 28, // 55: inventory.Services.AddCustomLabels:output_type -> inventory.AddCustomLabelsResponse - 30, // 56: inventory.Services.RemoveCustomLabels:output_type -> inventory.RemoveCustomLabelsResponse - 45, // [45:57] is the sub-list for method output_type - 33, // [33:45] is the sub-list for method input_type + 31, // 45: inventory.Services.ChangeService:input_type -> inventory.ChangeServiceRequest + 8, // 46: inventory.Services.ListServices:output_type -> inventory.ListServicesResponse + 10, // 47: inventory.Services.ListActiveServiceTypes:output_type -> inventory.ListActiveServiceTypesResponse + 12, // 48: inventory.Services.GetService:output_type -> inventory.GetServiceResponse + 14, // 49: inventory.Services.AddMySQLService:output_type -> inventory.AddMySQLServiceResponse + 16, // 50: inventory.Services.AddMongoDBService:output_type -> inventory.AddMongoDBServiceResponse + 18, // 51: inventory.Services.AddPostgreSQLService:output_type -> inventory.AddPostgreSQLServiceResponse + 20, // 52: inventory.Services.AddProxySQLService:output_type -> inventory.AddProxySQLServiceResponse + 22, // 53: inventory.Services.AddHAProxyService:output_type -> inventory.AddHAProxyServiceResponse + 24, // 54: inventory.Services.AddExternalService:output_type -> inventory.AddExternalServiceResponse + 26, // 55: inventory.Services.RemoveService:output_type -> inventory.RemoveServiceResponse + 28, // 56: inventory.Services.AddCustomLabels:output_type -> inventory.AddCustomLabelsResponse + 30, // 57: inventory.Services.RemoveCustomLabels:output_type -> inventory.RemoveCustomLabelsResponse + 32, // 58: inventory.Services.ChangeService:output_type -> inventory.ChangeServiceResponse + 46, // [46:59] is the sub-list for method output_type + 33, // [33:46] is the sub-list for method input_type 33, // [33:33] is the sub-list for extension type_name 33, // [33:33] is the sub-list for extension extendee 0, // [0:33] is the sub-list for field type_name @@ -3638,6 +3800,30 @@ func file_inventorypb_services_proto_init() { return nil } } + file_inventorypb_services_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeServiceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventorypb_services_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeServiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_inventorypb_services_proto_msgTypes[11].OneofWrappers = []interface{}{ (*GetServiceResponse_Mysql)(nil), @@ -3647,13 +3833,14 @@ func file_inventorypb_services_proto_init() { (*GetServiceResponse_Haproxy)(nil), (*GetServiceResponse_External)(nil), } + file_inventorypb_services_proto_msgTypes[30].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_inventorypb_services_proto_rawDesc, NumEnums: 1, - NumMessages: 43, + NumMessages: 45, NumExtensions: 0, NumServices: 1, }, diff --git a/api/inventorypb/services.pb.gw.go b/api/inventorypb/services.pb.gw.go index 41149720ca..d9964442e0 100644 --- a/api/inventorypb/services.pb.gw.go +++ b/api/inventorypb/services.pb.gw.go @@ -417,6 +417,38 @@ func local_request_Services_RemoveCustomLabels_0(ctx context.Context, marshaler return msg, metadata, err } +func request_Services_ChangeService_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ChangeServiceRequest + 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) + } + + msg, err := client.ChangeService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Services_ChangeService_0(ctx context.Context, marshaler runtime.Marshaler, server ServicesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ChangeServiceRequest + 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) + } + + msg, err := server.ChangeService(ctx, &protoReq) + return msg, metadata, err +} + // RegisterServicesHandlerServer registers the http handlers for service Services to "mux". // UnaryRPC :call ServicesServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -710,6 +742,30 @@ func RegisterServicesHandlerServer(ctx context.Context, mux *runtime.ServeMux, s forward_Services_RemoveCustomLabels_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle("POST", pattern_Services_ChangeService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/inventory.Services/ChangeService", runtime.WithHTTPPathPattern("/v1/inventory/Services/Change")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Services_ChangeService_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Services_ChangeService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil } @@ -1002,6 +1058,27 @@ func RegisterServicesHandlerClient(ctx context.Context, mux *runtime.ServeMux, c forward_Services_RemoveCustomLabels_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle("POST", pattern_Services_ChangeService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/inventory.Services/ChangeService", runtime.WithHTTPPathPattern("/v1/inventory/Services/Change")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Services_ChangeService_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Services_ChangeService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil } @@ -1029,6 +1106,8 @@ var ( pattern_Services_AddCustomLabels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "inventory", "Services", "CustomLabels", "Add"}, "")) pattern_Services_RemoveCustomLabels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "inventory", "Services", "CustomLabels", "Remove"}, "")) + + pattern_Services_ChangeService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "inventory", "Services", "Change"}, "")) ) var ( @@ -1055,4 +1134,6 @@ var ( forward_Services_AddCustomLabels_0 = runtime.ForwardResponseMessage forward_Services_RemoveCustomLabels_0 = runtime.ForwardResponseMessage + + forward_Services_ChangeService_0 = runtime.ForwardResponseMessage ) diff --git a/api/inventorypb/services.pb.validate.go b/api/inventorypb/services.pb.validate.go index 9b1f0567d7..65c779fbef 100644 --- a/api/inventorypb/services.pb.validate.go +++ b/api/inventorypb/services.pb.validate.go @@ -4088,3 +4088,234 @@ var _ interface { Cause() error ErrorName() string } = RemoveCustomLabelsResponseValidationError{} + +// Validate checks the field values on ChangeServiceRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ChangeServiceRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ChangeServiceRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ChangeServiceRequestMultiError, or nil if none found. +func (m *ChangeServiceRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *ChangeServiceRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if utf8.RuneCountInString(m.GetServiceId()) < 1 { + err := ChangeServiceRequestValidationError{ + field: "ServiceId", + reason: "value length must be at least 1 runes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.Environment != nil { + // no validation rules for Environment + } + + if m.Cluster != nil { + // no validation rules for Cluster + } + + if m.ReplicationSet != nil { + // no validation rules for ReplicationSet + } + + if m.ExternalGroup != nil { + // no validation rules for ExternalGroup + } + + if len(errors) > 0 { + return ChangeServiceRequestMultiError(errors) + } + + return nil +} + +// ChangeServiceRequestMultiError is an error wrapping multiple validation +// errors returned by ChangeServiceRequest.ValidateAll() if the designated +// constraints aren't met. +type ChangeServiceRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ChangeServiceRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ChangeServiceRequestMultiError) AllErrors() []error { return m } + +// ChangeServiceRequestValidationError is the validation error returned by +// ChangeServiceRequest.Validate if the designated constraints aren't met. +type ChangeServiceRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ChangeServiceRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ChangeServiceRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ChangeServiceRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ChangeServiceRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ChangeServiceRequestValidationError) ErrorName() string { + return "ChangeServiceRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e ChangeServiceRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sChangeServiceRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ChangeServiceRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ChangeServiceRequestValidationError{} + +// Validate checks the field values on ChangeServiceResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ChangeServiceResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ChangeServiceResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ChangeServiceResponseMultiError, or nil if none found. +func (m *ChangeServiceResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ChangeServiceResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return ChangeServiceResponseMultiError(errors) + } + + return nil +} + +// ChangeServiceResponseMultiError is an error wrapping multiple validation +// errors returned by ChangeServiceResponse.ValidateAll() if the designated +// constraints aren't met. +type ChangeServiceResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ChangeServiceResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ChangeServiceResponseMultiError) AllErrors() []error { return m } + +// ChangeServiceResponseValidationError is the validation error returned by +// ChangeServiceResponse.Validate if the designated constraints aren't met. +type ChangeServiceResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ChangeServiceResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ChangeServiceResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ChangeServiceResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ChangeServiceResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ChangeServiceResponseValidationError) ErrorName() string { + return "ChangeServiceResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ChangeServiceResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sChangeServiceResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ChangeServiceResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ChangeServiceResponseValidationError{} diff --git a/api/inventorypb/services.proto b/api/inventorypb/services.proto index 94ddc9f43c..199f6000c6 100644 --- a/api/inventorypb/services.proto +++ b/api/inventorypb/services.proto @@ -404,6 +404,16 @@ message RemoveCustomLabelsRequest { message RemoveCustomLabelsResponse {} +message ChangeServiceRequest { + string service_id = 1 [(validate.rules).string.min_len = 1]; + optional string environment = 2; + optional string cluster = 3; + optional string replication_set = 4; + optional string external_group = 5; +} + +message ChangeServiceResponse {} + // Services service provides public methods for managing Services. service Services { // ListServices returns a list of Services filtered by type. @@ -538,4 +548,15 @@ service Services { description: "Removes custom labels from a Service by key." }; } + // ChangeService allows changing configuration of a service. + rpc ChangeService(ChangeServiceRequest) returns (ChangeServiceResponse) { + option (google.api.http) = { + post: "/v1/inventory/Services/Change" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Change service" + description: "Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks." + }; + } } diff --git a/api/inventorypb/services_grpc.pb.go b/api/inventorypb/services_grpc.pb.go index c1e42669ca..84f88883fd 100644 --- a/api/inventorypb/services_grpc.pb.go +++ b/api/inventorypb/services_grpc.pb.go @@ -32,6 +32,7 @@ const ( Services_RemoveService_FullMethodName = "/inventory.Services/RemoveService" Services_AddCustomLabels_FullMethodName = "/inventory.Services/AddCustomLabels" Services_RemoveCustomLabels_FullMethodName = "/inventory.Services/RemoveCustomLabels" + Services_ChangeService_FullMethodName = "/inventory.Services/ChangeService" ) // ServicesClient is the client API for Services service. @@ -62,6 +63,8 @@ type ServicesClient interface { AddCustomLabels(ctx context.Context, in *AddCustomLabelsRequest, opts ...grpc.CallOption) (*AddCustomLabelsResponse, error) // RemoveCustomLabels removes custom labels from a Service. RemoveCustomLabels(ctx context.Context, in *RemoveCustomLabelsRequest, opts ...grpc.CallOption) (*RemoveCustomLabelsResponse, error) + // ChangeService allows changing configuration of a service. + ChangeService(ctx context.Context, in *ChangeServiceRequest, opts ...grpc.CallOption) (*ChangeServiceResponse, error) } type servicesClient struct { @@ -180,6 +183,15 @@ func (c *servicesClient) RemoveCustomLabels(ctx context.Context, in *RemoveCusto return out, nil } +func (c *servicesClient) ChangeService(ctx context.Context, in *ChangeServiceRequest, opts ...grpc.CallOption) (*ChangeServiceResponse, error) { + out := new(ChangeServiceResponse) + err := c.cc.Invoke(ctx, Services_ChangeService_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ServicesServer is the server API for Services service. // All implementations must embed UnimplementedServicesServer // for forward compatibility @@ -208,6 +220,8 @@ type ServicesServer interface { AddCustomLabels(context.Context, *AddCustomLabelsRequest) (*AddCustomLabelsResponse, error) // RemoveCustomLabels removes custom labels from a Service. RemoveCustomLabels(context.Context, *RemoveCustomLabelsRequest) (*RemoveCustomLabelsResponse, error) + // ChangeService allows changing configuration of a service. + ChangeService(context.Context, *ChangeServiceRequest) (*ChangeServiceResponse, error) mustEmbedUnimplementedServicesServer() } @@ -261,6 +275,10 @@ func (UnimplementedServicesServer) AddCustomLabels(context.Context, *AddCustomLa func (UnimplementedServicesServer) RemoveCustomLabels(context.Context, *RemoveCustomLabelsRequest) (*RemoveCustomLabelsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveCustomLabels not implemented") } + +func (UnimplementedServicesServer) ChangeService(context.Context, *ChangeServiceRequest) (*ChangeServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangeService not implemented") +} func (UnimplementedServicesServer) mustEmbedUnimplementedServicesServer() {} // UnsafeServicesServer may be embedded to opt out of forward compatibility for this service. @@ -490,6 +508,24 @@ func _Services_RemoveCustomLabels_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Services_ChangeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangeServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServicesServer).ChangeService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Services_ChangeService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServicesServer).ChangeService(ctx, req.(*ChangeServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Services_ServiceDesc is the grpc.ServiceDesc for Services service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -545,6 +581,10 @@ var Services_ServiceDesc = grpc.ServiceDesc{ MethodName: "RemoveCustomLabels", Handler: _Services_RemoveCustomLabels_Handler, }, + { + MethodName: "ChangeService", + Handler: _Services_ChangeService_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "inventorypb/services.proto", diff --git a/api/inventorypb/services_test.go b/api/inventorypb/services_test.go index a9a63836af..0dea92474a 100644 --- a/api/inventorypb/services_test.go +++ b/api/inventorypb/services_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -28,7 +28,7 @@ import ( // names is up to date with the types defined in ServiceType_name by the proto definition // by calling the ServiceTypeName function using the values from protobuf and it expects the // result is a non-empty string, meaning that the ServiceTypeNames list matches the proto -// definitions +// definitions. func TestServiceTypes(t *testing.T) { for _, val := range ServiceType_name { if strings.HasSuffix(val, "INVALID") { diff --git a/api/inventorypb/types/agent_types.go b/api/inventorypb/types/agent_types.go index 26a287e2b0..8be8950c55 100644 --- a/api/inventorypb/types/agent_types.go +++ b/api/inventorypb/types/agent_types.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -18,7 +18,7 @@ package types import "fmt" -// this list should be in sync with inventorypb/agents.pb.go +// this list should be in sync with inventorypb/agents.pb.go. const ( AgentTypePMMAgent = "PMM_AGENT" AgentTypeVMAgent = "VM_AGENT" @@ -56,7 +56,7 @@ var agentTypeNames = map[string]string{ AgentTypeAzureDatabaseExporter: "azure_database_exporter", } -// AgentTypeName returns human friendly agent type to be used in reports +// AgentTypeName returns human friendly agent type to be used in reports. func AgentTypeName(t string) string { res := agentTypeNames[t] if res == "" { diff --git a/api/inventorypb/types/node_types.go b/api/inventorypb/types/node_types.go index b142edd1c8..8737e0d479 100644 --- a/api/inventorypb/types/node_types.go +++ b/api/inventorypb/types/node_types.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ package types import "fmt" -// this list should be in sync with inventorypb/nodes.pb.go +// this list should be in sync with inventorypb/nodes.pb.go. const ( NodeTypeGenericNode = "GENERIC_NODE" NodeTypeContainerNode = "CONTAINER_NODE" @@ -35,7 +35,7 @@ var nodeTypeNames = map[string]string{ NodeTypeRemoteAzureDatabaseNode: "Remote Azure database", } -// NodeTypeName returns human friendly node type to be used in reports +// NodeTypeName returns human friendly node type to be used in reports. func NodeTypeName(t string) string { res := nodeTypeNames[t] if res == "" { diff --git a/api/inventorypb/types/service_types.go b/api/inventorypb/types/service_types.go index ab3ede1977..77301e2400 100644 --- a/api/inventorypb/types/service_types.go +++ b/api/inventorypb/types/service_types.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ package types import "fmt" -// this list should be in sync with inventorypb/services.pb.go +// this list should be in sync with inventorypb/services.pb.go. const ( ServiceTypeMySQLService = "MYSQL_SERVICE" ServiceTypeMongoDBService = "MONGODB_SERVICE" @@ -37,7 +37,7 @@ var serviceTypeNames = map[string]string{ ServiceTypeExternalService: "External", } -// ServiceTypeName returns human friendly service type to be used in reports +// ServiceTypeName returns human friendly service type to be used in reports. func ServiceTypeName(t string) string { res := serviceTypeNames[t] if res == "" { diff --git a/api/main_test.go b/api/main_test.go index a797c4c6ae..518d42d8bb 100644 --- a/api/main_test.go +++ b/api/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/api/managementpb/alerting/alerting.pb.go b/api/managementpb/alerting/alerting.pb.go index 7d6f223563..13ec12832d 100644 --- a/api/managementpb/alerting/alerting.pb.go +++ b/api/managementpb/alerting/alerting.pb.go @@ -500,7 +500,7 @@ type Template struct { Source TemplateSource `protobuf:"varint,9,opt,name=source,proto3,enum=alerting.v1.TemplateSource" json:"source,omitempty"` // Template creation time. Empty for built-in and SaaS templates. CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // YAML (or JSON) template file content. Empty for built-in and SaaS templates. + // YAML template file content. Empty for built-in and SaaS templates. Yaml string `protobuf:"bytes,11,opt,name=yaml,proto3" json:"yaml,omitempty"` } @@ -731,7 +731,7 @@ type CreateTemplateRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // YAML (or JSON) template file content. + // YAML template file content. Yaml string `protobuf:"bytes,1,opt,name=yaml,proto3" json:"yaml,omitempty"` } @@ -819,7 +819,7 @@ type UpdateTemplateRequest struct { // Machine-readable name (ID). Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // YAML (or JSON) template file content. + // YAML template file content. Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` } diff --git a/api/managementpb/alerting/alerting.proto b/api/managementpb/alerting/alerting.proto index 82d8df2f01..2356bb6b34 100644 --- a/api/managementpb/alerting/alerting.proto +++ b/api/managementpb/alerting/alerting.proto @@ -98,7 +98,7 @@ message Template { TemplateSource source = 9; // Template creation time. Empty for built-in and SaaS templates. google.protobuf.Timestamp created_at = 10; - // YAML (or JSON) template file content. Empty for built-in and SaaS templates. + // YAML template file content. Empty for built-in and SaaS templates. string yaml = 11; } @@ -116,7 +116,7 @@ message ListTemplatesResponse { } message CreateTemplateRequest { - // YAML (or JSON) template file content. + // YAML template file content. string yaml = 1 [(validate.rules).string.min_len = 1]; } @@ -125,7 +125,7 @@ message CreateTemplateResponse {} message UpdateTemplateRequest { // Machine-readable name (ID). string name = 1 [(validate.rules).string.min_len = 1]; - // YAML (or JSON) template file content. + // YAML template file content. string yaml = 2 [(validate.rules).string.min_len = 1]; } diff --git a/api/managementpb/alerting/json/alerting.json b/api/managementpb/alerting/json/alerting.json index a9c0e57d1f..31a3e0fe4f 100644 --- a/api/managementpb/alerting/json/alerting.json +++ b/api/managementpb/alerting/json/alerting.json @@ -215,7 +215,7 @@ "type": "object", "properties": { "yaml": { - "description": "YAML (or JSON) template file content.", + "description": "YAML template file content.", "type": "string", "x-order": 0 } @@ -575,7 +575,7 @@ "x-order": 1 }, "yaml": { - "description": "YAML (or JSON) template file content. Empty for built-in and SaaS templates.", + "description": "YAML template file content. Empty for built-in and SaaS templates.", "type": "string", "x-order": 10 } @@ -660,7 +660,7 @@ "x-order": 0 }, "yaml": { - "description": "YAML (or JSON) template file content.", + "description": "YAML template file content.", "type": "string", "x-order": 1 } diff --git a/api/managementpb/alerting/json/client/alerting/create_template_responses.go b/api/managementpb/alerting/json/client/alerting/create_template_responses.go index b7f4dd8f7d..ab5c000932 100644 --- a/api/managementpb/alerting/json/client/alerting/create_template_responses.go +++ b/api/managementpb/alerting/json/client/alerting/create_template_responses.go @@ -121,7 +121,7 @@ CreateTemplateBody create template body swagger:model CreateTemplateBody */ type CreateTemplateBody struct { - // YAML (or JSON) template file content. + // YAML template file content. Yaml string `json:"yaml,omitempty"` } diff --git a/api/managementpb/alerting/json/client/alerting/list_templates_responses.go b/api/managementpb/alerting/json/client/alerting/list_templates_responses.go index cee8c814a3..a4f455229a 100644 --- a/api/managementpb/alerting/json/client/alerting/list_templates_responses.go +++ b/api/managementpb/alerting/json/client/alerting/list_templates_responses.go @@ -539,7 +539,7 @@ type ListTemplatesOKBodyTemplatesItems0 struct { // Format: date-time CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - // YAML (or JSON) template file content. Empty for built-in and SaaS templates. + // YAML template file content. Empty for built-in and SaaS templates. Yaml string `json:"yaml,omitempty"` } diff --git a/api/managementpb/alerting/json/client/alerting/update_template_responses.go b/api/managementpb/alerting/json/client/alerting/update_template_responses.go index 3d051b737b..242e579151 100644 --- a/api/managementpb/alerting/json/client/alerting/update_template_responses.go +++ b/api/managementpb/alerting/json/client/alerting/update_template_responses.go @@ -124,7 +124,7 @@ type UpdateTemplateBody struct { // Machine-readable name (ID). Name string `json:"name,omitempty"` - // YAML (or JSON) template file content. + // YAML template file content. Yaml string `json:"yaml,omitempty"` } diff --git a/api/managementpb/checks.pb.go b/api/managementpb/checks.pb.go index 7bf1b53a51..b86b939868 100644 --- a/api/managementpb/checks.pb.go +++ b/api/managementpb/checks.pb.go @@ -76,6 +76,58 @@ func (SecurityCheckInterval) EnumDescriptor() ([]byte, []int) { return file_managementpb_checks_proto_rawDescGZIP(), []int{0} } +type AdvisorCheckFamily int32 + +const ( + AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_INVALID AdvisorCheckFamily = 0 + AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_MYSQL AdvisorCheckFamily = 1 + AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_POSTGRESQL AdvisorCheckFamily = 2 + AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_MONGODB AdvisorCheckFamily = 3 +) + +// Enum value maps for AdvisorCheckFamily. +var ( + AdvisorCheckFamily_name = map[int32]string{ + 0: "ADVISOR_CHECK_FAMILY_INVALID", + 1: "ADVISOR_CHECK_FAMILY_MYSQL", + 2: "ADVISOR_CHECK_FAMILY_POSTGRESQL", + 3: "ADVISOR_CHECK_FAMILY_MONGODB", + } + AdvisorCheckFamily_value = map[string]int32{ + "ADVISOR_CHECK_FAMILY_INVALID": 0, + "ADVISOR_CHECK_FAMILY_MYSQL": 1, + "ADVISOR_CHECK_FAMILY_POSTGRESQL": 2, + "ADVISOR_CHECK_FAMILY_MONGODB": 3, + } +) + +func (x AdvisorCheckFamily) Enum() *AdvisorCheckFamily { + p := new(AdvisorCheckFamily) + *p = x + return p +} + +func (x AdvisorCheckFamily) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AdvisorCheckFamily) Descriptor() protoreflect.EnumDescriptor { + return file_managementpb_checks_proto_enumTypes[1].Descriptor() +} + +func (AdvisorCheckFamily) Type() protoreflect.EnumType { + return &file_managementpb_checks_proto_enumTypes[1] +} + +func (x AdvisorCheckFamily) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AdvisorCheckFamily.Descriptor instead. +func (AdvisorCheckFamily) EnumDescriptor() ([]byte, []int) { + return file_managementpb_checks_proto_rawDescGZIP(), []int{1} +} + // SecurityCheckResult represents the check result returned from pmm-managed after running the check. type SecurityCheckResult struct { state protoimpl.MessageState @@ -436,6 +488,8 @@ type SecurityCheck struct { Summary string `protobuf:"bytes,4,opt,name=summary,proto3" json:"summary,omitempty"` // Check execution interval. Interval SecurityCheckInterval `protobuf:"varint,5,opt,name=interval,proto3,enum=management.SecurityCheckInterval" json:"interval,omitempty"` + // DB family. + Family AdvisorCheckFamily `protobuf:"varint,6,opt,name=family,proto3,enum=management.AdvisorCheckFamily" json:"family,omitempty"` } func (x *SecurityCheck) Reset() { @@ -505,6 +559,13 @@ func (x *SecurityCheck) GetInterval() SecurityCheckInterval { return SecurityCheckInterval_SECURITY_CHECK_INTERVAL_INVALID } +func (x *SecurityCheck) GetFamily() AdvisorCheckFamily { + if x != nil { + return x.Family + } + return AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_INVALID +} + type Advisor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1475,7 +1536,7 @@ var file_managementpb_checks_proto_rawDesc = []byte{ 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, 0x22, 0xba, 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x02, 0x38, 0x01, 0x22, 0xf2, 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, 0x73, @@ -1487,235 +1548,249 @@ var file_managementpb_checks_proto_rawDesc = []byte{ 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x22, 0xc2, 0x01, 0x0a, 0x07, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 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, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x12, 0x31, 0x0a, 0x06, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x06, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x19, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, - 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x52, 0x08, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x24, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x53, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x60, - 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x39, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x02, 0x18, 0x01, - 0x22, 0x32, 0x0a, 0x1a, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, - 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x22, 0x1d, 0x0a, 0x1b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0x4f, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, - 0x0a, 0x06, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x75, - 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x65, 0x63, 0x6b, - 0x73, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x47, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, - 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2f, 0x0a, 0x08, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, - 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x52, 0x08, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, - 0x73, 0x22, 0x5c, 0x0a, 0x1b, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x25, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, - 0x1e, 0x0a, 0x1c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, - 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x1b, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x54, 0x0a, 0x1a, - 0x4c, 0x69, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x22, 0x70, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x0b, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x12, 0x36, 0x0a, 0x06, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x64, + 0x76, 0x69, 0x73, 0x6f, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, + 0x52, 0x06, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x22, 0xc2, 0x01, 0x0a, 0x07, 0x41, 0x64, 0x76, + 0x69, 0x73, 0x6f, 0x72, 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, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x06, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x22, 0xa0, 0x01, + 0x0a, 0x19, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x22, 0x24, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x60, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x32, 0x0a, 0x1a, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x1d, 0x0a, 0x1b, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x4c, + 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4f, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x52, 0x06, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, + 0x74, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x47, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x61, 0x64, 0x76, 0x69, + 0x73, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x52, + 0x08, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x22, 0x5c, 0x0a, 0x1b, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, + 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x1e, 0x0a, 0x1c, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x46, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x54, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x70, 0x0a, 0x16, 0x47, 0x65, + 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x85, 0x01, 0x0a, + 0x17, 0x47, 0x65, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x46, 0x61, 0x69, 0x6c, + 0x67, 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, + 0x74, 0x61, 0x6c, 0x73, 0x22, 0x4e, 0x0a, 0x17, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x69, + 0x6c, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x69, 0x6c, + 0x65, 0x6e, 0x63, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2a, 0x62, 0x0a, 0x15, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x1f, 0x53, 0x45, 0x43, + 0x55, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f, 0x49, 0x4e, 0x54, 0x45, + 0x52, 0x56, 0x41, 0x4c, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x0c, + 0x0a, 0x08, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, + 0x46, 0x52, 0x45, 0x51, 0x55, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x41, + 0x52, 0x45, 0x10, 0x03, 0x2a, 0x9d, 0x01, 0x0a, 0x12, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x20, 0x0a, 0x1c, 0x41, + 0x44, 0x56, 0x49, 0x53, 0x4f, 0x52, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f, 0x46, 0x41, 0x4d, + 0x49, 0x4c, 0x59, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, + 0x1a, 0x41, 0x44, 0x56, 0x49, 0x53, 0x4f, 0x52, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f, 0x46, + 0x41, 0x4d, 0x49, 0x4c, 0x59, 0x5f, 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x10, 0x01, 0x12, 0x23, 0x0a, + 0x1f, 0x41, 0x44, 0x56, 0x49, 0x53, 0x4f, 0x52, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f, 0x46, + 0x41, 0x4d, 0x49, 0x4c, 0x59, 0x5f, 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45, 0x53, 0x51, 0x4c, + 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x44, 0x56, 0x49, 0x53, 0x4f, 0x52, 0x5f, 0x43, 0x48, + 0x45, 0x43, 0x4b, 0x5f, 0x46, 0x41, 0x4d, 0x49, 0x4c, 0x59, 0x5f, 0x4d, 0x4f, 0x4e, 0x47, 0x4f, + 0x44, 0x42, 0x10, 0x03, 0x32, 0xef, 0x0f, 0x0a, 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x89, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, + 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x25, + 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa3, 0x01, + 0x92, 0x41, 0x65, 0x12, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x4d, 0x52, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x73, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x3a, 0x01, + 0x2a, 0x22, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x12, 0xdf, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x31, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x73, - 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x22, 0x4e, 0x0a, 0x17, - 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x6c, 0x65, 0x72, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x6c, 0x65, 0x72, 0x74, - 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x69, 0x6c, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x69, 0x6c, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x1a, 0x0a, 0x18, - 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x62, 0x0a, 0x15, 0x53, 0x65, 0x63, 0x75, - 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, - 0x6c, 0x12, 0x23, 0x0a, 0x1f, 0x53, 0x45, 0x43, 0x55, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x43, 0x48, - 0x45, 0x43, 0x4b, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x56, 0x41, 0x4c, 0x5f, 0x49, 0x4e, 0x56, - 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, - 0x52, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x52, 0x45, 0x51, 0x55, 0x45, 0x4e, 0x54, - 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x41, 0x52, 0x45, 0x10, 0x03, 0x32, 0xe8, 0x0f, 0x0a, - 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, - 0x89, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, - 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa3, 0x01, 0x92, 0x41, 0x65, 0x12, 0x14, 0x4c, 0x69, 0x73, - 0x74, 0x20, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x1a, 0x4d, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, - 0x74, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x77, 0x69, - 0x74, 0x68, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x6f, - 0x66, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x2e, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x3a, 0x01, 0x2a, 0x22, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x6d, + 0x22, 0x82, 0x01, 0x92, 0x41, 0x4a, 0x12, 0x11, 0x47, 0x65, 0x74, 0x20, 0x46, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x35, 0x52, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x20, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, + 0x61, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x61, 0x69, - 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0xdf, 0x01, 0x0a, 0x0f, - 0x47, 0x65, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, - 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, - 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x47, 0x65, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x82, 0x01, 0x92, 0x41, 0x4a, 0x12, 0x11, - 0x47, 0x65, 0x74, 0x20, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x73, 0x1a, 0x35, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x3a, 0x01, - 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0xec, 0x01, 0x0a, 0x10, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x6f, 0x67, + 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x92, 0x41, 0x4d, 0x12, 0x12, 0x54, 0x6f, 0x67, + 0x67, 0x6c, 0x65, 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x1a, + 0x35, 0x53, 0x69, 0x6c, 0x65, 0x6e, 0x63, 0x65, 0x2f, 0x55, 0x6e, 0x73, 0x69, 0x6c, 0x65, 0x6e, + 0x63, 0x65, 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, + 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, + 0x2a, 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x2f, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0xe7, 0x01, - 0x0a, 0x10, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, - 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x87, 0x01, - 0x92, 0x41, 0x4b, 0x12, 0x12, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x20, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x1a, 0x35, 0x53, 0x69, 0x6c, 0x65, 0x6e, 0x63, 0x65, - 0x2f, 0x55, 0x6e, 0x73, 0x69, 0x6c, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, - 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, - 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x12, 0x86, 0x02, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x73, 0x12, 0x2a, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2b, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x91, 0x01, 0x92, - 0x41, 0x53, 0x12, 0x1a, 0x47, 0x65, 0x74, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, 0x35, - 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x20, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x27, 0x73, 0x20, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x3a, 0x01, 0x2a, 0x22, 0x2d, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x47, 0x65, - 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x88, 0x02, 0x01, - 0x12, 0xc9, 0x02, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x27, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe0, 0x01, 0x92, 0x41, 0xae, 0x01, - 0x12, 0x15, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x94, 0x01, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x65, 0x73, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x54, 0x68, 0x72, 0x65, - 0x61, 0x64, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, - 0x6e, 0x64, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, - 0x61, 0x6c, 0x6c, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x65, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x61, 0x76, 0x61, - 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x77, 0x69, - 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x20, 0x69, 0x66, - 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, - 0x6e, 0x27, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0xdb, 0x01, 0x0a, - 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, - 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x76, 0x92, 0x41, 0x46, 0x12, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x64, - 0x76, 0x69, 0x73, 0x6f, 0x72, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x2f, 0x52, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, - 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, + 0x2f, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, + 0x74, 0x88, 0x02, 0x01, 0x12, 0x88, 0x02, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, 0x75, + 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, + 0x12, 0x2a, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x93, 0x01, 0x92, 0x41, 0x55, 0x12, + 0x1a, 0x47, 0x65, 0x74, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x20, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, 0x35, 0x52, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x73, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x54, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x27, 0x73, 0x20, 0x6c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x2e, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x3a, 0x01, 0x2a, 0x22, 0x2d, 0x2f, + 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x47, 0x65, 0x74, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x88, 0x02, 0x01, 0x12, + 0xc9, 0x02, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x27, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe0, 0x01, 0x92, 0x41, 0xae, 0x01, 0x12, + 0x15, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x94, 0x01, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x73, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x54, 0x68, 0x72, 0x65, 0x61, + 0x64, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, + 0x6c, 0x6c, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x61, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x77, 0x69, 0x6c, + 0x6c, 0x20, 0x62, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x20, 0x69, 0x66, 0x20, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x6e, + 0x27, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0xbf, 0x01, 0x0a, 0x0c, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x61, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0xdb, 0x01, 0x0a, 0x12, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x76, 0x92, 0x41, 0x46, 0x12, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x64, 0x76, + 0x69, 0x73, 0x6f, 0x72, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x2f, 0x52, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, + 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0xbf, 0x01, 0x0a, 0x0c, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x76, 0x69, + 0x73, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x76, - 0x69, 0x73, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, - 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6c, - 0x92, 0x41, 0x42, 0x12, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, - 0x72, 0x73, 0x1a, 0x31, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, - 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x20, 0x61, - 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x41, - 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x88, 0x02, 0x0a, - 0x14, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x27, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, - 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, - 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9c, 0x01, 0x92, 0x41, 0x6a, 0x12, 0x16, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x50, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2f, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, - 0x79, 0x20, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x20, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, - 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x62, - 0x79, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, - 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x8e, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x0b, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, - 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x70, 0x62, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x73, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6c, 0x92, + 0x41, 0x42, 0x12, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, + 0x73, 0x1a, 0x31, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, + 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x64, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x20, 0x61, 0x76, + 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, + 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x41, 0x64, + 0x76, 0x69, 0x73, 0x6f, 0x72, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x88, 0x02, 0x0a, 0x14, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x12, 0x27, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9c, 0x01, 0x92, 0x41, 0x6a, 0x12, 0x16, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x1a, 0x50, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2f, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x20, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0x20, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x62, 0x79, + 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, + 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x2f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2f, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x8e, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, + 0x62, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1731,77 +1806,79 @@ func file_managementpb_checks_proto_rawDescGZIP() []byte { } var ( - file_managementpb_checks_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_managementpb_checks_proto_enumTypes = make([]protoimpl.EnumInfo, 2) file_managementpb_checks_proto_msgTypes = make([]protoimpl.MessageInfo, 24) file_managementpb_checks_proto_goTypes = []interface{}{ (SecurityCheckInterval)(0), // 0: management.SecurityCheckInterval - (*SecurityCheckResult)(nil), // 1: management.SecurityCheckResult - (*CheckResultSummary)(nil), // 2: management.CheckResultSummary - (*CheckResult)(nil), // 3: management.CheckResult - (*SecurityCheck)(nil), // 4: management.SecurityCheck - (*Advisor)(nil), // 5: management.Advisor - (*ChangeSecurityCheckParams)(nil), // 6: management.ChangeSecurityCheckParams - (*GetSecurityCheckResultsRequest)(nil), // 7: management.GetSecurityCheckResultsRequest - (*GetSecurityCheckResultsResponse)(nil), // 8: management.GetSecurityCheckResultsResponse - (*StartSecurityChecksRequest)(nil), // 9: management.StartSecurityChecksRequest - (*StartSecurityChecksResponse)(nil), // 10: management.StartSecurityChecksResponse - (*ListSecurityChecksRequest)(nil), // 11: management.ListSecurityChecksRequest - (*ListSecurityChecksResponse)(nil), // 12: management.ListSecurityChecksResponse - (*ListAdvisorsRequest)(nil), // 13: management.ListAdvisorsRequest - (*ListAdvisorsResponse)(nil), // 14: management.ListAdvisorsResponse - (*ChangeSecurityChecksRequest)(nil), // 15: management.ChangeSecurityChecksRequest - (*ChangeSecurityChecksResponse)(nil), // 16: management.ChangeSecurityChecksResponse - (*ListFailedServicesRequest)(nil), // 17: management.ListFailedServicesRequest - (*ListFailedServicesResponse)(nil), // 18: management.ListFailedServicesResponse - (*GetFailedChecksRequest)(nil), // 19: management.GetFailedChecksRequest - (*GetFailedChecksResponse)(nil), // 20: management.GetFailedChecksResponse - (*ToggleCheckAlertRequest)(nil), // 21: management.ToggleCheckAlertRequest - (*ToggleCheckAlertResponse)(nil), // 22: management.ToggleCheckAlertResponse - nil, // 23: management.SecurityCheckResult.LabelsEntry - nil, // 24: management.CheckResult.LabelsEntry - (Severity)(0), // 25: management.Severity - (*PageParams)(nil), // 26: management.PageParams - (*PageTotals)(nil), // 27: management.PageTotals + (AdvisorCheckFamily)(0), // 1: management.AdvisorCheckFamily + (*SecurityCheckResult)(nil), // 2: management.SecurityCheckResult + (*CheckResultSummary)(nil), // 3: management.CheckResultSummary + (*CheckResult)(nil), // 4: management.CheckResult + (*SecurityCheck)(nil), // 5: management.SecurityCheck + (*Advisor)(nil), // 6: management.Advisor + (*ChangeSecurityCheckParams)(nil), // 7: management.ChangeSecurityCheckParams + (*GetSecurityCheckResultsRequest)(nil), // 8: management.GetSecurityCheckResultsRequest + (*GetSecurityCheckResultsResponse)(nil), // 9: management.GetSecurityCheckResultsResponse + (*StartSecurityChecksRequest)(nil), // 10: management.StartSecurityChecksRequest + (*StartSecurityChecksResponse)(nil), // 11: management.StartSecurityChecksResponse + (*ListSecurityChecksRequest)(nil), // 12: management.ListSecurityChecksRequest + (*ListSecurityChecksResponse)(nil), // 13: management.ListSecurityChecksResponse + (*ListAdvisorsRequest)(nil), // 14: management.ListAdvisorsRequest + (*ListAdvisorsResponse)(nil), // 15: management.ListAdvisorsResponse + (*ChangeSecurityChecksRequest)(nil), // 16: management.ChangeSecurityChecksRequest + (*ChangeSecurityChecksResponse)(nil), // 17: management.ChangeSecurityChecksResponse + (*ListFailedServicesRequest)(nil), // 18: management.ListFailedServicesRequest + (*ListFailedServicesResponse)(nil), // 19: management.ListFailedServicesResponse + (*GetFailedChecksRequest)(nil), // 20: management.GetFailedChecksRequest + (*GetFailedChecksResponse)(nil), // 21: management.GetFailedChecksResponse + (*ToggleCheckAlertRequest)(nil), // 22: management.ToggleCheckAlertRequest + (*ToggleCheckAlertResponse)(nil), // 23: management.ToggleCheckAlertResponse + nil, // 24: management.SecurityCheckResult.LabelsEntry + nil, // 25: management.CheckResult.LabelsEntry + (Severity)(0), // 26: management.Severity + (*PageParams)(nil), // 27: management.PageParams + (*PageTotals)(nil), // 28: management.PageTotals } ) var file_managementpb_checks_proto_depIdxs = []int32{ - 25, // 0: management.SecurityCheckResult.severity:type_name -> management.Severity - 23, // 1: management.SecurityCheckResult.labels:type_name -> management.SecurityCheckResult.LabelsEntry - 25, // 2: management.CheckResult.severity:type_name -> management.Severity - 24, // 3: management.CheckResult.labels:type_name -> management.CheckResult.LabelsEntry + 26, // 0: management.SecurityCheckResult.severity:type_name -> management.Severity + 24, // 1: management.SecurityCheckResult.labels:type_name -> management.SecurityCheckResult.LabelsEntry + 26, // 2: management.CheckResult.severity:type_name -> management.Severity + 25, // 3: management.CheckResult.labels:type_name -> management.CheckResult.LabelsEntry 0, // 4: management.SecurityCheck.interval:type_name -> management.SecurityCheckInterval - 4, // 5: management.Advisor.checks:type_name -> management.SecurityCheck - 0, // 6: management.ChangeSecurityCheckParams.interval:type_name -> management.SecurityCheckInterval - 1, // 7: management.GetSecurityCheckResultsResponse.results:type_name -> management.SecurityCheckResult - 4, // 8: management.ListSecurityChecksResponse.checks:type_name -> management.SecurityCheck - 5, // 9: management.ListAdvisorsResponse.advisors:type_name -> management.Advisor - 6, // 10: management.ChangeSecurityChecksRequest.params:type_name -> management.ChangeSecurityCheckParams - 2, // 11: management.ListFailedServicesResponse.result:type_name -> management.CheckResultSummary - 26, // 12: management.GetFailedChecksRequest.page_params:type_name -> management.PageParams - 3, // 13: management.GetFailedChecksResponse.results:type_name -> management.CheckResult - 27, // 14: management.GetFailedChecksResponse.page_totals:type_name -> management.PageTotals - 17, // 15: management.SecurityChecks.ListFailedServices:input_type -> management.ListFailedServicesRequest - 19, // 16: management.SecurityChecks.GetFailedChecks:input_type -> management.GetFailedChecksRequest - 21, // 17: management.SecurityChecks.ToggleCheckAlert:input_type -> management.ToggleCheckAlertRequest - 7, // 18: management.SecurityChecks.GetSecurityCheckResults:input_type -> management.GetSecurityCheckResultsRequest - 9, // 19: management.SecurityChecks.StartSecurityChecks:input_type -> management.StartSecurityChecksRequest - 11, // 20: management.SecurityChecks.ListSecurityChecks:input_type -> management.ListSecurityChecksRequest - 13, // 21: management.SecurityChecks.ListAdvisors:input_type -> management.ListAdvisorsRequest - 15, // 22: management.SecurityChecks.ChangeSecurityChecks:input_type -> management.ChangeSecurityChecksRequest - 18, // 23: management.SecurityChecks.ListFailedServices:output_type -> management.ListFailedServicesResponse - 20, // 24: management.SecurityChecks.GetFailedChecks:output_type -> management.GetFailedChecksResponse - 22, // 25: management.SecurityChecks.ToggleCheckAlert:output_type -> management.ToggleCheckAlertResponse - 8, // 26: management.SecurityChecks.GetSecurityCheckResults:output_type -> management.GetSecurityCheckResultsResponse - 10, // 27: management.SecurityChecks.StartSecurityChecks:output_type -> management.StartSecurityChecksResponse - 12, // 28: management.SecurityChecks.ListSecurityChecks:output_type -> management.ListSecurityChecksResponse - 14, // 29: management.SecurityChecks.ListAdvisors:output_type -> management.ListAdvisorsResponse - 16, // 30: management.SecurityChecks.ChangeSecurityChecks:output_type -> management.ChangeSecurityChecksResponse - 23, // [23:31] is the sub-list for method output_type - 15, // [15:23] 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 + 1, // 5: management.SecurityCheck.family:type_name -> management.AdvisorCheckFamily + 5, // 6: management.Advisor.checks:type_name -> management.SecurityCheck + 0, // 7: management.ChangeSecurityCheckParams.interval:type_name -> management.SecurityCheckInterval + 2, // 8: management.GetSecurityCheckResultsResponse.results:type_name -> management.SecurityCheckResult + 5, // 9: management.ListSecurityChecksResponse.checks:type_name -> management.SecurityCheck + 6, // 10: management.ListAdvisorsResponse.advisors:type_name -> management.Advisor + 7, // 11: management.ChangeSecurityChecksRequest.params:type_name -> management.ChangeSecurityCheckParams + 3, // 12: management.ListFailedServicesResponse.result:type_name -> management.CheckResultSummary + 27, // 13: management.GetFailedChecksRequest.page_params:type_name -> management.PageParams + 4, // 14: management.GetFailedChecksResponse.results:type_name -> management.CheckResult + 28, // 15: management.GetFailedChecksResponse.page_totals:type_name -> management.PageTotals + 18, // 16: management.SecurityChecks.ListFailedServices:input_type -> management.ListFailedServicesRequest + 20, // 17: management.SecurityChecks.GetFailedChecks:input_type -> management.GetFailedChecksRequest + 22, // 18: management.SecurityChecks.ToggleCheckAlert:input_type -> management.ToggleCheckAlertRequest + 8, // 19: management.SecurityChecks.GetSecurityCheckResults:input_type -> management.GetSecurityCheckResultsRequest + 10, // 20: management.SecurityChecks.StartSecurityChecks:input_type -> management.StartSecurityChecksRequest + 12, // 21: management.SecurityChecks.ListSecurityChecks:input_type -> management.ListSecurityChecksRequest + 14, // 22: management.SecurityChecks.ListAdvisors:input_type -> management.ListAdvisorsRequest + 16, // 23: management.SecurityChecks.ChangeSecurityChecks:input_type -> management.ChangeSecurityChecksRequest + 19, // 24: management.SecurityChecks.ListFailedServices:output_type -> management.ListFailedServicesResponse + 21, // 25: management.SecurityChecks.GetFailedChecks:output_type -> management.GetFailedChecksResponse + 23, // 26: management.SecurityChecks.ToggleCheckAlert:output_type -> management.ToggleCheckAlertResponse + 9, // 27: management.SecurityChecks.GetSecurityCheckResults:output_type -> management.GetSecurityCheckResultsResponse + 11, // 28: management.SecurityChecks.StartSecurityChecks:output_type -> management.StartSecurityChecksResponse + 13, // 29: management.SecurityChecks.ListSecurityChecks:output_type -> management.ListSecurityChecksResponse + 15, // 30: management.SecurityChecks.ListAdvisors:output_type -> management.ListAdvisorsResponse + 17, // 31: management.SecurityChecks.ChangeSecurityChecks:output_type -> management.ChangeSecurityChecksResponse + 24, // [24:32] is the sub-list for method output_type + 16, // [16:24] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_managementpb_checks_proto_init() } @@ -2082,7 +2159,7 @@ func file_managementpb_checks_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_managementpb_checks_proto_rawDesc, - NumEnums: 1, + NumEnums: 2, NumMessages: 24, NumExtensions: 0, NumServices: 1, diff --git a/api/managementpb/checks.pb.validate.go b/api/managementpb/checks.pb.validate.go index be831508d9..ee0a2df498 100644 --- a/api/managementpb/checks.pb.validate.go +++ b/api/managementpb/checks.pb.validate.go @@ -422,6 +422,8 @@ func (m *SecurityCheck) validate(all bool) error { // no validation rules for Interval + // no validation rules for Family + if len(errors) > 0 { return SecurityCheckMultiError(errors) } diff --git a/api/managementpb/checks.proto b/api/managementpb/checks.proto index db3158c476..e2d9f82add 100644 --- a/api/managementpb/checks.proto +++ b/api/managementpb/checks.proto @@ -17,6 +17,13 @@ enum SecurityCheckInterval { RARE = 3; } +enum AdvisorCheckFamily { + ADVISOR_CHECK_FAMILY_INVALID = 0; + ADVISOR_CHECK_FAMILY_MYSQL = 1; + ADVISOR_CHECK_FAMILY_POSTGRESQL = 2; + ADVISOR_CHECK_FAMILY_MONGODB = 3; +} + // SecurityCheckResult represents the check result returned from pmm-managed after running the check. message SecurityCheckResult { string summary = 1; @@ -83,6 +90,8 @@ message SecurityCheck { string summary = 4; // Check execution interval. SecurityCheckInterval interval = 5; + // DB family. + AdvisorCheckFamily family = 6; } message Advisor { @@ -195,6 +204,7 @@ service SecurityChecks { } // ToggleCheckAlert allows to switch alerts state for a check result between "silenced" and "unsilenced". rpc ToggleCheckAlert(ToggleCheckAlertRequest) returns (ToggleCheckAlertResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/management/SecurityChecks/ToggleCheckAlert" body: "*" @@ -202,6 +212,7 @@ service SecurityChecks { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { summary: "Toggle Check Alert" description: "Silence/Unsilence alerts for a specific check result." + deprecated: true }; } // GetSecurityCheckResults returns Security Thread Tool's latest checks results. @@ -214,6 +225,7 @@ service SecurityChecks { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { summary: "Get Security Check Results" description: "Returns Security Thread Tool's latest checks results." + deprecated: true }; } // StartSecurityChecks executes Security Thread Tool checks and returns when all checks are executed. diff --git a/api/managementpb/checks_grpc.pb.go b/api/managementpb/checks_grpc.pb.go index bfa8496cd4..0408efe0a2 100644 --- a/api/managementpb/checks_grpc.pb.go +++ b/api/managementpb/checks_grpc.pb.go @@ -38,6 +38,7 @@ type SecurityChecksClient interface { ListFailedServices(ctx context.Context, in *ListFailedServicesRequest, opts ...grpc.CallOption) (*ListFailedServicesResponse, error) // GetFailedChecks returns the checks result for a given service. GetFailedChecks(ctx context.Context, in *GetFailedChecksRequest, opts ...grpc.CallOption) (*GetFailedChecksResponse, error) + // Deprecated: Do not use. // ToggleCheckAlert allows to switch alerts state for a check result between "silenced" and "unsilenced". ToggleCheckAlert(ctx context.Context, in *ToggleCheckAlertRequest, opts ...grpc.CallOption) (*ToggleCheckAlertResponse, error) // Deprecated: Do not use. @@ -79,6 +80,7 @@ func (c *securityChecksClient) GetFailedChecks(ctx context.Context, in *GetFaile return out, nil } +// Deprecated: Do not use. func (c *securityChecksClient) ToggleCheckAlert(ctx context.Context, in *ToggleCheckAlertRequest, opts ...grpc.CallOption) (*ToggleCheckAlertResponse, error) { out := new(ToggleCheckAlertResponse) err := c.cc.Invoke(ctx, SecurityChecks_ToggleCheckAlert_FullMethodName, in, out, opts...) @@ -142,6 +144,7 @@ type SecurityChecksServer interface { ListFailedServices(context.Context, *ListFailedServicesRequest) (*ListFailedServicesResponse, error) // GetFailedChecks returns the checks result for a given service. GetFailedChecks(context.Context, *GetFailedChecksRequest) (*GetFailedChecksResponse, error) + // Deprecated: Do not use. // ToggleCheckAlert allows to switch alerts state for a check result between "silenced" and "unsilenced". ToggleCheckAlert(context.Context, *ToggleCheckAlertRequest) (*ToggleCheckAlertResponse, error) // Deprecated: Do not use. diff --git a/api/managementpb/json/client/rds/add_rds_responses.go b/api/managementpb/json/client/rds/add_rds_responses.go index cb525e8b8c..739b758db0 100644 --- a/api/managementpb/json/client/rds/add_rds_responses.go +++ b/api/managementpb/json/client/rds/add_rds_responses.go @@ -216,6 +216,9 @@ type AddRDSBody struct { // Custom password for exporter endpoint /metrics. AgentPassword string `json:"agent_password,omitempty"` + + // Database name. + Database string `json:"database,omitempty"` } // Validate validates this add RDS body @@ -1216,10 +1219,6 @@ type AddRDSOKBodyNode struct { Az string `json:"az,omitempty"` // Custom user-assigned labels. - // - // TODO https://jira.percona.com/browse/PMM-4314 - // string az = 8; - // string node_model = 9; CustomLabels map[string]string `json:"custom_labels,omitempty"` } diff --git a/api/managementpb/json/client/security_checks/list_advisors_responses.go b/api/managementpb/json/client/security_checks/list_advisors_responses.go index 61f04cc380..cc98f1942d 100644 --- a/api/managementpb/json/client/security_checks/list_advisors_responses.go +++ b/api/managementpb/json/client/security_checks/list_advisors_responses.go @@ -492,6 +492,10 @@ type ListAdvisorsOKBodyAdvisorsItems0ChecksItems0 struct { // SecurityCheckInterval represents possible execution interval values for checks. // Enum: [SECURITY_CHECK_INTERVAL_INVALID STANDARD FREQUENT RARE] Interval *string `json:"interval,omitempty"` + + // family + // Enum: [ADVISOR_CHECK_FAMILY_INVALID ADVISOR_CHECK_FAMILY_MYSQL ADVISOR_CHECK_FAMILY_POSTGRESQL ADVISOR_CHECK_FAMILY_MONGODB] + Family *string `json:"family,omitempty"` } // Validate validates this list advisors OK body advisors items0 checks items0 @@ -502,6 +506,10 @@ func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) Validate(formats strfmt.R res = append(res, err) } + if err := o.validateFamily(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -556,6 +564,54 @@ func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) validateInterval(formats return nil } +var listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeFamilyPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ADVISOR_CHECK_FAMILY_INVALID","ADVISOR_CHECK_FAMILY_MYSQL","ADVISOR_CHECK_FAMILY_POSTGRESQL","ADVISOR_CHECK_FAMILY_MONGODB"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeFamilyPropEnum = append(listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeFamilyPropEnum, v) + } +} + +const ( + + // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYINVALID captures enum value "ADVISOR_CHECK_FAMILY_INVALID" + ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYINVALID string = "ADVISOR_CHECK_FAMILY_INVALID" + + // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYMYSQL captures enum value "ADVISOR_CHECK_FAMILY_MYSQL" + ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYMYSQL string = "ADVISOR_CHECK_FAMILY_MYSQL" + + // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYPOSTGRESQL captures enum value "ADVISOR_CHECK_FAMILY_POSTGRESQL" + ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYPOSTGRESQL string = "ADVISOR_CHECK_FAMILY_POSTGRESQL" + + // ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYMONGODB captures enum value "ADVISOR_CHECK_FAMILY_MONGODB" + ListAdvisorsOKBodyAdvisorsItems0ChecksItems0FamilyADVISORCHECKFAMILYMONGODB string = "ADVISOR_CHECK_FAMILY_MONGODB" +) + +// prop value enum +func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) validateFamilyEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAdvisorsOkBodyAdvisorsItems0ChecksItems0TypeFamilyPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) validateFamily(formats strfmt.Registry) error { + if swag.IsZero(o.Family) { // not required + return nil + } + + // value enum + if err := o.validateFamilyEnum("family", "body", *o.Family); err != nil { + return err + } + + return nil +} + // ContextValidate validates this list advisors OK body advisors items0 checks items0 based on context it is used func (o *ListAdvisorsOKBodyAdvisorsItems0ChecksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/api/managementpb/json/client/security_checks/list_security_checks_responses.go b/api/managementpb/json/client/security_checks/list_security_checks_responses.go index c5702dda19..dd59c7333b 100644 --- a/api/managementpb/json/client/security_checks/list_security_checks_responses.go +++ b/api/managementpb/json/client/security_checks/list_security_checks_responses.go @@ -379,6 +379,10 @@ type ListSecurityChecksOKBodyChecksItems0 struct { // SecurityCheckInterval represents possible execution interval values for checks. // Enum: [SECURITY_CHECK_INTERVAL_INVALID STANDARD FREQUENT RARE] Interval *string `json:"interval,omitempty"` + + // family + // Enum: [ADVISOR_CHECK_FAMILY_INVALID ADVISOR_CHECK_FAMILY_MYSQL ADVISOR_CHECK_FAMILY_POSTGRESQL ADVISOR_CHECK_FAMILY_MONGODB] + Family *string `json:"family,omitempty"` } // Validate validates this list security checks OK body checks items0 @@ -389,6 +393,10 @@ func (o *ListSecurityChecksOKBodyChecksItems0) Validate(formats strfmt.Registry) res = append(res, err) } + if err := o.validateFamily(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -443,6 +451,54 @@ func (o *ListSecurityChecksOKBodyChecksItems0) validateInterval(formats strfmt.R return nil } +var listSecurityChecksOkBodyChecksItems0TypeFamilyPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ADVISOR_CHECK_FAMILY_INVALID","ADVISOR_CHECK_FAMILY_MYSQL","ADVISOR_CHECK_FAMILY_POSTGRESQL","ADVISOR_CHECK_FAMILY_MONGODB"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listSecurityChecksOkBodyChecksItems0TypeFamilyPropEnum = append(listSecurityChecksOkBodyChecksItems0TypeFamilyPropEnum, v) + } +} + +const ( + + // ListSecurityChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYINVALID captures enum value "ADVISOR_CHECK_FAMILY_INVALID" + ListSecurityChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYINVALID string = "ADVISOR_CHECK_FAMILY_INVALID" + + // ListSecurityChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYMYSQL captures enum value "ADVISOR_CHECK_FAMILY_MYSQL" + ListSecurityChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYMYSQL string = "ADVISOR_CHECK_FAMILY_MYSQL" + + // ListSecurityChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYPOSTGRESQL captures enum value "ADVISOR_CHECK_FAMILY_POSTGRESQL" + ListSecurityChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYPOSTGRESQL string = "ADVISOR_CHECK_FAMILY_POSTGRESQL" + + // ListSecurityChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYMONGODB captures enum value "ADVISOR_CHECK_FAMILY_MONGODB" + ListSecurityChecksOKBodyChecksItems0FamilyADVISORCHECKFAMILYMONGODB string = "ADVISOR_CHECK_FAMILY_MONGODB" +) + +// prop value enum +func (o *ListSecurityChecksOKBodyChecksItems0) validateFamilyEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listSecurityChecksOkBodyChecksItems0TypeFamilyPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *ListSecurityChecksOKBodyChecksItems0) validateFamily(formats strfmt.Registry) error { + if swag.IsZero(o.Family) { // not required + return nil + } + + // value enum + if err := o.validateFamilyEnum("family", "body", *o.Family); err != nil { + return err + } + + return nil +} + // ContextValidate validates this list security checks OK body checks items0 based on context it is used func (o *ListSecurityChecksOKBodyChecksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/api/managementpb/json/managementpb.json b/api/managementpb/json/managementpb.json index 63d67d39ee..57b8c1da00 100644 --- a/api/managementpb/json/managementpb.json +++ b/api/managementpb/json/managementpb.json @@ -1434,6 +1434,17 @@ "type": "boolean", "x-order": 1 }, + "family": { + "type": "string", + "default": "ADVISOR_CHECK_FAMILY_INVALID", + "enum": [ + "ADVISOR_CHECK_FAMILY_INVALID", + "ADVISOR_CHECK_FAMILY_MYSQL", + "ADVISOR_CHECK_FAMILY_POSTGRESQL", + "ADVISOR_CHECK_FAMILY_MONGODB" + ], + "x-order": 5 + }, "interval": { "description": "SecurityCheckInterval represents possible execution interval values for checks.", "type": "string", @@ -5052,6 +5063,11 @@ }, "x-order": 18 }, + "database": { + "description": "Database name.", + "type": "string", + "x-order": 29 + }, "disable_basic_metrics": { "description": "Disable basic metrics.", "type": "boolean", @@ -5391,7 +5407,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -6349,6 +6365,7 @@ ], "summary": "Get Security Check Results", "operationId": "GetSecurityCheckResults", + "deprecated": true, "parameters": [ { "name": "body", @@ -6494,6 +6511,17 @@ "type": "boolean", "x-order": 1 }, + "family": { + "type": "string", + "default": "ADVISOR_CHECK_FAMILY_INVALID", + "enum": [ + "ADVISOR_CHECK_FAMILY_INVALID", + "ADVISOR_CHECK_FAMILY_MYSQL", + "ADVISOR_CHECK_FAMILY_POSTGRESQL", + "ADVISOR_CHECK_FAMILY_MONGODB" + ], + "x-order": 5 + }, "interval": { "description": "SecurityCheckInterval represents possible execution interval values for checks.", "type": "string", @@ -6761,6 +6789,7 @@ ], "summary": "Toggle Check Alert", "operationId": "ToggleCheckAlert", + "deprecated": true, "parameters": [ { "name": "body", diff --git a/api/managementpb/rds.pb.go b/api/managementpb/rds.pb.go index 3f812cb835..8214ca2777 100644 --- a/api/managementpb/rds.pb.go +++ b/api/managementpb/rds.pb.go @@ -358,6 +358,8 @@ type AddRDSRequest struct { QanPostgresqlPgstatements bool `protobuf:"varint,28,opt,name=qan_postgresql_pgstatements,json=qanPostgresqlPgstatements,proto3" json:"qan_postgresql_pgstatements,omitempty"` // Custom password for exporter endpoint /metrics. AgentPassword string `protobuf:"bytes,29,opt,name=agent_password,json=agentPassword,proto3" json:"agent_password,omitempty"` + // Database name. + Database string `protobuf:"bytes,30,opt,name=database,proto3" json:"database,omitempty"` } func (x *AddRDSRequest) Reset() { @@ -595,6 +597,13 @@ func (x *AddRDSRequest) GetAgentPassword() string { return "" } +func (x *AddRDSRequest) GetDatabase() string { + if x != nil { + return x.Database + } + return "" +} + type AddRDSResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -754,7 +763,7 @@ var file_managementpb_rds_proto_rawDesc = []byte{ 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0c, 0x72, 0x64, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x73, 0x22, 0x90, 0x0a, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x52, 0x44, 0x53, 0x52, 0x65, 0x71, 0x75, + 0x73, 0x22, 0xac, 0x0a, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x52, 0x44, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, @@ -831,84 +840,85 @@ var file_managementpb_rds_proto_rawDesc = []byte{ 0x50, 0x67, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, 0x22, 0xda, 0x04, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x52, 0x44, 0x53, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, - 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x72, 0x64, 0x73, 0x5f, 0x65, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x44, 0x53, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x72, 0x52, 0x0b, 0x72, 0x64, 0x73, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, - 0x12, 0x2d, 0x0a, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4d, 0x79, 0x53, 0x51, - 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, - 0x42, 0x0a, 0x0f, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x72, 0x52, 0x0e, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x14, 0x71, 0x61, 0x6e, 0x5f, 0x6d, 0x79, 0x73, 0x71, 0x6c, - 0x5f, 0x70, 0x65, 0x72, 0x66, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x51, 0x41, - 0x4e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x50, 0x65, 0x72, 0x66, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x12, 0x71, 0x61, 0x6e, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x50, - 0x65, 0x72, 0x66, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x6f, - 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x67, - 0x72, 0x65, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0a, 0x70, 0x6f, - 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, 0x12, 0x4c, 0x0a, 0x13, 0x70, 0x6f, 0x73, 0x74, - 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, - 0x79, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x72, 0x52, 0x12, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, 0x45, 0x78, - 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x12, 0x69, 0x0a, 0x1b, 0x71, 0x61, 0x6e, 0x5f, 0x70, 0x6f, - 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, 0x5f, 0x70, 0x67, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x51, 0x41, 0x4e, 0x50, 0x6f, 0x73, 0x74, 0x67, - 0x72, 0x65, 0x53, 0x51, 0x4c, 0x50, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x19, 0x71, 0x61, 0x6e, 0x50, 0x6f, 0x73, 0x74, 0x67, - 0x72, 0x65, 0x73, 0x71, 0x6c, 0x50, 0x67, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2a, 0x69, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, - 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x56, - 0x45, 0x52, 0x5f, 0x52, 0x44, 0x53, 0x5f, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x49, 0x4e, - 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x49, 0x53, 0x43, 0x4f, - 0x56, 0x45, 0x52, 0x5f, 0x52, 0x44, 0x53, 0x5f, 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x10, 0x01, 0x12, - 0x1b, 0x0a, 0x17, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x5f, 0x52, 0x44, 0x53, 0x5f, - 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45, 0x53, 0x51, 0x4c, 0x10, 0x02, 0x32, 0xae, 0x02, 0x0a, - 0x03, 0x52, 0x44, 0x53, 0x12, 0xa1, 0x01, 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x52, 0x44, 0x53, 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x92, 0x41, 0x28, 0x12, 0x0c, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x20, 0x52, 0x44, 0x53, 0x1a, 0x18, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x73, 0x20, 0x52, 0x44, 0x53, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x52, 0x44, 0x53, 0x2f, - 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x82, 0x01, 0x0a, 0x06, 0x41, 0x64, 0x64, - 0x52, 0x44, 0x53, 0x12, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x41, 0x64, 0x64, 0x52, 0x44, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, - 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x64, 0x64, 0x52, - 0x44, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x92, 0x41, 0x1d, 0x12, - 0x07, 0x41, 0x64, 0x64, 0x20, 0x52, 0x44, 0x53, 0x1a, 0x12, 0x41, 0x64, 0x64, 0x73, 0x20, 0x52, - 0x44, 0x53, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x52, 0x44, 0x53, 0x2f, 0x41, 0x64, 0x64, 0x42, 0x8b, 0x01, - 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x42, 0x08, 0x52, 0x64, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, - 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x4d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, + 0x1e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x1a, + 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, + 0x22, 0xda, 0x04, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x52, 0x44, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, + 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x72, 0x64, 0x73, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x44, 0x53, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, + 0x0b, 0x72, 0x64, 0x73, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x05, + 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x42, 0x0a, 0x0f, 0x6d, + 0x79, 0x73, 0x71, 0x6c, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, + 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, + 0x0e, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x64, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x12, + 0x54, 0x0a, 0x14, 0x71, 0x61, 0x6e, 0x5f, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x70, 0x65, 0x72, + 0x66, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x51, 0x41, 0x4e, 0x4d, 0x79, 0x53, + 0x51, 0x4c, 0x50, 0x65, 0x72, 0x66, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x52, 0x12, 0x71, 0x61, 0x6e, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x50, 0x65, 0x72, 0x66, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, + 0x65, 0x73, 0x71, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, + 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, + 0x65, 0x73, 0x71, 0x6c, 0x12, 0x4c, 0x0a, 0x13, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, + 0x71, 0x6c, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x50, 0x6f, + 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x12, + 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x72, 0x12, 0x69, 0x0a, 0x1b, 0x71, 0x61, 0x6e, 0x5f, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, + 0x65, 0x73, 0x71, 0x6c, 0x5f, 0x70, 0x67, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x2e, 0x51, 0x41, 0x4e, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x53, 0x51, + 0x4c, 0x50, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x52, 0x19, 0x71, 0x61, 0x6e, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, + 0x6c, 0x50, 0x67, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2a, 0x69, 0x0a, + 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x45, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x5f, 0x52, + 0x44, 0x53, 0x5f, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, + 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x5f, + 0x52, 0x44, 0x53, 0x5f, 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x44, + 0x49, 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x5f, 0x52, 0x44, 0x53, 0x5f, 0x50, 0x4f, 0x53, 0x54, + 0x47, 0x52, 0x45, 0x53, 0x51, 0x4c, 0x10, 0x02, 0x32, 0xae, 0x02, 0x0a, 0x03, 0x52, 0x44, 0x53, + 0x12, 0xa1, 0x01, 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, + 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x44, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x44, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x44, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x51, 0x92, 0x41, 0x28, 0x12, 0x0c, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x20, 0x52, 0x44, 0x53, 0x1a, 0x18, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x73, 0x20, + 0x52, 0x44, 0x53, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x52, 0x44, 0x53, 0x2f, 0x44, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x12, 0x82, 0x01, 0x0a, 0x06, 0x41, 0x64, 0x64, 0x52, 0x44, 0x53, 0x12, + 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x64, 0x64, + 0x52, 0x44, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x44, 0x53, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x92, 0x41, 0x1d, 0x12, 0x07, 0x41, 0x64, 0x64, + 0x20, 0x52, 0x44, 0x53, 0x1a, 0x12, 0x41, 0x64, 0x64, 0x73, 0x20, 0x52, 0x44, 0x53, 0x20, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, + 0x2a, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2f, 0x52, 0x44, 0x53, 0x2f, 0x41, 0x64, 0x64, 0x42, 0x8b, 0x01, 0x0a, 0x0e, 0x63, 0x6f, + 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x08, 0x52, 0x64, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, + 0x62, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/managementpb/rds.pb.validate.go b/api/managementpb/rds.pb.validate.go index 0954714d7d..b557aefb33 100644 --- a/api/managementpb/rds.pb.validate.go +++ b/api/managementpb/rds.pb.validate.go @@ -520,6 +520,8 @@ func (m *AddRDSRequest) validate(all bool) error { // no validation rules for AgentPassword + // no validation rules for Database + if len(errors) > 0 { return AddRDSRequestMultiError(errors) } diff --git a/api/managementpb/rds.proto b/api/managementpb/rds.proto index 9f7979559f..15c8218a5b 100644 --- a/api/managementpb/rds.proto +++ b/api/managementpb/rds.proto @@ -112,6 +112,8 @@ message AddRDSRequest { bool qan_postgresql_pgstatements = 28; // Custom password for exporter endpoint /metrics. string agent_password = 29; + // Database name. + string database = 30; } message AddRDSResponse { diff --git a/api/qanpb/json/client/object_details/object_details_client.go b/api/qanpb/json/client/object_details/object_details_client.go index c882f603b4..97e83c5de8 100644 --- a/api/qanpb/json/client/object_details/object_details_client.go +++ b/api/qanpb/json/client/object_details/object_details_client.go @@ -42,6 +42,8 @@ type ClientService interface { QueryExists(params *QueryExistsParams, opts ...ClientOption) (*QueryExistsOK, error) + SchemaByQueryID(params *SchemaByQueryIDParams, opts ...ClientOption) (*SchemaByQueryIDOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -304,6 +306,43 @@ func (a *Client) QueryExists(params *QueryExistsParams, opts ...ClientOption) (* return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +SchemaByQueryID schemas by query ID returns schema for given query ID and service ID +*/ +func (a *Client) SchemaByQueryID(params *SchemaByQueryIDParams, opts ...ClientOption) (*SchemaByQueryIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSchemaByQueryIDParams() + } + op := &runtime.ClientOperation{ + ID: "SchemaByQueryID", + Method: "POST", + PathPattern: "/v0/qan/ObjectDetails/SchemaByQueryID", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &SchemaByQueryIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*SchemaByQueryIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SchemaByQueryIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/api/qanpb/json/client/object_details/schema_by_query_id_parameters.go b/api/qanpb/json/client/object_details/schema_by_query_id_parameters.go new file mode 100644 index 0000000000..71b0ad19b2 --- /dev/null +++ b/api/qanpb/json/client/object_details/schema_by_query_id_parameters.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSchemaByQueryIDParams creates a new SchemaByQueryIDParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSchemaByQueryIDParams() *SchemaByQueryIDParams { + return &SchemaByQueryIDParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSchemaByQueryIDParamsWithTimeout creates a new SchemaByQueryIDParams object +// with the ability to set a timeout on a request. +func NewSchemaByQueryIDParamsWithTimeout(timeout time.Duration) *SchemaByQueryIDParams { + return &SchemaByQueryIDParams{ + timeout: timeout, + } +} + +// NewSchemaByQueryIDParamsWithContext creates a new SchemaByQueryIDParams object +// with the ability to set a context for a request. +func NewSchemaByQueryIDParamsWithContext(ctx context.Context) *SchemaByQueryIDParams { + return &SchemaByQueryIDParams{ + Context: ctx, + } +} + +// NewSchemaByQueryIDParamsWithHTTPClient creates a new SchemaByQueryIDParams object +// with the ability to set a custom HTTPClient for a request. +func NewSchemaByQueryIDParamsWithHTTPClient(client *http.Client) *SchemaByQueryIDParams { + return &SchemaByQueryIDParams{ + HTTPClient: client, + } +} + +/* +SchemaByQueryIDParams contains all the parameters to send to the API endpoint + + for the schema by query ID operation. + + Typically these are written to a http.Request. +*/ +type SchemaByQueryIDParams struct { + /* Body. + + SchemaByQueryIDRequest returns schema for given query ID and service ID. + */ + Body SchemaByQueryIDBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the schema by query ID params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SchemaByQueryIDParams) WithDefaults() *SchemaByQueryIDParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the schema by query ID params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SchemaByQueryIDParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the schema by query ID params +func (o *SchemaByQueryIDParams) WithTimeout(timeout time.Duration) *SchemaByQueryIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the schema by query ID params +func (o *SchemaByQueryIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the schema by query ID params +func (o *SchemaByQueryIDParams) WithContext(ctx context.Context) *SchemaByQueryIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the schema by query ID params +func (o *SchemaByQueryIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the schema by query ID params +func (o *SchemaByQueryIDParams) WithHTTPClient(client *http.Client) *SchemaByQueryIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the schema by query ID params +func (o *SchemaByQueryIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the schema by query ID params +func (o *SchemaByQueryIDParams) WithBody(body SchemaByQueryIDBody) *SchemaByQueryIDParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the schema by query ID params +func (o *SchemaByQueryIDParams) SetBody(body SchemaByQueryIDBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *SchemaByQueryIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/qanpb/json/client/object_details/schema_by_query_id_responses.go b/api/qanpb/json/client/object_details/schema_by_query_id_responses.go new file mode 100644 index 0000000000..d0df17bfdc --- /dev/null +++ b/api/qanpb/json/client/object_details/schema_by_query_id_responses.go @@ -0,0 +1,337 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SchemaByQueryIDReader is a Reader for the SchemaByQueryID structure. +type SchemaByQueryIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SchemaByQueryIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSchemaByQueryIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSchemaByQueryIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSchemaByQueryIDOK creates a SchemaByQueryIDOK with default headers values +func NewSchemaByQueryIDOK() *SchemaByQueryIDOK { + return &SchemaByQueryIDOK{} +} + +/* +SchemaByQueryIDOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type SchemaByQueryIDOK struct { + Payload *SchemaByQueryIDOKBody +} + +func (o *SchemaByQueryIDOK) Error() string { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/SchemaByQueryID][%d] schemaByQueryIdOk %+v", 200, o.Payload) +} + +func (o *SchemaByQueryIDOK) GetPayload() *SchemaByQueryIDOKBody { + return o.Payload +} + +func (o *SchemaByQueryIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(SchemaByQueryIDOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSchemaByQueryIDDefault creates a SchemaByQueryIDDefault with default headers values +func NewSchemaByQueryIDDefault(code int) *SchemaByQueryIDDefault { + return &SchemaByQueryIDDefault{ + _statusCode: code, + } +} + +/* +SchemaByQueryIDDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type SchemaByQueryIDDefault struct { + _statusCode int + + Payload *SchemaByQueryIDDefaultBody +} + +// Code gets the status code for the schema by query ID default response +func (o *SchemaByQueryIDDefault) Code() int { + return o._statusCode +} + +func (o *SchemaByQueryIDDefault) Error() string { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/SchemaByQueryID][%d] SchemaByQueryID default %+v", o._statusCode, o.Payload) +} + +func (o *SchemaByQueryIDDefault) GetPayload() *SchemaByQueryIDDefaultBody { + return o.Payload +} + +func (o *SchemaByQueryIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(SchemaByQueryIDDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/* +SchemaByQueryIDBody SchemaByQueryIDRequest returns schema for given query ID and service ID. +swagger:model SchemaByQueryIDBody +*/ +type SchemaByQueryIDBody struct { + // service id + ServiceID string `json:"service_id,omitempty"` + + // query id + QueryID string `json:"query_id,omitempty"` +} + +// Validate validates this schema by query ID body +func (o *SchemaByQueryIDBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this schema by query ID body based on context it is used +func (o *SchemaByQueryIDBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *SchemaByQueryIDBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *SchemaByQueryIDBody) UnmarshalBinary(b []byte) error { + var res SchemaByQueryIDBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +SchemaByQueryIDDefaultBody schema by query ID default body +swagger:model SchemaByQueryIDDefaultBody +*/ +type SchemaByQueryIDDefaultBody struct { + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*SchemaByQueryIDDefaultBodyDetailsItems0 `json:"details"` +} + +// Validate validates this schema by query ID default body +func (o *SchemaByQueryIDDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *SchemaByQueryIDDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SchemaByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("SchemaByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this schema by query ID default body based on the context it is used +func (o *SchemaByQueryIDDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *SchemaByQueryIDDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SchemaByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("SchemaByQueryID default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *SchemaByQueryIDDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *SchemaByQueryIDDefaultBody) UnmarshalBinary(b []byte) error { + var res SchemaByQueryIDDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +SchemaByQueryIDDefaultBodyDetailsItems0 schema by query ID default body details items0 +swagger:model SchemaByQueryIDDefaultBodyDetailsItems0 +*/ +type SchemaByQueryIDDefaultBodyDetailsItems0 struct { + // at type + AtType string `json:"@type,omitempty"` +} + +// Validate validates this schema by query ID default body details items0 +func (o *SchemaByQueryIDDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this schema by query ID default body details items0 based on context it is used +func (o *SchemaByQueryIDDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *SchemaByQueryIDDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *SchemaByQueryIDDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res SchemaByQueryIDDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +SchemaByQueryIDOKBody SchemaByQueryIDReply is schema for given query ID and service ID. +swagger:model SchemaByQueryIDOKBody +*/ +type SchemaByQueryIDOKBody struct { + // schema + Schema string `json:"schema,omitempty"` +} + +// Validate validates this schema by query ID OK body +func (o *SchemaByQueryIDOKBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this schema by query ID OK body based on context it is used +func (o *SchemaByQueryIDOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *SchemaByQueryIDOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *SchemaByQueryIDOKBody) UnmarshalBinary(b []byte) error { + var res SchemaByQueryIDOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/qanpb/json/qanpb.json b/api/qanpb/json/qanpb.json index 3a17f462ec..08adc4f289 100644 --- a/api/qanpb/json/qanpb.json +++ b/api/qanpb/json/qanpb.json @@ -2149,6 +2149,83 @@ } } } + }, + "/v0/qan/ObjectDetails/SchemaByQueryID": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "SchemaByQueryID returns schema for given queryID and serviceID.", + "operationId": "SchemaByQueryID", + "parameters": [ + { + "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", + "type": "object", + "properties": { + "query_id": { + "type": "string", + "x-order": 1 + }, + "service_id": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "description": "SchemaByQueryIDReply is schema for given query ID and service ID.", + "type": "object", + "properties": { + "schema": { + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + }, + "message": { + "type": "string", + "x-order": 1 + } + } + } + } + } + } } }, "tags": [ diff --git a/api/qanpb/object_details.pb.go b/api/qanpb/object_details.pb.go index 96f43d9a71..782db83254 100644 --- a/api/qanpb/object_details.pb.go +++ b/api/qanpb/object_details.pb.go @@ -1149,6 +1149,110 @@ func (x *QueryExistsRequest) GetQuery() string { return "" } +// SchemaByQueryIDRequest returns schema for given query ID and service ID. +type SchemaByQueryIDRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + QueryId string `protobuf:"bytes,2,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` +} + +func (x *SchemaByQueryIDRequest) Reset() { + *x = SchemaByQueryIDRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_qanpb_object_details_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SchemaByQueryIDRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SchemaByQueryIDRequest) ProtoMessage() {} + +func (x *SchemaByQueryIDRequest) ProtoReflect() protoreflect.Message { + mi := &file_qanpb_object_details_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 SchemaByQueryIDRequest.ProtoReflect.Descriptor instead. +func (*SchemaByQueryIDRequest) Descriptor() ([]byte, []int) { + return file_qanpb_object_details_proto_rawDescGZIP(), []int{16} +} + +func (x *SchemaByQueryIDRequest) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +func (x *SchemaByQueryIDRequest) GetQueryId() string { + if x != nil { + return x.QueryId + } + return "" +} + +// SchemaByQueryIDReply is schema for given query ID and service ID. +type SchemaByQueryIDReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Schema string `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"` +} + +func (x *SchemaByQueryIDReply) Reset() { + *x = SchemaByQueryIDReply{} + if protoimpl.UnsafeEnabled { + mi := &file_qanpb_object_details_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SchemaByQueryIDReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SchemaByQueryIDReply) ProtoMessage() {} + +func (x *SchemaByQueryIDReply) ProtoReflect() protoreflect.Message { + mi := &file_qanpb_object_details_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 SchemaByQueryIDReply.ProtoReflect.Descriptor instead. +func (*SchemaByQueryIDReply) Descriptor() ([]byte, []int) { + return file_qanpb_object_details_proto_rawDescGZIP(), []int{17} +} + +func (x *SchemaByQueryIDReply) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + // ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID. type ExplainFingerprintByQueryIDRequest struct { state protoimpl.MessageState @@ -1162,7 +1266,7 @@ type ExplainFingerprintByQueryIDRequest struct { func (x *ExplainFingerprintByQueryIDRequest) Reset() { *x = ExplainFingerprintByQueryIDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_qanpb_object_details_proto_msgTypes[16] + mi := &file_qanpb_object_details_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1175,7 +1279,7 @@ func (x *ExplainFingerprintByQueryIDRequest) String() string { func (*ExplainFingerprintByQueryIDRequest) ProtoMessage() {} func (x *ExplainFingerprintByQueryIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_qanpb_object_details_proto_msgTypes[16] + mi := &file_qanpb_object_details_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1188,7 +1292,7 @@ func (x *ExplainFingerprintByQueryIDRequest) ProtoReflect() protoreflect.Message // Deprecated: Use ExplainFingerprintByQueryIDRequest.ProtoReflect.Descriptor instead. func (*ExplainFingerprintByQueryIDRequest) Descriptor() ([]byte, []int) { - return file_qanpb_object_details_proto_rawDescGZIP(), []int{16} + return file_qanpb_object_details_proto_rawDescGZIP(), []int{18} } func (x *ExplainFingerprintByQueryIDRequest) GetServiceid() string { @@ -1218,7 +1322,7 @@ type ExplainFingerprintByQueryIDReply struct { func (x *ExplainFingerprintByQueryIDReply) Reset() { *x = ExplainFingerprintByQueryIDReply{} if protoimpl.UnsafeEnabled { - mi := &file_qanpb_object_details_proto_msgTypes[17] + mi := &file_qanpb_object_details_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1231,7 +1335,7 @@ func (x *ExplainFingerprintByQueryIDReply) String() string { func (*ExplainFingerprintByQueryIDReply) ProtoMessage() {} func (x *ExplainFingerprintByQueryIDReply) ProtoReflect() protoreflect.Message { - mi := &file_qanpb_object_details_proto_msgTypes[17] + mi := &file_qanpb_object_details_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1244,7 +1348,7 @@ func (x *ExplainFingerprintByQueryIDReply) ProtoReflect() protoreflect.Message { // Deprecated: Use ExplainFingerprintByQueryIDReply.ProtoReflect.Descriptor instead. func (*ExplainFingerprintByQueryIDReply) Descriptor() ([]byte, []int) { - return file_qanpb_object_details_proto_rawDescGZIP(), []int{17} + return file_qanpb_object_details_proto_rawDescGZIP(), []int{19} } func (x *ExplainFingerprintByQueryIDReply) GetExplainFingerprint() string { @@ -1284,7 +1388,7 @@ type GetSelectedQueryMetadataReply struct { func (x *GetSelectedQueryMetadataReply) Reset() { *x = GetSelectedQueryMetadataReply{} if protoimpl.UnsafeEnabled { - mi := &file_qanpb_object_details_proto_msgTypes[18] + mi := &file_qanpb_object_details_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1297,7 +1401,7 @@ func (x *GetSelectedQueryMetadataReply) String() string { func (*GetSelectedQueryMetadataReply) ProtoMessage() {} func (x *GetSelectedQueryMetadataReply) ProtoReflect() protoreflect.Message { - mi := &file_qanpb_object_details_proto_msgTypes[18] + mi := &file_qanpb_object_details_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1310,7 +1414,7 @@ func (x *GetSelectedQueryMetadataReply) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSelectedQueryMetadataReply.ProtoReflect.Descriptor instead. func (*GetSelectedQueryMetadataReply) Descriptor() ([]byte, []int) { - return file_qanpb_object_details_proto_rawDescGZIP(), []int{18} + return file_qanpb_object_details_proto_rawDescGZIP(), []int{20} } func (x *GetSelectedQueryMetadataReply) GetServiceName() string { @@ -1603,117 +1707,134 @@ var file_qanpb_object_details_proto_rawDesc = []byte{ 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x22, 0x5d, 0x0a, 0x22, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, - 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x79, 0x49, 0x64, - 0x22, 0x82, 0x01, 0x0a, 0x20, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, - 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2f, 0x0a, 0x13, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, - 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x12, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, - 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, - 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x11, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x8c, 0x03, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, - 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, - 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, - 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x21, 0x0a, - 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, - 0x20, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, - 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, - 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, - 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x32, 0xc2, 0x07, 0x0a, 0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x71, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x12, 0x1b, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x19, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x2b, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x30, 0x2f, 0x71, 0x61, 0x6e, - 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x47, - 0x65, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x0f, 0x47, 0x65, - 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x20, 0x2e, - 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, - 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x3a, 0x01, 0x2a, 0x22, 0x25, 0x2f, 0x76, 0x30, 0x2f, - 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x2f, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x12, 0x87, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, - 0x27, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, - 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, 0x30, 0x2f, - 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x2f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x79, 0x0a, 0x0c, 0x47, - 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x1d, 0x2e, 0x71, 0x61, - 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x71, 0x61, 0x6e, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, - 0x61, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, - 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x30, 0x2f, 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x79, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x1d, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, - 0x76, 0x30, 0x2f, 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, - 0x6d, 0x12, 0x78, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, - 0x12, 0x1f, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x76, 0x30, 0x2f, 0x71, 0x61, - 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0xbb, 0x01, 0x0a, 0x1b, - 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, - 0x6e, 0x74, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, 0x12, 0x2f, 0x2e, 0x71, 0x61, - 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, - 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x42, 0x79, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x71, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x61, - 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x42, 0x79, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x3c, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x36, 0x3a, 0x01, 0x2a, 0x22, 0x31, 0x2f, 0x76, 0x30, 0x2f, 0x71, 0x61, 0x6e, 0x2f, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x45, 0x78, + 0x79, 0x22, 0x52, 0x0a, 0x16, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x79, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x49, 0x64, 0x22, 0x2e, 0x0a, 0x14, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, + 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x5d, 0x0a, 0x22, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x42, 0x79, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x49, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x20, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x42, 0x79, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2f, 0x0a, 0x13, 0x65, 0x78, 0x70, + 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x6c, + 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, + 0x64, 0x65, 0x72, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x8c, 0x03, 0x0a, 0x1d, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x27, + 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, + 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, + 0x6f, 0x64, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x32, 0xd0, 0x08, 0x0a, 0x0d, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x71, 0x0a, 0x0a, 0x47, 0x65, + 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x1b, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x30, + 0x2f, 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x85, 0x01, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x12, 0x20, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x3a, 0x01, 0x2a, 0x22, 0x25, + 0x2f, 0x76, 0x30, 0x2f, 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x12, 0x27, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x71, + 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, + 0x2f, 0x76, 0x30, 0x2f, 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, + 0x79, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x12, + 0x1d, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x2d, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x30, 0x2f, 0x71, 0x61, 0x6e, 0x2f, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x47, 0x65, + 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x79, 0x0a, 0x0c, 0x47, 0x65, + 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x1d, 0x2e, 0x71, 0x61, 0x6e, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, + 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x71, 0x61, 0x6e, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, + 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x30, 0x2f, 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x78, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, + 0x69, 0x73, 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x76, + 0x30, 0x2f, 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x2f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, + 0xbb, 0x01, 0x0a, 0x1b, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, 0x12, + 0x2f, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, - 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, 0x42, 0x9f, 0x01, 0x0a, 0x0f, 0x63, 0x6f, - 0x6d, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x12, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x71, 0x61, 0x6e, 0x70, 0x62, 0x3b, 0x71, 0x61, 0x6e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xa2, 0x02, 0x03, 0x51, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x51, 0x61, 0x6e, 0x2e, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0b, 0x51, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0xe2, 0x02, 0x17, 0x51, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x51, - 0x61, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2d, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, + 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, + 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x3a, 0x01, 0x2a, 0x22, 0x31, 0x2f, 0x76, 0x30, 0x2f, + 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x2f, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, 0x12, 0x8b, 0x01, + 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, + 0x44, 0x12, 0x23, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x79, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2a, 0x3a, 0x01, 0x2a, 0x22, 0x25, 0x2f, 0x76, 0x30, 0x2f, 0x71, 0x61, 0x6e, 0x2f, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x44, 0x42, 0x9f, 0x01, 0x0a, 0x0f, + 0x63, 0x6f, 0x6d, 0x2e, 0x71, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, + 0x12, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x71, 0x61, 0x6e, 0x70, 0x62, 0x3b, 0x71, 0x61, 0x6e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x51, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x51, 0x61, 0x6e, 0x2e, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0b, 0x51, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x17, 0x51, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x0c, 0x51, 0x61, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1729,7 +1850,7 @@ func file_qanpb_object_details_proto_rawDescGZIP() []byte { } var ( - file_qanpb_object_details_proto_msgTypes = make([]protoimpl.MessageInfo, 23) + file_qanpb_object_details_proto_msgTypes = make([]protoimpl.MessageInfo, 25) file_qanpb_object_details_proto_goTypes = []interface{}{ (*MetricsRequest)(nil), // 0: qan.v1beta1.MetricsRequest (*MetricsReply)(nil), // 1: qan.v1beta1.MetricsReply @@ -1747,43 +1868,45 @@ var ( (*HistogramReply)(nil), // 13: qan.v1beta1.HistogramReply (*HistogramItem)(nil), // 14: qan.v1beta1.HistogramItem (*QueryExistsRequest)(nil), // 15: qan.v1beta1.QueryExistsRequest - (*ExplainFingerprintByQueryIDRequest)(nil), // 16: qan.v1beta1.ExplainFingerprintByQueryIDRequest - (*ExplainFingerprintByQueryIDReply)(nil), // 17: qan.v1beta1.ExplainFingerprintByQueryIDReply - (*GetSelectedQueryMetadataReply)(nil), // 18: qan.v1beta1.GetSelectedQueryMetadataReply - nil, // 19: qan.v1beta1.MetricsReply.MetricsEntry - nil, // 20: qan.v1beta1.MetricsReply.TextMetricsEntry - nil, // 21: qan.v1beta1.MetricsReply.TotalsEntry - nil, // 22: qan.v1beta1.ObjectDetailsLabelsReply.LabelsEntry - (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp - (*MapFieldEntry)(nil), // 24: qan.v1beta1.MapFieldEntry - (*Point)(nil), // 25: qan.v1beta1.Point - (ExampleFormat)(0), // 26: qan.v1beta1.ExampleFormat - (ExampleType)(0), // 27: qan.v1beta1.ExampleType - (*wrapperspb.BoolValue)(nil), // 28: google.protobuf.BoolValue + (*SchemaByQueryIDRequest)(nil), // 16: qan.v1beta1.SchemaByQueryIDRequest + (*SchemaByQueryIDReply)(nil), // 17: qan.v1beta1.SchemaByQueryIDReply + (*ExplainFingerprintByQueryIDRequest)(nil), // 18: qan.v1beta1.ExplainFingerprintByQueryIDRequest + (*ExplainFingerprintByQueryIDReply)(nil), // 19: qan.v1beta1.ExplainFingerprintByQueryIDReply + (*GetSelectedQueryMetadataReply)(nil), // 20: qan.v1beta1.GetSelectedQueryMetadataReply + nil, // 21: qan.v1beta1.MetricsReply.MetricsEntry + nil, // 22: qan.v1beta1.MetricsReply.TextMetricsEntry + nil, // 23: qan.v1beta1.MetricsReply.TotalsEntry + nil, // 24: qan.v1beta1.ObjectDetailsLabelsReply.LabelsEntry + (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp + (*MapFieldEntry)(nil), // 26: qan.v1beta1.MapFieldEntry + (*Point)(nil), // 27: qan.v1beta1.Point + (ExampleFormat)(0), // 28: qan.v1beta1.ExampleFormat + (ExampleType)(0), // 29: qan.v1beta1.ExampleType + (*wrapperspb.BoolValue)(nil), // 30: google.protobuf.BoolValue } ) var file_qanpb_object_details_proto_depIdxs = []int32{ - 23, // 0: qan.v1beta1.MetricsRequest.period_start_from:type_name -> google.protobuf.Timestamp - 23, // 1: qan.v1beta1.MetricsRequest.period_start_to:type_name -> google.protobuf.Timestamp - 24, // 2: qan.v1beta1.MetricsRequest.labels:type_name -> qan.v1beta1.MapFieldEntry - 19, // 3: qan.v1beta1.MetricsReply.metrics:type_name -> qan.v1beta1.MetricsReply.MetricsEntry - 20, // 4: qan.v1beta1.MetricsReply.text_metrics:type_name -> qan.v1beta1.MetricsReply.TextMetricsEntry - 25, // 5: qan.v1beta1.MetricsReply.sparkline:type_name -> qan.v1beta1.Point - 21, // 6: qan.v1beta1.MetricsReply.totals:type_name -> qan.v1beta1.MetricsReply.TotalsEntry - 18, // 7: qan.v1beta1.MetricsReply.metadata:type_name -> qan.v1beta1.GetSelectedQueryMetadataReply - 23, // 8: qan.v1beta1.QueryExampleRequest.period_start_from:type_name -> google.protobuf.Timestamp - 23, // 9: qan.v1beta1.QueryExampleRequest.period_start_to:type_name -> google.protobuf.Timestamp - 24, // 10: qan.v1beta1.QueryExampleRequest.labels:type_name -> qan.v1beta1.MapFieldEntry + 25, // 0: qan.v1beta1.MetricsRequest.period_start_from:type_name -> google.protobuf.Timestamp + 25, // 1: qan.v1beta1.MetricsRequest.period_start_to:type_name -> google.protobuf.Timestamp + 26, // 2: qan.v1beta1.MetricsRequest.labels:type_name -> qan.v1beta1.MapFieldEntry + 21, // 3: qan.v1beta1.MetricsReply.metrics:type_name -> qan.v1beta1.MetricsReply.MetricsEntry + 22, // 4: qan.v1beta1.MetricsReply.text_metrics:type_name -> qan.v1beta1.MetricsReply.TextMetricsEntry + 27, // 5: qan.v1beta1.MetricsReply.sparkline:type_name -> qan.v1beta1.Point + 23, // 6: qan.v1beta1.MetricsReply.totals:type_name -> qan.v1beta1.MetricsReply.TotalsEntry + 20, // 7: qan.v1beta1.MetricsReply.metadata:type_name -> qan.v1beta1.GetSelectedQueryMetadataReply + 25, // 8: qan.v1beta1.QueryExampleRequest.period_start_from:type_name -> google.protobuf.Timestamp + 25, // 9: qan.v1beta1.QueryExampleRequest.period_start_to:type_name -> google.protobuf.Timestamp + 26, // 10: qan.v1beta1.QueryExampleRequest.labels:type_name -> qan.v1beta1.MapFieldEntry 6, // 11: qan.v1beta1.QueryExampleReply.query_examples:type_name -> qan.v1beta1.QueryExample - 26, // 12: qan.v1beta1.QueryExample.example_format:type_name -> qan.v1beta1.ExampleFormat - 27, // 13: qan.v1beta1.QueryExample.example_type:type_name -> qan.v1beta1.ExampleType - 23, // 14: qan.v1beta1.ObjectDetailsLabelsRequest.period_start_from:type_name -> google.protobuf.Timestamp - 23, // 15: qan.v1beta1.ObjectDetailsLabelsRequest.period_start_to:type_name -> google.protobuf.Timestamp - 22, // 16: qan.v1beta1.ObjectDetailsLabelsReply.labels:type_name -> qan.v1beta1.ObjectDetailsLabelsReply.LabelsEntry - 23, // 17: qan.v1beta1.HistogramRequest.period_start_from:type_name -> google.protobuf.Timestamp - 23, // 18: qan.v1beta1.HistogramRequest.period_start_to:type_name -> google.protobuf.Timestamp - 24, // 19: qan.v1beta1.HistogramRequest.labels:type_name -> qan.v1beta1.MapFieldEntry + 28, // 12: qan.v1beta1.QueryExample.example_format:type_name -> qan.v1beta1.ExampleFormat + 29, // 13: qan.v1beta1.QueryExample.example_type:type_name -> qan.v1beta1.ExampleType + 25, // 14: qan.v1beta1.ObjectDetailsLabelsRequest.period_start_from:type_name -> google.protobuf.Timestamp + 25, // 15: qan.v1beta1.ObjectDetailsLabelsRequest.period_start_to:type_name -> google.protobuf.Timestamp + 24, // 16: qan.v1beta1.ObjectDetailsLabelsReply.labels:type_name -> qan.v1beta1.ObjectDetailsLabelsReply.LabelsEntry + 25, // 17: qan.v1beta1.HistogramRequest.period_start_from:type_name -> google.protobuf.Timestamp + 25, // 18: qan.v1beta1.HistogramRequest.period_start_to:type_name -> google.protobuf.Timestamp + 26, // 19: qan.v1beta1.HistogramRequest.labels:type_name -> qan.v1beta1.MapFieldEntry 14, // 20: qan.v1beta1.HistogramReply.histogram_items:type_name -> qan.v1beta1.HistogramItem 2, // 21: qan.v1beta1.MetricsReply.MetricsEntry.value:type_name -> qan.v1beta1.MetricValues 2, // 22: qan.v1beta1.MetricsReply.TotalsEntry.value:type_name -> qan.v1beta1.MetricValues @@ -1794,16 +1917,18 @@ var file_qanpb_object_details_proto_depIdxs = []int32{ 10, // 27: qan.v1beta1.ObjectDetails.GetQueryPlan:input_type -> qan.v1beta1.QueryPlanRequest 12, // 28: qan.v1beta1.ObjectDetails.GetHistogram:input_type -> qan.v1beta1.HistogramRequest 15, // 29: qan.v1beta1.ObjectDetails.QueryExists:input_type -> qan.v1beta1.QueryExistsRequest - 16, // 30: qan.v1beta1.ObjectDetails.ExplainFingerprintByQueryID:input_type -> qan.v1beta1.ExplainFingerprintByQueryIDRequest - 1, // 31: qan.v1beta1.ObjectDetails.GetMetrics:output_type -> qan.v1beta1.MetricsReply - 5, // 32: qan.v1beta1.ObjectDetails.GetQueryExample:output_type -> qan.v1beta1.QueryExampleReply - 8, // 33: qan.v1beta1.ObjectDetails.GetLabels:output_type -> qan.v1beta1.ObjectDetailsLabelsReply - 11, // 34: qan.v1beta1.ObjectDetails.GetQueryPlan:output_type -> qan.v1beta1.QueryPlanReply - 13, // 35: qan.v1beta1.ObjectDetails.GetHistogram:output_type -> qan.v1beta1.HistogramReply - 28, // 36: qan.v1beta1.ObjectDetails.QueryExists:output_type -> google.protobuf.BoolValue - 17, // 37: qan.v1beta1.ObjectDetails.ExplainFingerprintByQueryID:output_type -> qan.v1beta1.ExplainFingerprintByQueryIDReply - 31, // [31:38] is the sub-list for method output_type - 24, // [24:31] is the sub-list for method input_type + 18, // 30: qan.v1beta1.ObjectDetails.ExplainFingerprintByQueryID:input_type -> qan.v1beta1.ExplainFingerprintByQueryIDRequest + 16, // 31: qan.v1beta1.ObjectDetails.SchemaByQueryID:input_type -> qan.v1beta1.SchemaByQueryIDRequest + 1, // 32: qan.v1beta1.ObjectDetails.GetMetrics:output_type -> qan.v1beta1.MetricsReply + 5, // 33: qan.v1beta1.ObjectDetails.GetQueryExample:output_type -> qan.v1beta1.QueryExampleReply + 8, // 34: qan.v1beta1.ObjectDetails.GetLabels:output_type -> qan.v1beta1.ObjectDetailsLabelsReply + 11, // 35: qan.v1beta1.ObjectDetails.GetQueryPlan:output_type -> qan.v1beta1.QueryPlanReply + 13, // 36: qan.v1beta1.ObjectDetails.GetHistogram:output_type -> qan.v1beta1.HistogramReply + 30, // 37: qan.v1beta1.ObjectDetails.QueryExists:output_type -> google.protobuf.BoolValue + 19, // 38: qan.v1beta1.ObjectDetails.ExplainFingerprintByQueryID:output_type -> qan.v1beta1.ExplainFingerprintByQueryIDReply + 17, // 39: qan.v1beta1.ObjectDetails.SchemaByQueryID:output_type -> qan.v1beta1.SchemaByQueryIDReply + 32, // [32:40] is the sub-list for method output_type + 24, // [24:32] is the sub-list for method input_type 24, // [24:24] is the sub-list for extension type_name 24, // [24:24] is the sub-list for extension extendee 0, // [0:24] is the sub-list for field type_name @@ -2009,7 +2134,7 @@ func file_qanpb_object_details_proto_init() { } } file_qanpb_object_details_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExplainFingerprintByQueryIDRequest); i { + switch v := v.(*SchemaByQueryIDRequest); i { case 0: return &v.state case 1: @@ -2021,7 +2146,7 @@ func file_qanpb_object_details_proto_init() { } } file_qanpb_object_details_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExplainFingerprintByQueryIDReply); i { + switch v := v.(*SchemaByQueryIDReply); i { case 0: return &v.state case 1: @@ -2033,6 +2158,30 @@ func file_qanpb_object_details_proto_init() { } } file_qanpb_object_details_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExplainFingerprintByQueryIDRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_qanpb_object_details_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExplainFingerprintByQueryIDReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_qanpb_object_details_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSelectedQueryMetadataReply); i { case 0: return &v.state @@ -2051,7 +2200,7 @@ func file_qanpb_object_details_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_qanpb_object_details_proto_rawDesc, NumEnums: 0, - NumMessages: 23, + NumMessages: 25, NumExtensions: 0, NumServices: 1, }, diff --git a/api/qanpb/object_details.pb.gw.go b/api/qanpb/object_details.pb.gw.go index f035cdbe11..08f454da3e 100644 --- a/api/qanpb/object_details.pb.gw.go +++ b/api/qanpb/object_details.pb.gw.go @@ -257,6 +257,38 @@ func local_request_ObjectDetails_ExplainFingerprintByQueryID_0(ctx context.Conte return msg, metadata, err } +func request_ObjectDetails_SchemaByQueryID_0(ctx context.Context, marshaler runtime.Marshaler, client ObjectDetailsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SchemaByQueryIDRequest + 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) + } + + msg, err := client.SchemaByQueryID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_ObjectDetails_SchemaByQueryID_0(ctx context.Context, marshaler runtime.Marshaler, server ObjectDetailsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SchemaByQueryIDRequest + 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) + } + + msg, err := server.SchemaByQueryID(ctx, &protoReq) + return msg, metadata, err +} + // RegisterObjectDetailsHandlerServer registers the http handlers for service ObjectDetails to "mux". // UnaryRPC :call ObjectDetailsServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -430,6 +462,30 @@ func RegisterObjectDetailsHandlerServer(ctx context.Context, mux *runtime.ServeM forward_ObjectDetails_ExplainFingerprintByQueryID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle("POST", pattern_ObjectDetails_SchemaByQueryID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/qan.v1beta1.ObjectDetails/SchemaByQueryID", runtime.WithHTTPPathPattern("/v0/qan/ObjectDetails/SchemaByQueryID")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ObjectDetails_SchemaByQueryID_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ObjectDetails_SchemaByQueryID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil } @@ -617,6 +673,27 @@ func RegisterObjectDetailsHandlerClient(ctx context.Context, mux *runtime.ServeM forward_ObjectDetails_ExplainFingerprintByQueryID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle("POST", pattern_ObjectDetails_SchemaByQueryID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/qan.v1beta1.ObjectDetails/SchemaByQueryID", runtime.WithHTTPPathPattern("/v0/qan/ObjectDetails/SchemaByQueryID")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ObjectDetails_SchemaByQueryID_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ObjectDetails_SchemaByQueryID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + return nil } @@ -634,6 +711,8 @@ var ( pattern_ObjectDetails_QueryExists_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "qan", "ObjectDetails", "QueryExists"}, "")) pattern_ObjectDetails_ExplainFingerprintByQueryID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "qan", "ObjectDetails", "ExplainFingerprintByQueryID"}, "")) + + pattern_ObjectDetails_SchemaByQueryID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "qan", "ObjectDetails", "SchemaByQueryID"}, "")) ) var ( @@ -650,4 +729,6 @@ var ( forward_ObjectDetails_QueryExists_0 = runtime.ForwardResponseMessage forward_ObjectDetails_ExplainFingerprintByQueryID_0 = runtime.ForwardResponseMessage + + forward_ObjectDetails_SchemaByQueryID_0 = runtime.ForwardResponseMessage ) diff --git a/api/qanpb/object_details.pb.validate.go b/api/qanpb/object_details.pb.validate.go index b59b656fb9..01720554cb 100644 --- a/api/qanpb/object_details.pb.validate.go +++ b/api/qanpb/object_details.pb.validate.go @@ -2317,6 +2317,216 @@ var _ interface { ErrorName() string } = QueryExistsRequestValidationError{} +// Validate checks the field values on SchemaByQueryIDRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *SchemaByQueryIDRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SchemaByQueryIDRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// SchemaByQueryIDRequestMultiError, or nil if none found. +func (m *SchemaByQueryIDRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *SchemaByQueryIDRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for ServiceId + + // no validation rules for QueryId + + if len(errors) > 0 { + return SchemaByQueryIDRequestMultiError(errors) + } + + return nil +} + +// SchemaByQueryIDRequestMultiError is an error wrapping multiple validation +// errors returned by SchemaByQueryIDRequest.ValidateAll() if the designated +// constraints aren't met. +type SchemaByQueryIDRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SchemaByQueryIDRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SchemaByQueryIDRequestMultiError) AllErrors() []error { return m } + +// SchemaByQueryIDRequestValidationError is the validation error returned by +// SchemaByQueryIDRequest.Validate if the designated constraints aren't met. +type SchemaByQueryIDRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SchemaByQueryIDRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SchemaByQueryIDRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SchemaByQueryIDRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SchemaByQueryIDRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SchemaByQueryIDRequestValidationError) ErrorName() string { + return "SchemaByQueryIDRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e SchemaByQueryIDRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSchemaByQueryIDRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SchemaByQueryIDRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SchemaByQueryIDRequestValidationError{} + +// Validate checks the field values on SchemaByQueryIDReply with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *SchemaByQueryIDReply) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SchemaByQueryIDReply with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// SchemaByQueryIDReplyMultiError, or nil if none found. +func (m *SchemaByQueryIDReply) ValidateAll() error { + return m.validate(true) +} + +func (m *SchemaByQueryIDReply) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Schema + + if len(errors) > 0 { + return SchemaByQueryIDReplyMultiError(errors) + } + + return nil +} + +// SchemaByQueryIDReplyMultiError is an error wrapping multiple validation +// errors returned by SchemaByQueryIDReply.ValidateAll() if the designated +// constraints aren't met. +type SchemaByQueryIDReplyMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SchemaByQueryIDReplyMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SchemaByQueryIDReplyMultiError) AllErrors() []error { return m } + +// SchemaByQueryIDReplyValidationError is the validation error returned by +// SchemaByQueryIDReply.Validate if the designated constraints aren't met. +type SchemaByQueryIDReplyValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SchemaByQueryIDReplyValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SchemaByQueryIDReplyValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SchemaByQueryIDReplyValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SchemaByQueryIDReplyValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SchemaByQueryIDReplyValidationError) ErrorName() string { + return "SchemaByQueryIDReplyValidationError" +} + +// Error satisfies the builtin error interface +func (e SchemaByQueryIDReplyValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSchemaByQueryIDReply.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SchemaByQueryIDReplyValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SchemaByQueryIDReplyValidationError{} + // Validate checks the field values on ExplainFingerprintByQueryIDRequest with // the rules defined in the proto definition for this message. If any rules // are violated, the first error encountered is returned, or nil if there are diff --git a/api/qanpb/object_details.proto b/api/qanpb/object_details.proto index b96472e76b..31e0e43945 100644 --- a/api/qanpb/object_details.proto +++ b/api/qanpb/object_details.proto @@ -60,6 +60,13 @@ service ObjectDetails { body: "*" }; } + // SchemaByQueryID returns schema for given queryID and serviceID. + rpc SchemaByQueryID(SchemaByQueryIDRequest) returns (SchemaByQueryIDReply) { + option (google.api.http) = { + post: "/v0/qan/ObjectDetails/SchemaByQueryID" + body: "*" + }; + } } // MetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. @@ -195,6 +202,17 @@ message QueryExistsRequest { string query = 2; } +// SchemaByQueryIDRequest returns schema for given query ID and service ID. +message SchemaByQueryIDRequest { + string service_id = 1; + string query_id = 2; +} + +// SchemaByQueryIDReply is schema for given query ID and service ID. +message SchemaByQueryIDReply { + string schema = 1; +} + // ExplainFingerprintByQueryIDRequest get explain fingerprint for given query ID. message ExplainFingerprintByQueryIDRequest { string serviceid = 1; diff --git a/api/qanpb/object_details_grpc.pb.go b/api/qanpb/object_details_grpc.pb.go index b2386e8f30..26a2bbc5c2 100644 --- a/api/qanpb/object_details_grpc.pb.go +++ b/api/qanpb/object_details_grpc.pb.go @@ -28,6 +28,7 @@ const ( ObjectDetails_GetHistogram_FullMethodName = "/qan.v1beta1.ObjectDetails/GetHistogram" ObjectDetails_QueryExists_FullMethodName = "/qan.v1beta1.ObjectDetails/QueryExists" ObjectDetails_ExplainFingerprintByQueryID_FullMethodName = "/qan.v1beta1.ObjectDetails/ExplainFingerprintByQueryID" + ObjectDetails_SchemaByQueryID_FullMethodName = "/qan.v1beta1.ObjectDetails/SchemaByQueryID" ) // ObjectDetailsClient is the client API for ObjectDetails service. @@ -48,6 +49,8 @@ type ObjectDetailsClient interface { QueryExists(ctx context.Context, in *QueryExistsRequest, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) // ExplainFingerprintByQueryID get explain fingerprint for given query ID. ExplainFingerprintByQueryID(ctx context.Context, in *ExplainFingerprintByQueryIDRequest, opts ...grpc.CallOption) (*ExplainFingerprintByQueryIDReply, error) + // SchemaByQueryID returns schema for given queryID and serviceID. + SchemaByQueryID(ctx context.Context, in *SchemaByQueryIDRequest, opts ...grpc.CallOption) (*SchemaByQueryIDReply, error) } type objectDetailsClient struct { @@ -121,6 +124,15 @@ func (c *objectDetailsClient) ExplainFingerprintByQueryID(ctx context.Context, i return out, nil } +func (c *objectDetailsClient) SchemaByQueryID(ctx context.Context, in *SchemaByQueryIDRequest, opts ...grpc.CallOption) (*SchemaByQueryIDReply, error) { + out := new(SchemaByQueryIDReply) + err := c.cc.Invoke(ctx, ObjectDetails_SchemaByQueryID_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ObjectDetailsServer is the server API for ObjectDetails service. // All implementations must embed UnimplementedObjectDetailsServer // for forward compatibility @@ -139,6 +151,8 @@ type ObjectDetailsServer interface { QueryExists(context.Context, *QueryExistsRequest) (*wrapperspb.BoolValue, error) // ExplainFingerprintByQueryID get explain fingerprint for given query ID. ExplainFingerprintByQueryID(context.Context, *ExplainFingerprintByQueryIDRequest) (*ExplainFingerprintByQueryIDReply, error) + // SchemaByQueryID returns schema for given queryID and serviceID. + SchemaByQueryID(context.Context, *SchemaByQueryIDRequest) (*SchemaByQueryIDReply, error) mustEmbedUnimplementedObjectDetailsServer() } @@ -172,6 +186,10 @@ func (UnimplementedObjectDetailsServer) QueryExists(context.Context, *QueryExist func (UnimplementedObjectDetailsServer) ExplainFingerprintByQueryID(context.Context, *ExplainFingerprintByQueryIDRequest) (*ExplainFingerprintByQueryIDReply, error) { return nil, status.Errorf(codes.Unimplemented, "method ExplainFingerprintByQueryID not implemented") } + +func (UnimplementedObjectDetailsServer) SchemaByQueryID(context.Context, *SchemaByQueryIDRequest) (*SchemaByQueryIDReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method SchemaByQueryID not implemented") +} func (UnimplementedObjectDetailsServer) mustEmbedUnimplementedObjectDetailsServer() {} // UnsafeObjectDetailsServer may be embedded to opt out of forward compatibility for this service. @@ -311,6 +329,24 @@ func _ObjectDetails_ExplainFingerprintByQueryID_Handler(srv interface{}, ctx con return interceptor(ctx, in, info, handler) } +func _ObjectDetails_SchemaByQueryID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SchemaByQueryIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectDetailsServer).SchemaByQueryID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ObjectDetails_SchemaByQueryID_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectDetailsServer).SchemaByQueryID(ctx, req.(*SchemaByQueryIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ObjectDetails_ServiceDesc is the grpc.ServiceDesc for ObjectDetails service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -346,6 +382,10 @@ var ObjectDetails_ServiceDesc = grpc.ServiceDesc{ MethodName: "ExplainFingerprintByQueryID", Handler: _ObjectDetails_ExplainFingerprintByQueryID_Handler, }, + { + MethodName: "SchemaByQueryID", + Handler: _ObjectDetails_SchemaByQueryID_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "qanpb/object_details.proto", diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index 9acb518b72..4889fe431a 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -2199,6 +2199,83 @@ } } }, + "/v0/qan/ObjectDetails/SchemaByQueryID": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "SchemaByQueryID returns schema for given queryID and serviceID.", + "operationId": "SchemaByQueryID", + "parameters": [ + { + "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "SchemaByQueryIDRequest returns schema for given query ID and service ID.", + "type": "object", + "properties": { + "service_id": { + "type": "string", + "x-order": 0 + }, + "query_id": { + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "description": "SchemaByQueryIDReply is schema for given query ID and service ID.", + "type": "object", + "properties": { + "schema": { + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + } + } + } + } + } + } + }, "/v1/AWSInstanceCheck": { "post": { "description": "Checks AWS EC2 instance ID.", @@ -12819,80 +12896,613 @@ } } }, - "x-order": 14 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 + "x-order": 14 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/Remove": { + "post": { + "description": "Removes Agent.", + "tags": [ + "Agents" + ], + "summary": "Remove Agent", + "operationId": "RemoveAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "force": { + "description": "Remove agent with all dependencies.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/Add": { + "post": { + "description": "Adds a Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Node", + "operationId": "AddNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "generic": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 4 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 5 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 6 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + }, + "x-order": 0 + }, + "container": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 2 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 3 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 4 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + }, + "x-order": 1 + }, + "remote": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 2 + }, + "remote_rds": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 3 + }, + "remote_azure": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 4 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "generic": { + "description": "GenericNode represents a bare metal server or virtual machine.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 3 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 4 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + }, + "x-order": 0 + }, + "container": { + "description": "ContainerNode represents a Docker container.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + }, + "x-order": 1 + }, + "remote": { + "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 2 }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } + "remote_rds": { + "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 }, - "additionalProperties": false + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/Remove": { - "post": { - "description": "Removes Agent.", - "tags": [ - "Agents" - ], - "summary": "Remove Agent", - "operationId": "RemoveAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 + "x-order": 3 }, - "force": { - "description": "Remove agent with all dependencies.", - "type": "boolean", - "x-order": 1 + "remote_azure_database": { + "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 4 } } } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } }, "default": { "description": "An unexpected error response.", @@ -12930,12 +13540,13 @@ }, "/v1/inventory/Nodes/AddContainer": { "post": { - "description": "Adds container Node.", + "description": "Adds a container Node.", "tags": [ "Nodes" ], - "summary": "Add Container Node", + "summary": "Add a Container Node", "operationId": "AddContainerNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -13101,12 +13712,13 @@ }, "/v1/inventory/Nodes/AddGeneric": { "post": { - "description": "Adds generic Node.", + "description": "Adds a generic Node.", "tags": [ "Nodes" ], - "summary": "Add Generic Node", + "summary": "Add a Generic Node", "operationId": "AddGenericNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -13262,12 +13874,13 @@ }, "/v1/inventory/Nodes/AddRemote": { "post": { - "description": "Adds remote Node.", + "description": "Adds a remote Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Node", + "summary": "Add a Remote Node", "operationId": "AddRemoteNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -13403,12 +14016,13 @@ }, "/v1/inventory/Nodes/AddRemoteAzureDatabase": { "post": { - "description": "Adds remote Azure database Node.", + "description": "Adds a remote Azure database Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Azure Database Node", + "summary": "Adda a Remote Azure Database Node", "operationId": "AddRemoteAzureDatabaseNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -13544,12 +14158,13 @@ }, "/v1/inventory/Nodes/AddRemoteRDS": { "post": { - "description": "Adds remote RDS Node.", + "description": "Adds a remote RDS Node.", "tags": [ "Nodes" ], - "summary": "Add Remote RDS Node", + "summary": "Add a Remote RDS Node", "operationId": "AddRemoteRDSNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -13636,7 +14251,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -13909,7 +14524,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -14247,7 +14862,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -14345,11 +14960,11 @@ }, "/v1/inventory/Nodes/Remove": { "post": { - "description": "Removes Node.", + "description": "Removes a Node.", "tags": [ "Nodes" ], - "summary": "Remove Node", + "summary": "Remove a Node", "operationId": "RemoveNode", "parameters": [ { @@ -15403,6 +16018,87 @@ } } }, + "/v1/inventory/Services/Change": { + "post": { + "description": "Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks.", + "tags": [ + "Services" + ], + "summary": "Change service", + "operationId": "ChangeService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "x-order": 0 + }, + "environment": { + "type": "string", + "x-order": 1 + }, + "cluster": { + "type": "string", + "x-order": 2 + }, + "replication_set": { + "type": "string", + "x-order": 3 + }, + "external_group": { + "type": "string", + "x-order": 4 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + } + } + } + } + } + } + }, "/v1/inventory/Services/CustomLabels/Add": { "post": { "description": "Adds or replaces (if the key exists) custom labels for a Service.", @@ -18023,6 +18719,17 @@ "RARE" ], "x-order": 4 + }, + "family": { + "type": "string", + "default": "ADVISOR_CHECK_FAMILY_INVALID", + "enum": [ + "ADVISOR_CHECK_FAMILY_INVALID", + "ADVISOR_CHECK_FAMILY_MYSQL", + "ADVISOR_CHECK_FAMILY_POSTGRESQL", + "ADVISOR_CHECK_FAMILY_MONGODB" + ], + "x-order": 5 } } }, @@ -27710,6 +28417,11 @@ "description": "Custom password for exporter endpoint /metrics.", "type": "string", "x-order": 28 + }, + "database": { + "description": "Database name.", + "type": "string", + "x-order": 29 } } } @@ -27756,7 +28468,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -29426,6 +30138,7 @@ ], "summary": "Get Security Check Results", "operationId": "GetSecurityCheckResults", + "deprecated": true, "parameters": [ { "name": "body", @@ -29592,6 +30305,17 @@ "RARE" ], "x-order": 4 + }, + "family": { + "type": "string", + "default": "ADVISOR_CHECK_FAMILY_INVALID", + "enum": [ + "ADVISOR_CHECK_FAMILY_INVALID", + "ADVISOR_CHECK_FAMILY_MYSQL", + "ADVISOR_CHECK_FAMILY_POSTGRESQL", + "ADVISOR_CHECK_FAMILY_MONGODB" + ], + "x-order": 5 } } }, @@ -29838,6 +30562,7 @@ ], "summary": "Toggle Check Alert", "operationId": "ToggleCheckAlert", + "deprecated": true, "parameters": [ { "name": "body", @@ -30704,7 +31429,7 @@ "type": "object", "properties": { "yaml": { - "description": "YAML (or JSON) template file content.", + "description": "YAML template file content.", "type": "string", "x-order": 0 } @@ -31064,7 +31789,7 @@ "x-order": 9 }, "yaml": { - "description": "YAML (or JSON) template file content. Empty for built-in and SaaS templates.", + "description": "YAML template file content. Empty for built-in and SaaS templates.", "type": "string", "x-order": 10 } @@ -31149,7 +31874,7 @@ "x-order": 0 }, "yaml": { - "description": "YAML (or JSON) template file content.", + "description": "YAML template file content.", "type": "string", "x-order": 1 } diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index 691518570b..d5aa7f3b77 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -10161,14 +10161,548 @@ } } }, + "/v1/inventory/Nodes/Add": { + "post": { + "description": "Adds a Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Node", + "operationId": "AddNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "generic": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 4 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 5 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 6 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + }, + "x-order": 0 + }, + "container": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 2 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 3 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 4 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + }, + "x-order": 1 + }, + "remote": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 2 + }, + "remote_rds": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 3 + }, + "remote_azure": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 4 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "generic": { + "description": "GenericNode represents a bare metal server or virtual machine.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 3 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 4 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + }, + "x-order": 0 + }, + "container": { + "description": "ContainerNode represents a Docker container.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + }, + "x-order": 1 + }, + "remote": { + "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 2 + }, + "remote_rds": { + "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 3 + }, + "remote_azure_database": { + "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 4 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + } + } + } + } + } + } + }, "/v1/inventory/Nodes/AddContainer": { "post": { - "description": "Adds container Node.", + "description": "Adds a container Node.", "tags": [ "Nodes" ], - "summary": "Add Container Node", + "summary": "Add a Container Node", "operationId": "AddContainerNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -10334,12 +10868,13 @@ }, "/v1/inventory/Nodes/AddGeneric": { "post": { - "description": "Adds generic Node.", + "description": "Adds a generic Node.", "tags": [ "Nodes" ], - "summary": "Add Generic Node", + "summary": "Add a Generic Node", "operationId": "AddGenericNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -10495,12 +11030,13 @@ }, "/v1/inventory/Nodes/AddRemote": { "post": { - "description": "Adds remote Node.", + "description": "Adds a remote Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Node", + "summary": "Add a Remote Node", "operationId": "AddRemoteNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -10636,12 +11172,13 @@ }, "/v1/inventory/Nodes/AddRemoteAzureDatabase": { "post": { - "description": "Adds remote Azure database Node.", + "description": "Adds a remote Azure database Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Azure Database Node", + "summary": "Adda a Remote Azure Database Node", "operationId": "AddRemoteAzureDatabaseNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -10777,12 +11314,13 @@ }, "/v1/inventory/Nodes/AddRemoteRDS": { "post": { - "description": "Adds remote RDS Node.", + "description": "Adds a remote RDS Node.", "tags": [ "Nodes" ], - "summary": "Add Remote RDS Node", + "summary": "Add a Remote RDS Node", "operationId": "AddRemoteRDSNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -10869,7 +11407,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -11142,7 +11680,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -11480,7 +12018,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -11578,11 +12116,11 @@ }, "/v1/inventory/Nodes/Remove": { "post": { - "description": "Removes Node.", + "description": "Removes a Node.", "tags": [ "Nodes" ], - "summary": "Remove Node", + "summary": "Remove a Node", "operationId": "RemoveNode", "parameters": [ { @@ -12636,6 +13174,87 @@ } } }, + "/v1/inventory/Services/Change": { + "post": { + "description": "Changes service configuration. If a new cluster label is specified, it removes all backup/restore tasks scheduled for the related services. Fails if there are running backup/restore tasks.", + "tags": [ + "Services" + ], + "summary": "Change service", + "operationId": "ChangeService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "service_id": { + "type": "string", + "x-order": 0 + }, + "environment": { + "type": "string", + "x-order": 1 + }, + "cluster": { + "type": "string", + "x-order": 2 + }, + "replication_set": { + "type": "string", + "x-order": 3 + }, + "external_group": { + "type": "string", + "x-order": 4 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + } + } + } + } + } + } + }, "/v1/inventory/Services/CustomLabels/Add": { "post": { "description": "Adds or replaces (if the key exists) custom labels for a Service.", @@ -15256,6 +15875,17 @@ "RARE" ], "x-order": 4 + }, + "family": { + "type": "string", + "default": "ADVISOR_CHECK_FAMILY_INVALID", + "enum": [ + "ADVISOR_CHECK_FAMILY_INVALID", + "ADVISOR_CHECK_FAMILY_MYSQL", + "ADVISOR_CHECK_FAMILY_POSTGRESQL", + "ADVISOR_CHECK_FAMILY_MONGODB" + ], + "x-order": 5 } } }, @@ -18956,6 +19586,11 @@ "description": "Custom password for exporter endpoint /metrics.", "type": "string", "x-order": 28 + }, + "database": { + "description": "Database name.", + "type": "string", + "x-order": 29 } } } @@ -19002,7 +19637,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -20130,6 +20765,7 @@ ], "summary": "Get Security Check Results", "operationId": "GetSecurityCheckResults", + "deprecated": true, "parameters": [ { "name": "body", @@ -20296,6 +20932,17 @@ "RARE" ], "x-order": 4 + }, + "family": { + "type": "string", + "default": "ADVISOR_CHECK_FAMILY_INVALID", + "enum": [ + "ADVISOR_CHECK_FAMILY_INVALID", + "ADVISOR_CHECK_FAMILY_MYSQL", + "ADVISOR_CHECK_FAMILY_POSTGRESQL", + "ADVISOR_CHECK_FAMILY_MONGODB" + ], + "x-order": 5 } } }, @@ -20542,6 +21189,7 @@ ], "summary": "Toggle Check Alert", "operationId": "ToggleCheckAlert", + "deprecated": true, "parameters": [ { "name": "body", @@ -20891,7 +21539,7 @@ "type": "object", "properties": { "yaml": { - "description": "YAML (or JSON) template file content.", + "description": "YAML template file content.", "type": "string", "x-order": 0 } @@ -21251,7 +21899,7 @@ "x-order": 9 }, "yaml": { - "description": "YAML (or JSON) template file content. Empty for built-in and SaaS templates.", + "description": "YAML template file content. Empty for built-in and SaaS templates.", "type": "string", "x-order": 10 } @@ -21336,7 +21984,7 @@ "x-order": 0 }, "yaml": { - "description": "YAML (or JSON) template file content.", + "description": "YAML template file content.", "type": "string", "x-order": 1 } diff --git a/build/ansible/pmm2/post-build-actions.yml b/build/ansible/pmm2/post-build-actions.yml index 0f5fafdc10..65d29b38e0 100644 --- a/build/ansible/pmm2/post-build-actions.yml +++ b/build/ansible/pmm2/post-build-actions.yml @@ -127,10 +127,20 @@ ignore_errors: yes when: ansible_virtualization_type != "docker" - - name: Remove pmm-managed database + - name: Remove pmm-managed database EL7 + when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' + postgresql_db: + login_user: postgres + name: pmm-managed + state: absent + register: db_check_result + + - name: Remove pmm-managed database EL9 + when: (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9' postgresql_db: login_user: postgres name: pmm-managed + force: true state: absent register: db_check_result diff --git a/build/ansible/roles/ami-ovf/tasks/main.yml b/build/ansible/roles/ami-ovf/tasks/main.yml index 6fdec5edd7..fd30f8009f 100644 --- a/build/ansible/roles/ami-ovf/tasks/main.yml +++ b/build/ansible/roles/ami-ovf/tasks/main.yml @@ -31,12 +31,39 @@ enabled: yes gpgkey: file:///etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY -- name: Disable SELinux +- name: Disable SELinux | EL7 + when: + - ansible_distribution == 'CentOS' + - ansible_distribution_major_version == '7' selinux: policy: targeted state: permissive -- name: PMM | Add firewalld rule +- name: Disable SELinux | EL9 + when: + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' + vars: + ansible_python_interpreter: /usr/bin/python3.9 + selinux: + policy: targeted + state: permissive + +- name: Add firewalld rule | EL7 + when: + - ansible_distribution == 'CentOS' + - ansible_distribution_major_version == '7' + firewalld: port={{ item }} permanent=true state=enabled immediate=yes + with_items: + - 80/tcp + - 443/tcp + +- name: Add firewalld rule | EL9 + when: + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' + vars: + ansible_python_interpreter: /usr/bin/python3.9 firewalld: port={{ item }} permanent=true state=enabled immediate=yes with_items: - 80/tcp diff --git a/build/ansible/roles/cloud-node/tasks/main.yml b/build/ansible/roles/cloud-node/tasks/main.yml index 2a0305fc36..b5fb6bcf6b 100644 --- a/build/ansible/roles/cloud-node/tasks/main.yml +++ b/build/ansible/roles/cloud-node/tasks/main.yml @@ -38,11 +38,26 @@ - yum-utils - cloud-init - firewalld - - python3-pip - - ansible + - python3-libselinux + - python3-firewall -- name: Firewalld | Start - when: ansible_os_family == 'RedHat' +- name: Firewalld | Start EL7 + when: + - ansible_distribution == 'CentOS' + - ansible_distribution_major_version == '7' + - ansible_os_family == 'RedHat' + service: + name: firewalld + state: started + enabled: yes + +- name: Firewalld | Start EL9 + when: + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' + - ansible_os_family == 'RedHat' + vars: + ansible_python_interpreter: /usr/bin/python3.9 service: name: firewalld state: started @@ -129,10 +144,25 @@ regexp: "name: centos" replace: "name: admin" -- name: change cloud user EL9 | Change cloud user - when: create_admin == "true" and (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9' +- name: change cloud user for OVF EL9 | Change cloud user + when: + - create_admin == "true" + - ansible_virtualization_type == "virtualbox" + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' replace: dest: /etc/cloud/cloud.cfg + regexp: "name: cloud-user" + replace: "name: admin" + +- name: change cloud user for AMI EL9 | Change cloud user + when: + - create_admin == "true" + - ansible_virtualization_type != "virtualbox" + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' + replace: + dest: /etc/cloud/cloud.cfg.d/00_ol-default-user.cfg regexp: "name: ec2-user" replace: "name: admin" diff --git a/build/ansible/roles/lvm-init/tasks/main.yml b/build/ansible/roles/lvm-init/tasks/main.yml index 269e0b5f9d..d1b2c37572 100644 --- a/build/ansible/roles/lvm-init/tasks/main.yml +++ b/build/ansible/roles/lvm-init/tasks/main.yml @@ -1,7 +1,9 @@ --- - name: Packages | Install OS tools yum: - name: lvm2 + name: + - lvm2 + - cronie state: installed - block: diff --git a/build/ansible/roles/pmm2-images/files/grafana.ini b/build/ansible/roles/pmm2-images/files/grafana.ini index c8ebe91b4b..0e8b05106c 100644 --- a/build/ansible/roles/pmm2-images/files/grafana.ini +++ b/build/ansible/roles/pmm2-images/files/grafana.ini @@ -4,16 +4,9 @@ [program:grafana] priority = 3 command = - /usr/sbin/grafana-server + /usr/sbin/grafana server --homepath=/usr/share/grafana --config=/etc/grafana/grafana.ini - cfg:default.paths.data=/srv/grafana - cfg:default.paths.plugins=/srv/grafana/plugins - cfg:default.paths.logs=/srv/logs - cfg:default.log.mode=console - cfg:default.log.console.format=console - cfg:default.server.root_url="https://%%(domain)s/graph" - user = grafana directory = /usr/share/grafana autorestart = true diff --git a/build/ansible/roles/pmm2-images/tasks/main.yml b/build/ansible/roles/pmm2-images/tasks/main.yml index 9787ed845f..6fed510de7 100644 --- a/build/ansible/roles/pmm2-images/tasks/main.yml +++ b/build/ansible/roles/pmm2-images/tasks/main.yml @@ -29,7 +29,7 @@ # local yum repo for building of pmm server docker image in autobuild jobs - name: PMM | Add local YUM repository - when: ansible_virtualization_type == "docker" + when: ansible_virtualization_type == "docker" yum_repository: name: local description: Local YUM repository - x86_64 @@ -47,13 +47,25 @@ state: installed ignore_errors: True -- name: Packages | Update OS +- name: Packages | Update OS EL7 + when: + - ansible_distribution == "CentOS" + - ansible_distribution_major_version == "7" yum: name: "*" state: latest exclude: "ansible*" disablerepo: percona-release-x86_64 +- name: Packages | Update OS EL9 + when: + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' + yum: + name: "*" + state: latest + disablerepo: percona-release-x86_64 + - name: Packages | Install OS tools for EL7 when: - ansible_distribution == "CentOS" @@ -70,7 +82,6 @@ name: - python3-pip - python3.11-pip - - python3.11 - python3.11-psycopg2 - rsync - libsqlite3x-devel # package does not come pre-installed on EL9 @@ -104,11 +115,11 @@ group: "{{ item.group }}" non_unique: true loop: - - { name: pmm, uid: 1000, comment: "PMM Server", shell: "/bin/false", home: "/home/pmm", group: pmm } - - { name: nginx, uid: 999, comment: "nginx user", shell: "/sbin/nologin", home: "/var/cache/nginx", group: nginx } - - { name: grafana, uid: 998, comment: "Grafana Dashboard", shell: "/sbin/nologin", home: "/etc/grafana", group: grafana } - - { name: clickhouse, uid: 997, comment: "Clickhouse server", shell: "/sbin/nologin", home: "/var/lib/clickhouse", group: clickhouse } - - { name: pmm-agent, uid: 996, comment: "pmm-agent", shell: "/bin/false", home: "/usr/local/percona/", group: pmm-agent } + - { name: pmm, uid: 1000, comment: "PMM Server", shell: "/bin/false", home: "/home/pmm", group: pmm, } + - { name: nginx, uid: 999, comment: "nginx user", shell: "/sbin/nologin", home: "/var/cache/nginx", group: nginx, } + - { name: grafana, uid: 998, comment: "Grafana Dashboard", shell: "/sbin/nologin", home: "/etc/grafana", group: grafana, } + - { name: clickhouse, uid: 997, comment: "Clickhouse server", shell: "/sbin/nologin", home: "/var/lib/clickhouse", group: clickhouse, } + - { name: pmm-agent, uid: 996, comment: "pmm-agent", shell: "/bin/false", home: "/usr/local/percona/", group: pmm-agent, } when: ansible_virtualization_type == "docker" - name: Create directories | Create dirs @@ -149,6 +160,7 @@ - pmm-update - dbaas-controller - dbaas-tools + - grafana-db-migrator - pmm-dump - vmproxy state: installed diff --git a/build/docker/rpmbuild/Dockerfile b/build/docker/rpmbuild/Dockerfile index 72520d0807..27cca12914 100644 --- a/build/docker/rpmbuild/Dockerfile +++ b/build/docker/rpmbuild/Dockerfile @@ -23,7 +23,7 @@ RUN yum update -y && \ yum clean all && rm -rf /var/cache/yum # keep that format for easier search -ENV GO_VERSION 1.20.5 +ENV GO_VERSION 1.21.1 ENV GO_RELEASER_VERSION 1.15.2 RUN if [ `uname -i` == "x86_64" ]; then ARCH=amd64; else ARCH=arm64; fi && \ diff --git a/build/docker/rpmbuild/Dockerfile.el9 b/build/docker/rpmbuild/Dockerfile.el9 index 223ccb1af7..0a744c0a47 100644 --- a/build/docker/rpmbuild/Dockerfile.el9 +++ b/build/docker/rpmbuild/Dockerfile.el9 @@ -24,7 +24,7 @@ RUN yum update -y && \ yum clean all && rm -rf /var/cache/yum # keep that format for easier search -ENV GO_VERSION 1.20.5 +ENV GO_VERSION 1.21.1 ENV GO_RELEASER_VERSION 1.15.2 RUN if [ `uname -i` == "x86_64" ]; then ARCH=amd64; else ARCH=arm64; fi && \ diff --git a/build/docker/server/Dockerfile.el9 b/build/docker/server/Dockerfile.el9 index 603a341565..4fb9001f98 100644 --- a/build/docker/server/Dockerfile.el9 +++ b/build/docker/server/Dockerfile.el9 @@ -6,6 +6,7 @@ ARG BUILD_DATE ENV LANG=en_US.utf8 ENV LC_ALL=en_US.utf8 ENV GF_PLUGIN_DIR=/srv/grafana/plugins +ENV PS1="[\u@\h \W] # " LABEL org.opencontainers.image.created ${BUILD_DATE} LABEL org.opencontainers.image.licenses AGPL-3.0 @@ -17,19 +18,14 @@ EXPOSE 80 443 WORKDIR /opt -# NOTE: Ansible should NOT be installed via yum/dnf -# Read more: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#pip-install -# RUN microdnf -y install yum && yum -y install python3-pip && \ -# yum -y install oracle-epel-release-el9 ansible-core && \ -# python3 -m pip install ansible && \ -# python3 -m pip install setuptools && \ -# yum -y install epel-release - -RUN microdnf -y install yum && yum -y install python3-pip && \ - yum -y install oracle-epel-release-el9 ansible-core && \ - yum -y install epel-release && \ - yum -y install glibc-langpack-en && \ - yum -y install ansible vi +RUN microdnf -y install epel-release && \ + microdnf -y install ansible-core \ + ansible-collection-community-general \ + ansible-collection-community-postgresql \ + ansible-collection-ansible-posix \ + glibc-langpack-en \ + yum \ + vi COPY RPMS /tmp/RPMS COPY gitCommit /tmp/gitCommit @@ -38,8 +34,8 @@ COPY ansible /opt/ansible # NOTE: this needs to be refactored, since some of the playbooks are duplicates RUN cp -r /opt/ansible/roles /opt/ansible/pmm2-docker/roles RUN ansible-playbook -vvv -i 'localhost,' -c local /opt/ansible/pmm2-docker/main.yml \ - && ansible-playbook -vvv -i 'localhost,' -c local /usr/share/pmm-update/ansible/playbook/tasks/update.yml \ - && ansible-playbook -vvv -i 'localhost,' -c local /opt/ansible/pmm2/post-build-actions.yml + && ansible-playbook -vvv -i 'localhost,' -c local /usr/share/pmm-update/ansible/playbook/tasks/update.yml \ + && ansible-playbook -vvv -i 'localhost,' -c local /opt/ansible/pmm2/post-build-actions.yml COPY entrypoint.sh /opt/entrypoint.sh HEALTHCHECK --interval=3s --timeout=2s --start-period=10s --retries=3 CMD curl -f http://127.0.0.1/v1/readyz || exit 1 diff --git a/build/packages/deb/postinst b/build/packages/deb/postinst index 7db574a2bd..7e32b4bf93 100644 --- a/build/packages/deb/postinst +++ b/build/packages/deb/postinst @@ -25,7 +25,7 @@ case "$1" in ;; *) - echo "postinst called with unknown argument \`$1'" >&2 + echo "postinst called with unknown argument '$1'" >&2 exit 1 ;; esac diff --git a/build/packages/rpm/server/SPECS/grafana-db-migrator.spec b/build/packages/rpm/server/SPECS/grafana-db-migrator.spec index 303924aba5..70de6bd075 100644 --- a/build/packages/rpm/server/SPECS/grafana-db-migrator.spec +++ b/build/packages/rpm/server/SPECS/grafana-db-migrator.spec @@ -46,5 +46,4 @@ install -m 755 dist/grafana-db-migrator %{buildroot}%{_sbindir}/ - Add fixes for CHAR fields * Tue Nov 02 2021 Nikita Beletskii - 1.0.1-1 -- Creating package for grafana-db-migrator - +- Creating package for grafana-db-migrator \ No newline at end of file diff --git a/build/packages/rpm/server/SPECS/percona-dashboards.spec b/build/packages/rpm/server/SPECS/percona-dashboards.spec index 737465184c..d5b756cf24 100644 --- a/build/packages/rpm/server/SPECS/percona-dashboards.spec +++ b/build/packages/rpm/server/SPECS/percona-dashboards.spec @@ -7,7 +7,7 @@ %global commit ad4af6808bcd361284e8eb8cd1f36b1e98e32bce %global shortcommit %(c=%{commit}; echo ${c:0:7}) %define build_timestamp %(date -u +"%y%m%d%H%M") -%define release 19 +%define release 20 %define rpm_release %{release}.%{build_timestamp}.%{shortcommit}%{?dist} Name: percona-dashboards @@ -44,19 +44,22 @@ install -d %{buildroot}%{_datadir}/%{name} install -d %{buildroot}%{_datadir}/%{name}/panels/pmm-app install -d %{buildroot}%{_datadir}/%{name}/setup-page -cp -pa ./panels %{buildroot}%{_datadir}/%{name} -cp -pa ./pmm-app/dist %{buildroot}%{_datadir}/%{name}/panels/pmm-app -cp -rpa ./setup-page/build/* %{buildroot}%{_datadir}/%{name}/setup-page +cp -a ./panels %{buildroot}%{_datadir}/%{name} +cp -a ./pmm-app/dist %{buildroot}%{_datadir}/%{name}/panels/pmm-app +cp -ra ./setup-page/build/* %{buildroot}%{_datadir}/%{name}/setup-page echo %{version} > %{buildroot}%{_datadir}/%{name}/VERSION %files %license LICENSE %doc README.md LICENSE -%{_datadir}/%{name} +%attr(-,grafana,grafana) %{_datadir}/%{name} %changelog +* Wed Jul 12 2023 Alex Tymchuk - 2.39.0-20 +- PMM-12231 Set grafana user as owner of plugins directory + * Tue May 16 2023 Oleksii Kysil - 2.38.0-1 - PMM-12118 Skip stripping of plugin binaries diff --git a/build/packages/rpm/server/SPECS/pmm-dump.spec b/build/packages/rpm/server/SPECS/pmm-dump.spec index 24ae2ee76c..c4175cda2c 100644 --- a/build/packages/rpm/server/SPECS/pmm-dump.spec +++ b/build/packages/rpm/server/SPECS/pmm-dump.spec @@ -31,6 +31,7 @@ install -d -p %{buildroot}%{_sbindir} install -p -m 0755 pmm-dump %{buildroot}%{_sbindir}/pmm-dump %files +%license LICENSE %doc README.md %{_sbindir}/pmm-dump diff --git a/build/packages/rpm/server/SPECS/victoriametrics.spec b/build/packages/rpm/server/SPECS/victoriametrics.spec index 52e849a091..ec55d239d1 100644 --- a/build/packages/rpm/server/SPECS/victoriametrics.spec +++ b/build/packages/rpm/server/SPECS/victoriametrics.spec @@ -9,10 +9,10 @@ %global repo VictoriaMetrics %global provider github.com/VictoriaMetrics/%{repo} -%global commit pmm-6401-v1.89.1 +%global commit pmm-6401-v1.93.4 Name: percona-victoriametrics -Version: 1.89.1 +Version: 1.93.4 Release: 1%{?dist} Summary: VictoriaMetrics monitoring solution and time series database License: Apache-2.0 @@ -43,14 +43,20 @@ install -D -p -m 0755 ./bin/vmalert-pure %{buildroot}%{_sbindir}/vmalert %files -%copying LICENSE +%license LICENSE %doc README.md %{_sbindir}/victoriametrics %{_sbindir}/vmalert %changelog -* Thu Mar 29 2023 Alexey Mukas - 1.89.1 +* Thu Sep 14 2023 Alex Tymchuk - 1.93.4-1 +- upgrade victoriametrics to 1.93.4 release + +* Fri Sep 1 2023 Nurlan Moldomurov - 1.93.1-2 +- upgrade victoriametrics to 1.93.1 release + +* Wed Mar 29 2023 Alexey Mukas - 1.89.1 - upgrade victoriametrics to 1.89.1 release * Thu Oct 20 2022 Michal Kralik - 1.82.1 diff --git a/build/packer/pmm2.el9.json b/build/packer/pmm2.el9.json index 29d985022b..baa0ef18f2 100644 --- a/build/packer/pmm2.el9.json +++ b/build/packer/pmm2.el9.json @@ -26,7 +26,7 @@ ], "region": "us-east-1", "security_group_id": "sg-688c2b1c", - "source_ami": "ami-0845395779540e3cb", + "source_ami": "ami-0da806cbfc9e67dbb", "ssh_pty": "true", "ena_support": "true", "ssh_username": "ec2-user", @@ -114,7 +114,8 @@ "inline": [ "sudo yum -y update", "sudo yum -y install epel-release", - "sudo yum -y install ansible" + "sudo yum -y install ansible-core", + "sudo yum -y install ansible-collection-community-general ansible-collection-community-postgresql ansible-collection-ansible-posix" ] }, { diff --git a/build/scripts/build-server-rpm b/build/scripts/build-server-rpm index 09ddbb83c1..0ceccebb23 100755 --- a/build/scripts/build-server-rpm +++ b/build/scripts/build-server-rpm @@ -126,7 +126,7 @@ build() { sleep 1 done - sudo yum-builddep --randomwait=5 -y SOURCES/${spec_name}.spec + sudo yum-builddep --randomwait=1 -y SOURCES/${spec_name}.spec spectool -C SOURCES -g SOURCES/${spec_name}.spec rpmbuild --define '_rpmdir %{_topdir}/RPMS/${spec_name}-${rpm_version}' --define 'dist .${rpmbuild_dist}' -ba SOURCES/${spec_name}.spec diff --git a/build/scripts/build-server-rpm-all b/build/scripts/build-server-rpm-all index 113937db22..d9cb1a59a2 100755 --- a/build/scripts/build-server-rpm-all +++ b/build/scripts/build-server-rpm-all @@ -12,11 +12,13 @@ ${bin_dir}/build-server-rpm pmm-update pmm ${bin_dir}/build-server-rpm dbaas-controller ${bin_dir}/build-server-rpm dbaas-tools ${bin_dir}/build-server-rpm pmm-dump +${bin_dir}/build-server-rpm grafana-db-migrator ${bin_dir}/build-server-rpm vmproxy pmm # 3rd-party ${bin_dir}/build-server-rpm victoriametrics ${bin_dir}/build-server-rpm alertmanager ${bin_dir}/build-server-rpm grafana +# ${bin_dir}/build-server-rpm grafana-db-migrator # vim: expandtab shiftwidth=4 tabstop=4 diff --git a/build/scripts/create-tags b/build/scripts/create-tags new file mode 100755 index 0000000000..0f12d9f27c --- /dev/null +++ b/build/scripts/create-tags @@ -0,0 +1,78 @@ +#!/bin/bash +# Important: This script should never cause the pipeline to fail, so that the tags can be created outside of it. +# To run it locally, you need pass the version, i.e. export VERSION=2.39.x +# If run locally, it: +# - clones pmm-submodules repository and checks out the branch corresponding to the version +# - skips git ssh configuration and expects the user to set it up ahead of time +# - uses the current user's creds and email to push tags to the repos, therefore sufficient git permissions are required + +set +o errexit +set +o nounset +set -o xtrace + +# List of repositories whose release branches need to be tagged +declare repos=( + "sources/pmm/src/github.com/percona/pmm" + "sources/grafana/src/github.com/grafana/grafana" + "sources/grafana-dashboards" + "." +) + +# These setting are only needed when running in CI (Jenkins or github actions) +if [ -n "$CI" ]; then + # Configure git settings globally + git config --global advice.detachedHead false + git config --global user.email "noreply@percona.com" + git config --global user.name "PMM Jenkins" + + # Configure git to push using ssh + export GIT_SSH_COMMAND="/usr/bin/ssh -i ${SSHKEY} -o StrictHostKeyChecking=no -o LogLevel=error -o UserKnownHostsFile=/dev/null" +fi + +TAG="v${VERSION}" +echo "We will be tagging repos with a tag: $TAG" + +REPO_DIR=pmm-submodules +if [ -d "$REPO_DIR" ]; then + echo "Error: the directory $REPO_DIR already exists, exiting..." + exit 0 # this is on purpose, we don't want to fail the pipeline +fi + +if ! git clone --branch "pmm-${VERSION}" --single-branch https://github.com/Percona-Lab/pmm-submodules "$REPO_DIR"; then + echo "Fatal: failed to clone pmm-submodules, branch pmm-${VERSION}" + exit 0 +fi + +cd "$REPO_DIR" >/dev/null +git submodule update --init + +for REPO in "${repos[@]}"; do + pushd "$REPO" >/dev/null + REPO_URL=$(git config --get remote.origin.url | sed -e "s|^https://github.com/||") + git remote set-url origin git@github.com:${REPO_URL}.git + + if git tag -l | grep "$TAG"; then + echo "Fatal: tag $TAG already exists in $REPO, exiting..." + break + fi + + echo "Tagging SHA: $(git rev-parse HEAD)" + if [ -n "$CI" ]; then + # We can't sign tags in CI, so we create them without signing + git tag --message="Version $VERSION." "$TAG" + else + git tag --message="Version $VERSION." --sign "$TAG" + fi + + if ! git push origin "$TAG"; then + echo "Fatal: failed to tag the repository $REPO with $TAG, exiting..." + popd >/dev/null + break + fi + popd >/dev/null +done + +git submodule status +cd - +rm -rf "$REPO_DIR" +unset repos diff --git a/build/scripts/create-tags.py b/build/scripts/create-tags.py deleted file mode 100755 index a8c3a426eb..0000000000 --- a/build/scripts/create-tags.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/python2 - -from __future__ import print_function, unicode_literals -import os, subprocess, time - -REPOS = [ - "sources/pmm/src/github.com/percona/pmm", - "sources/dbaas-controller/src/github.com/percona-platform/dbaas-controller", - "sources/pmm-dump", - "sources/pmm-qa/src/github.com/percona/pmm-qa", - "sources/pmm-ui-tests/src/github.com/percona/pmm-ui-tests", - "sources/grafana/src/github.com/grafana/grafana", - "sources/grafana-dashboards", - "sources/node_exporter/src/github.com/prometheus/node_exporter", - "sources/mysqld_exporter/src/github.com/percona/mysqld_exporter", - "sources/mongodb_exporter/src/github.com/percona/mongodb_exporter", - "sources/postgres_exporter/src/github.com/percona/postgres_exporter", - "sources/clickhouse_exporter/src/github.com/Percona-Lab/clickhouse_exporter", - "sources/proxysql_exporter/src/github.com/percona/proxysql_exporter", - "sources/rds_exporter/src/github.com/percona/rds_exporter", - "sources/azure_metrics_exporter/src/github.com/percona/azure_metrics_exporter", - ".", -] - -tty = subprocess.check_output("tty", shell=True).strip() -env = os.environ.copy() -env["GPG_TTY"] = tty - -with open("./VERSION", "r") as f: - version = f.read().strip() - -print(tty, version) - -subprocess.check_call("git submodule update", shell=True) - -for repo in REPOS: - print("==>", repo) - - tag = "v" + version - cmd = "git tag --message='Version {version}.' --sign {tag}".format(version=version, tag=tag) - print(">", cmd) - subprocess.check_call(cmd, shell=True, cwd=repo, env=env) - - cmd = "git push origin {tag}".format(tag=tag) - print(">", cmd) - subprocess.check_call(cmd, shell=True, cwd=repo) - -subprocess.check_call("git submodule status", shell=True) diff --git a/build/scripts/vars b/build/scripts/vars index bd267aa95e..789377c71b 100644 --- a/build/scripts/vars +++ b/build/scripts/vars @@ -55,5 +55,5 @@ docker_client_tarball=${root_dir}/results/docker/pmm2-client-${pmm_version}.dock source_tarball=${root_dir}/results/source_tarball/pmm2-client-${pmm_version}.tar.gz binary_tarball=${root_dir}/results/tarball/pmm2-client-${pmm_version}.tar.gz -# https://github.com/VictoriaMetrics/VictoriaMetrics/tree/pmm-6401-v1.89.1 -vmagent_commit_hash=88b4c30021ea0785bd052de537252a5cb9a8da3e +# https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/pmm-6401-v1.93.4 +vmagent_commit_hash=58ecb9066574f38f1d1c91ace467316e7f175b09 diff --git a/cli-tests/package-lock.json b/cli-tests/package-lock.json index 3de0541299..c4dbc70b74 100644 --- a/cli-tests/package-lock.json +++ b/cli-tests/package-lock.json @@ -15,18 +15,18 @@ "playwright": "^1.33.0", "promise-retry": "^2.0.1", "shelljs": "^0.8.5", - "typescript": "^5.1.3" + "typescript": "^5.2.2" }, "devDependencies": { "@types/promise-retry": "^1.1.3", "@types/shelljs": "^0.8.12", - "@typescript-eslint/eslint-plugin": "^5.60.1", - "@typescript-eslint/parser": "^5.60.1", - "eslint": "8.44", + "@typescript-eslint/eslint-plugin": "^6.7.0", + "@typescript-eslint/parser": "^6.7.0", + "eslint": "8.50", "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-airbnb-typescript": "^17.0.0", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-playwright": "^0.15.2" + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-plugin-import": "^2.28.0", + "eslint-plugin-playwright": "^0.16.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -39,9 +39,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz", - "integrity": "sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" @@ -54,18 +54,18 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.0.tgz", - "integrity": "sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", + "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", - "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -86,18 +86,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", - "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", + "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -245,9 +245,9 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==", "dev": true }, "node_modules/@types/shelljs": { @@ -261,32 +261,33 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.60.1.tgz", - "integrity": "sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.0.tgz", + "integrity": "sha512-gUqtknHm0TDs1LhY12K2NA3Rmlmp88jK9Tx8vGZMfHeNMLE3GH2e9TRub+y+SOjuYgtOmok+wt1AyDPZqxbNag==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.60.1", - "@typescript-eslint/type-utils": "5.60.1", - "@typescript-eslint/utils": "5.60.1", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.7.0", + "@typescript-eslint/type-utils": "6.7.0", + "@typescript-eslint/utils": "6.7.0", + "@typescript-eslint/visitor-keys": "6.7.0", "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -295,25 +296,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.1.tgz", - "integrity": "sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.0.tgz", + "integrity": "sha512-jZKYwqNpNm5kzPVP5z1JXAuxjtl2uG+5NpaMocFPTNC2EdYIgbXIPImObOkhbONxtFTTdoZstLZefbaK+wXZng==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.60.1", - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/typescript-estree": "5.60.1", + "@typescript-eslint/scope-manager": "6.7.0", + "@typescript-eslint/types": "6.7.0", + "@typescript-eslint/typescript-estree": "6.7.0", + "@typescript-eslint/visitor-keys": "6.7.0", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -322,16 +324,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.1.tgz", - "integrity": "sha512-Dn/LnN7fEoRD+KspEOV0xDMynEmR3iSHdgNsarlXNLGGtcUok8L4N71dxUgt3YvlO8si7E+BJ5Fe3wb5yUw7DQ==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.0.tgz", + "integrity": "sha512-lAT1Uau20lQyjoLUQ5FUMSX/dS07qux9rYd5FGzKz/Kf8W8ccuvMyldb8hadHdK/qOI7aikvQWqulnEq2nCEYA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/visitor-keys": "5.60.1" + "@typescript-eslint/types": "6.7.0", + "@typescript-eslint/visitor-keys": "6.7.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -339,25 +341,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.60.1.tgz", - "integrity": "sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.0.tgz", + "integrity": "sha512-f/QabJgDAlpSz3qduCyQT0Fw7hHpmhOzY/Rv6zO3yO+HVIdPfIWhrQoAyG+uZVtWAIS85zAyzgAFfyEr+MgBpg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.60.1", - "@typescript-eslint/utils": "5.60.1", + "@typescript-eslint/typescript-estree": "6.7.0", + "@typescript-eslint/utils": "6.7.0", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -366,12 +368,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.1.tgz", - "integrity": "sha512-zDcDx5fccU8BA0IDZc71bAtYIcG9PowaOwaD8rjYbqwK7dpe/UMQl3inJ4UtUK42nOCT41jTSCwg76E62JpMcg==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.0.tgz", + "integrity": "sha512-ihPfvOp7pOcN/ysoj0RpBPOx3HQTJTrIN8UZK+WFd3/iDeFHHqeyYxa4hQk4rMhsz9H9mXpR61IzwlBVGXtl9Q==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -379,21 +381,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.1.tgz", - "integrity": "sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.0.tgz", + "integrity": "sha512-dPvkXj3n6e9yd/0LfojNU8VMUGHWiLuBZvbM6V6QYD+2qxqInE7J+J/ieY2iGwR9ivf/R/haWGkIj04WVUeiSQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/visitor-keys": "5.60.1", + "@typescript-eslint/types": "6.7.0", + "@typescript-eslint/visitor-keys": "6.7.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -406,42 +408,41 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.60.1.tgz", - "integrity": "sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.0.tgz", + "integrity": "sha512-MfCq3cM0vh2slSikQYqK2Gq52gvOhe57vD2RM3V4gQRZYX4rDPnKLu5p6cm89+LJiGlwEXU8hkYxhqqEC/V3qA==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.60.1", - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/typescript-estree": "5.60.1", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.7.0", + "@typescript-eslint/types": "6.7.0", + "@typescript-eslint/typescript-estree": "6.7.0", + "semver": "^7.5.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.1.tgz", - "integrity": "sha512-xEYIxKcultP6E/RMKqube11pGjXH1DCo60mQoWhVYyKfLkwbIVVjYxmOenNMxILx0TjCujPTjjnTIVzm09TXIw==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.0.tgz", + "integrity": "sha512-/C1RVgKFDmGMcVGeD8HjKv2bd72oI1KxQDeY8uc66gw9R0OK0eMq48cA+jv9/2Ag6cdrsUGySm1yzYmfz0hxwQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.60.1", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.7.0", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -449,9 +450,9 @@ } }, "node_modules/acorn": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz", - "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -515,6 +516,19 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-includes": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", @@ -543,6 +557,25 @@ "node": ">=8" } }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz", + "integrity": "sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.flat": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", @@ -579,6 +612,38 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", + "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -710,9 +775,9 @@ "dev": true }, "node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", "dev": true, "dependencies": { "has-property-descriptors": "^1.0.0", @@ -766,35 +831,50 @@ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" }, "node_modules/es-abstract": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.4.tgz", - "integrity": "sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", + "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", "dev": true, "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.1", + "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.3", + "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.2", + "object-inspect": "^1.12.3", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", + "regexp.prototype.flags": "^1.5.0", + "safe-array-concat": "^1.0.0", "safe-regex-test": "^1.0.0", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" @@ -803,6 +883,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-shim-unscopables": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", @@ -842,27 +936,27 @@ } }, "node_modules/eslint": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz", - "integrity": "sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", + "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.1.0", - "@eslint/js": "8.44.0", - "@humanwhocodes/config-array": "^0.11.10", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.50.0", + "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.6.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -872,7 +966,6 @@ "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", @@ -884,7 +977,6 @@ "natural-compare": "^1.4.0", "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { @@ -926,16 +1018,16 @@ } }, "node_modules/eslint-config-airbnb-typescript": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.0.0.tgz", - "integrity": "sha512-elNiuzD0kPAPTXjFWg+lE24nMdHMtuxgYoD30OyMD6yrW1AhFZPAg27VX7d3tzOErw+dgJTNWfRSDqEcXb4V0g==", + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.1.0.tgz", + "integrity": "sha512-GPxI5URre6dDpJ0CtcthSZVBAfI+Uw7un5OYNVxP2EYi3H81Jw701yFP7AU+/vCE7xBtFmjge7kfhhk4+RAiig==", "dev": true, "dependencies": { "eslint-config-airbnb-base": "^15.0.0" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.13.0", - "@typescript-eslint/parser": "^5.0.0", + "@typescript-eslint/eslint-plugin": "^5.13.0 || ^6.0.0", + "@typescript-eslint/parser": "^5.0.0 || ^6.0.0", "eslint": "^7.32.0 || ^8.2.0", "eslint-plugin-import": "^2.25.3" } @@ -961,9 +1053,9 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", - "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "dependencies": { "debug": "^3.2.7" @@ -987,26 +1079,29 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.27.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", - "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "version": "2.28.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.0.tgz", + "integrity": "sha512-B8s/n+ZluN7sxj9eUf7/pRFERX0r5bnFA2dCaLHy2ZeaQEAz0k+ZZkFWRFHJAqxfxQDx6KLv9LeIki7cFdwW+Q==", "dev": true, "dependencies": { "array-includes": "^3.1.6", + "array.prototype.findlastindex": "^1.2.2", "array.prototype.flat": "^1.3.1", "array.prototype.flatmap": "^1.3.1", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.7", - "eslint-module-utils": "^2.7.4", + "eslint-module-utils": "^2.8.0", "has": "^1.0.3", - "is-core-module": "^2.11.0", + "is-core-module": "^2.12.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", + "object.fromentries": "^2.0.6", + "object.groupby": "^1.0.0", "object.values": "^1.1.6", - "resolve": "^1.22.1", - "semver": "^6.3.0", - "tsconfig-paths": "^3.14.1" + "resolve": "^1.22.3", + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" }, "engines": { "node": ">=4" @@ -1037,18 +1132,18 @@ } }, "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" } }, "node_modules/eslint-plugin-playwright": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.15.2.tgz", - "integrity": "sha512-Q2jQ7ORjZscvwxR6MEgITZy23vxlnYlJlMR7aICFczWVMijTCZPGvvMoZaLWkAzx5J6fciulwbg+JJeRjMkTig==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.16.0.tgz", + "integrity": "sha512-DcHpF0SLbNeh9MT4pMzUGuUSnJ7q5MWbP8sSEFIMS6j7Ggnduq8ghNlfhURgty4c1YFny7Ge9xYTO1FSAoV2Vw==", "dev": true, "peerDependencies": { "eslint": ">=7", @@ -1060,23 +1155,10 @@ } } }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1086,9 +1168,9 @@ } }, "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", - "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -1111,9 +1193,9 @@ } }, "node_modules/espree": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", - "integrity": "sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { "acorn": "^8.9.0", @@ -1169,15 +1251,6 @@ "node": ">=4.0" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -1301,6 +1374,15 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1352,13 +1434,14 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", - "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { @@ -1413,9 +1496,9 @@ } }, "node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -1427,6 +1510,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -1447,11 +1545,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/graphemer": { "version": "1.4.0", @@ -1500,6 +1604,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -1528,9 +1644,9 @@ } }, "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, "engines": { "node": ">= 4" @@ -1576,12 +1692,12 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.0", + "get-intrinsic": "^1.2.0", "has": "^1.0.3", "side-channel": "^1.0.4" }, @@ -1597,6 +1713,20 @@ "node": ">= 0.10" } }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -1638,9 +1768,9 @@ } }, "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "dependencies": { "has": "^1.0.3" }, @@ -1787,6 +1917,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -1799,6 +1944,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1929,9 +2080,9 @@ } }, "node_modules/minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1949,16 +2100,10 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2005,6 +2150,35 @@ "node": ">= 0.4" } }, + "node_modules/object.fromentries": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", + "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.0.tgz", + "integrity": "sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.21.2", + "get-intrinsic": "^1.2.1" + } + }, "node_modules/object.values": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", @@ -2229,14 +2403,14 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -2246,11 +2420,11 @@ } }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.3.tgz", + "integrity": "sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==", "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.12.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -2326,6 +2500,24 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safe-array-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", + "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", @@ -2341,9 +2533,9 @@ } }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -2415,6 +2607,23 @@ "node": ">=8" } }, + "node_modules/string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/string.prototype.trimend": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", @@ -2517,39 +2726,30 @@ "node": ">=8.0" } }, + "node_modules/ts-api-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.1.tgz", + "integrity": "sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -2574,10 +2774,75 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typescript": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", - "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -2641,6 +2906,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-typed-array": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/cli-tests/package.json b/cli-tests/package.json index 94e07b67a8..f6fe7cd1aa 100644 --- a/cli-tests/package.json +++ b/cli-tests/package.json @@ -19,17 +19,17 @@ "playwright": "^1.33.0", "promise-retry": "^2.0.1", "shelljs": "^0.8.5", - "typescript": "^5.1.3" + "typescript": "^5.2.2" }, "devDependencies": { "@types/promise-retry": "^1.1.3", "@types/shelljs": "^0.8.12", - "@typescript-eslint/eslint-plugin": "^5.60.1", - "@typescript-eslint/parser": "^5.60.1", - "eslint": "8.44", + "@typescript-eslint/eslint-plugin": "^6.7.0", + "@typescript-eslint/parser": "^6.7.0", + "eslint": "8.50", "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-airbnb-typescript": "^17.0.0", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-playwright": "^0.15.2" + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-plugin-import": "^2.28.0", + "eslint-plugin-playwright": "^0.16.0" } } diff --git a/dev/mongo-rs-backups/docker-compose.yml b/dev/mongo-rs-backups/docker-compose.yml index 458674b664..001be6355c 100644 --- a/dev/mongo-rs-backups/docker-compose.yml +++ b/dev/mongo-rs-backups/docker-compose.yml @@ -1,6 +1,7 @@ networks: pmm_default: name: pmm_default + external: true services: mongo1: diff --git a/devcontainer.Dockerfile b/devcontainer.Dockerfile index 8c0addb822..0f12d4180a 100644 --- a/devcontainer.Dockerfile +++ b/devcontainer.Dockerfile @@ -2,11 +2,11 @@ ARG PMM_SERVER_IMAGE="perconalab/pmm-server:dev-latest" FROM $PMM_SERVER_IMAGE ARG PMM_SERVER_IMAGE -ARG GO_VERSION="1.20.x" +ARG GO_VERSION="1.21.x" -RUN echo "Building with: GO: ${GO_VERSION}, PMM: ${PMM_SERVER_IMAGE}" && \ - export GOPATH=$(go env GOPATH) && \ - export PATH="${GOPATH}/bin:${PATH}" +RUN echo "Building with: GO: $GO_VERSION, PMM: $PMM_SERVER_IMAGE" +ENV GOPATH=/root/go +ENV PATH="$PATH:$GOPATH/bin" RUN mkdir -p $GOPATH/src/github.com/percona/pmm WORKDIR $GOPATH/src/github.com/percona/pmm diff --git a/docker-compose.yml b/docker-compose.yml index d516be2235..566c7495d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -100,20 +100,45 @@ services: # /opt/entrypoint.sh # " - # PMM with external ClickHouse DB + # PMM with external DBs ch: profiles: - - pmm-ch + - pmm-external-dbs image: ${CH_IMAGE:-clickhouse/clickhouse-server:22.6.9.11-alpine} platform: linux/amd64 hostname: ${CH_HOSTNAME:-ch} ports: - ${CH_PORT:-9000}:9000 - pmm-server-ch: + networks: + - ${NETWORK:-default} + victoriametrics: + profiles: + - pmm-external-dbs + hostname: ${VM_HOSTNAME:-victoriametrics} + image: victoriametrics/victoria-metrics:v1.88.1 + ports: + - 8428:8428 + - 8089:8089 + - 8089:8089/udp + - 2003:2003 + - 2003:2003/udp + - 4242:4242 + volumes: + - vmdata:/storage + command: + - "--storageDataPath=/storage" + - "--graphiteListenAddr=:2003" + - "--opentsdbListenAddr=:4242" + - "--httpListenAddr=:8428" + - "--influxListenAddr=:8089" + networks: + - ${NETWORK:-default} + pmm-managed-server-ch: profiles: - - pmm-ch + - pmm-external-dbs depends_on: - ch + - victoriametrics image: ${PMM_CONTAINER:-perconalab/pmm-server:dev-container} container_name: pmm-server hostname: pmm-server @@ -136,7 +161,8 @@ services: - PERCONA_TEST_PMM_CLICKHOUSE_DATABASE=pmm - PERCONA_TEST_PMM_CLICKHOUSE_BLOCK_SIZE=10000 - PERCONA_TEST_PMM_CLICKHOUSE_POOL_SIZE=2 - # - PMM_DEBUG=1 + - PMM_VM_URL=${PMM_VM_URL:-http://victoriametrics:8428/} + - PMM_DEBUG=1 - PERCONA_TEST_DBAAS_PMM_CLIENT=perconalab/pmm-client:dev-latest extra_hosts: @@ -161,13 +187,6 @@ services: - ${PMM_PORT_HTTPS:-443}:443 # For headless delve - ${PMM_PORT_DELVE:-2345}:2345 - # PG - - ${PMM_PORT_PG:-15432}:5432 - # VM - - ${PMM_PORT_VM:-9090}:9090 - # CH - - ${PMM_PORT_CH_TCP:-11000}:9000 - - ${PMM_PORT_CH_HTTP:-11123}:8123 volumes: - ./:/root/go/src/github.com/percona/pmm # - "../grafana/public:/usr/share/grafana/public" @@ -207,4 +226,5 @@ services: volumes: go-modules: + vmdata: {} root-cache: diff --git a/docs/api/addnode.md b/docs/api/addnode.md new file mode 100644 index 0000000000..2b177c72bf --- /dev/null +++ b/docs/api/addnode.md @@ -0,0 +1,69 @@ +--- +slug: 'addnode' +--- + +## Add a Node + +This section describes how to add a Node of any type to the inventory. + +In PMM versions prior to 2.40.0, we featured a separate API call for each Node type. Starting with PMM 2.40.0, we have a single API call for all Node types. The API call is `Add` and the Node type is specified in the `node_type` field. The `node_type` field is required. Along with this single API endpoint, we are deprecating the separate API calls for each Node type. + +Let's see how to add a Node of type `GENERIC_NODE` using the old and new API calls. + +Old API call: + +````bash: + +```bash +curl --insecure -X POST \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --url https://127.0.0.1/v1/inventory/Nodes/AddGeneric \ + --data ' +{ + "node_name": "mysql-sales-db-prod-1", + "region": "us-east-1", + "az": "us-east-1a", + "address": "209.0.25.100", + "custom_labels": { + "environment": "sales-prod", + "department": "sales" + } +} +' +```` + +New API call: + +```bash +curl --insecure -X POST \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --url https://127.0.0.1/v1/inventory/Nodes/Add \ + --data ' +{ + "generic": { + "node_name": "mysql-sales-db-prod-1", + "region": "us-east-1", + "az": "us-east-1a", + "address": "209.0.25.100", + "custom_labels": { + "environment": "sales-prod", + "department": "sales" + } + } +} +' +``` + +To get the authentication token, please visit [this page](ref:authentication). + +You can choose from the following Node types: + +- GENERIC_NODE: `generic` +- CONTAINER_NODE: `container` +- REMOTE_NODE: `remote` +- REMOTE_RDS_NODE: `remote_rds` +- REMOTE_AZURE_DATABASE_NODE: `remote_azure` diff --git a/docs/api/adhoc-backup.md b/docs/api/adhoc-backup.md index 4988cf9c3a..fcd94af324 100644 --- a/docs/api/adhoc-backup.md +++ b/docs/api/adhoc-backup.md @@ -4,16 +4,14 @@ slug: 'adhoc-backup' ## Ad hoc Backup -PMM can backup the monitored servers. +PMM can backup the monitored servers. This section describes making ad hoc backups from a service. - ### Creating a Backup Here is an example of a Curl API call to create a backup: - ```bash curl --insecure -X POST -H 'Authorization: Bearer XXXXX' \ --request POST \ @@ -32,9 +30,8 @@ curl --insecure -X POST -H 'Authorization: Bearer XXXXX' \ ' ``` -You require an authentication string which is described [here](ref:authentication). +You require an authentication token, which is described [here](ref:authentication). Also, you require the [service_id](ref:listservices) and [location_id](ref:listlocations). -You can choose a `name` and `description` for the backup. You can also configure `retry_interval` and `retries` if required. - +You can choose a `name` and `description` for the backup. You can also configure `retry_interval` and `retries` if required. diff --git a/docs/api/authentication.md b/docs/api/authentication.md index 4e04f11d1a..2379589217 100644 --- a/docs/api/authentication.md +++ b/docs/api/authentication.md @@ -23,7 +23,7 @@ Let's assume the username is `admin` and the password is also `admin`. Then the ```bash curl -X GET -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ - -H 'Content-Type: application/json' https://127.0.0.1/v1/version + -H 'Content-Type: application/json' https://127.0.0.1/v1/version ``` If you use `curl` to make API calls, a simple equivalent to the command above is: @@ -34,19 +34,18 @@ curl -X GET -u admin:admin -H 'Content-Type: application/json' https://127.0.0.1 ### Bearer Authentication -Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens. The bearer token is a cryptic API key, which can be generated by the server admin from the Settings UI or via a respective API call (read more about how to generate an API key). The client must send the API key in the `Authorization` header when making requests to protected resources: +Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens. The bearer token is a cryptic API key, which can be generated by the server admin from the Settings UI or via a respective API call (read more about how to generate an API key). The client must send the API key in the `Authorization` header when making requests to protected resources: ```bash curl -X GET -H 'Authorization: Bearer eyJrIjoiUXRkeDNMS1g1bFVyY0tUj1o0SmhBc3g4QUdTRVAwekoiLCJuIjoicG1tLXRlc3QiLCJpZCI6MX0=' \ - -H 'Content-Type: application/json' https://127.0.0.1/v1/version + -H 'Content-Type: application/json' https://127.0.0.1/v1/version ``` You can use the API key in basic authentication as well: ```bash curl -X GET -H 'Content-Type: application/json' \ -https://api_key:eyJrIjoiUXRkeDNMS1g1bFVyY0tUj1o0SmhBc3g4QUdTRVAwekoiLCJuIjoicG1tLXRlc3QiLCJpZCI6MX0=@127.0.0.1/v1/version - + https://api_key:eyJrIjoiUXRkeDNMS1g1bFVyY0tUj1o0SmhBc3g4QUdTRVAwekoiLCJuIjoicG1tLXRlc3QiLCJpZCI6MX0=@127.0.0.1/v1/version ``` ### Protecting Credentials @@ -58,11 +57,13 @@ In the previous examples, the credentials can be gleaned from the shell history It is possible to hide from the shell history: bash + ```bash set +o history ``` zsh + ```zsh SAVEHIST=0 ``` @@ -78,16 +79,19 @@ password admin ``` This can then be used as follows: + ```bash curl --netrc -X GET -H 'Content-Type: application/json' https://127.0.0.1/v1/version ``` Should you wish to use a different file then the `--netrc-file` option needs to be used. If we have the credentials stored in `~/.netrc-pmm` then the command would become: + ```bash curl --netrc --netrc-file ~/.netrc-pmm -X GET -H 'Content-Type: application/json' https://127.0.0.1/v1/version ``` You can use API keys in this way too, for example: + ``` machine 127.0.0.1 login api_key diff --git a/docs/api/listlocations.md b/docs/api/listlocations.md index 0053a47bcf..63d0187575 100644 --- a/docs/api/listlocations.md +++ b/docs/api/listlocations.md @@ -4,14 +4,14 @@ slug: 'listlocations' ## List Locations -The following Curl API call will list all the available Locations: +The following API call will list all the available Locations: ```bash -curl --insecure -X POST -H 'Authorization: Bearer XXXXX' \ - --request POST \ - --url https://127.0.0.1/v1/management/backup/Locations/List \ - --header 'Accept: application/json' \ - --header 'Content-Type: application/json' +curl --insecure -X POST \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --url https://127.0.0.1/v1/management/backup/Locations/List \ ``` -You will need the [authetication string](ref:authentication). \ No newline at end of file +You will need the [authetication token](ref:authentication). diff --git a/docs/api/listnodes.md b/docs/api/listnodes.md index 6a45b229cb..ba5740e3e5 100644 --- a/docs/api/listnodes.md +++ b/docs/api/listnodes.md @@ -4,26 +4,25 @@ slug: 'listnodes' ## List Nodes -This section describes listing the Nodes in the inventory. +This section describes how to list PMM Inventory Nodes. Example: + ```bash -curl --insecure -X POST -H 'Authorization: Bearer XXXXX' - --request POST - --url https://127.0.0.1/v1/inventory/Nodes/List - --header 'Accept: application/json' - --header 'Content-Type: application/json' - --data ' -{ - "node_type": "GENERIC_NODE" -} -' +curl --insecure -X POST \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --url https://127.0.0.1/v1/inventory/Nodes/List \ + --data '{"node_type": "GENERIC_NODE"}' ``` -Firstly, get the [authentication string](ref:authentication). - -Then, choose from the following Node types: -`NODE_TYPE_INVALID, GENERIC_NODE, CONTAINER_NODE, REMOTE_NODE, REMOTE_RDS_NODE, REMOTE_AZURE_DATABASE_NODE` - +First, get the [authentication token](ref:authentication). +Then, choose from the following Node types: +- GENERIC_NODE +- CONTAINER_NODE +- REMOTE_NODE +- REMOTE_RDS_NODE +- REMOTE_AZURE_DATABASE_NODE` diff --git a/docs/api/listservices.md b/docs/api/listservices.md index b95bed1f1f..51d79dcb19 100644 --- a/docs/api/listservices.md +++ b/docs/api/listservices.md @@ -7,25 +7,31 @@ slug: 'listservices' The following API call lists the available services on a Node: ```bash -curl --insecure -X POST -H 'Authorization: Bearer XXXXX' \ - --request POST \ - --url https://127.0.0.1/v1/inventory/Services/List \ - --header 'Accept: application/json' \ - --header 'Content-Type: application/json' \ - --data ' +curl --insecure -X POST \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --url https://127.0.0.1/v1/inventory/Services/List \ + --data ' { "node_id": "/node_id/XXXXX", "service_type": "MYSQL_SERVICE" }' ``` -Firstly, get the [authentication string](ref:authentication). +First, get the [authentication token](ref:authentication). -Then, you require the [node_id](ref:listnodes). +Then, you need to know the [node_id](ref:listnodes). Choose the `service_type` that you want to list. The options are: -`SERVICE_TYPE_INVALID, MYSQL_SERVICE, MONGODB_SERVICE, POSTGRESQL_SERVICE, PROXYSQL_SERVICE, HAPROXY_SERVICE, EXTERNAL_SERVICE` + +- MYSQL_SERVICE +- MONGODB_SERVICE +- POSTGRESQL_SERVICE +- PROXYSQL_SERVICE +- HAPROXY_SERVICE +- EXTERNAL_SERVICE If you prefer to get all services running on the node, you can omit the `service_type` parameter. -However, calling the same endpoint without any parameters will return all services known to this PMM instance. +Otherwise, calling the same endpoint with no parameters will return all services known to this PMM instance. diff --git a/docs/process/tech_stack.md b/docs/process/tech_stack.md index 1785731eba..a5778b127d 100644 --- a/docs/process/tech_stack.md +++ b/docs/process/tech_stack.md @@ -10,14 +10,14 @@ Currently, our development team has fewer people than components/repositories. I - [protobuf v3](https://developers.google.com/protocol-buffers/) gives us [strongly-typed](https://developers.google.com/protocol-buffers/docs/proto3) serialization format with good [forward- and backward-compatibility](https://developers.google.com/protocol-buffers/docs/gotutorial#extending-a-protocol-buffer), [canonical mapping to and from JSON](https://developers.google.com/protocol-buffers/docs/proto3#json), and a large ecosystem of libraries and tools. We don't have to write code to work with it because there are code generators for a lot of languages. - [gRPC](https://grpc.io/) extends protobuf with RPC mechanism. Both single requests/responses and bi-directional streams are supported. Error handling is built-in. Again, there are code generators for both client- and server-side code, so we don't have to write it by ourselves. -- [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) takes gRPC specification and generates code for HTTP JSON API server-side wrapper for it. It also generates [Swagger](https://swagger.io/) specification from protocol specification and annotations, with documentation from comments. In turn, it is used to generate client-side code for environments where gRPC is not yet supported natively (e.g. web browser). No manual writing of serialization and communication code, and documentation with examples and interactive tools – gRPC specification becomes the single source of truth. +- [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) takes gRPC specification and generates code for HTTP JSON API server-side wrapper for it. It also generates [Swagger](https://swagger.io/) specification from protocol specification and annotations, with documentation built up from comments. In turn, it is used to generate client-side code for environments where gRPC is not yet supported natively (e.g. web browser). No manual writing of serialization and communication code, and documentation with examples and interactive tools – gRPC specification becomes the single source of truth. - [logrus](https://github.com/sirupsen/logrus) or stdlib `log` package should be used for logging. Always log to unbuffered stderr, let process supervisor do the rest. - [prometheus client](https://github.com/prometheus/client_golang) is used for exposing internal metrics of application and gRPC library. - [testify](https://github.com/stretchr/testify) or stdlib `testing` package should be used for writing tests. Testify should be used only for `assert` and `require` packages – suites here have some problems with logging and parallel tests. Common setups and teardowns should be implemented with `testing` [subtests](https://golang.org/pkg/testing/#hdr-Subtests_and_Sub_benchmarks). - [golangci-lint](https://github.com/golangci/golangci-lint) is used for static code checks. - [gocov.io](http://gocov.io/) and [gocoverutil](https://github.com/AlekSi/gocoverutil) gather code coverage metrics. - [Docker Compose](https://docs.docker.com/compose/) is used for a local development environment and in CI. -- [Kong](https://github.com/alecthomas/kong) for pmm CLI and [kingpin.v2](http://gopkg.in/alecthomas/kingpin.v2) for exporters and some other code. Use [Kong](https://github.com/alecthomas/kong) if you need some new CLI or need to make significant changes to the old `kingpin.v2` CLI. +- [Kong](https://github.com/alecthomas/kong) for PMM CLI and [kingpin.v2](http://gopkg.in/alecthomas/kingpin.v2) for exporters and some other code. Use [Kong](https://github.com/alecthomas/kong) if you want to contribute a brand new CLI or need to make significant changes to the old `kingpin.v2`-based CLI. - [go modules](https://go.dev/ref/mod#introduction) for vendoring. ## Open questions diff --git a/go.mod b/go.mod index 228d77be02..a04583a6a7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/percona/pmm -go 1.20 +go 1.21 // Update saas with // go get -v github.com/percona-platform/saas@latest @@ -18,22 +18,22 @@ replace github.com/ClickHouse/clickhouse-go/151 => github.com/ClickHouse/clickho require ( github.com/AlekSi/pointer v1.2.0 github.com/ClickHouse/clickhouse-go/151 v0.0.0-00010101000000-000000000000 - github.com/ClickHouse/clickhouse-go/v2 v2.10.0 + github.com/ClickHouse/clickhouse-go/v2 v2.13.0 github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/alecthomas/kong v0.8.0 github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 - github.com/aws/aws-sdk-go v1.44.273 + github.com/aws/aws-sdk-go v1.45.2 github.com/blang/semver v3.5.1+incompatible - github.com/brianvoe/gofakeit/v6 v6.22.0 - github.com/charmbracelet/bubbles v0.15.0 - github.com/charmbracelet/bubbletea v0.24.0 - github.com/charmbracelet/lipgloss v0.7.1 + github.com/brianvoe/gofakeit/v6 v6.23.0 + github.com/charmbracelet/bubbles v0.16.1 + github.com/charmbracelet/bubbletea v0.24.1 + github.com/charmbracelet/lipgloss v0.8.0 github.com/davecgh/go-spew v1.1.1 github.com/docker/docker v23.0.4+incompatible github.com/docker/go-connections v0.4.0 - github.com/envoyproxy/protoc-gen-validate v1.0.1 - github.com/go-co-op/gocron v1.30.0 - github.com/go-openapi/errors v0.20.3 + github.com/envoyproxy/protoc-gen-validate v1.0.2 + github.com/go-co-op/gocron v1.31.0 + github.com/go-openapi/errors v0.20.4 github.com/go-openapi/runtime v0.26.0 github.com/go-openapi/strfmt v0.21.7 github.com/go-openapi/swag v0.22.3 @@ -42,10 +42,10 @@ require ( github.com/golang-migrate/migrate/v4 v4.16.1 github.com/golang/protobuf v1.5.3 github.com/google/uuid v1.3.0 - github.com/grafana/grafana-api-golang-client v0.23.0 + github.com/grafana/grafana-api-golang-client v0.24.0 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 github.com/hashicorp/go-version v1.6.0 github.com/jmoiron/sqlx v1.3.5 github.com/jotaen/kong-completion v0.0.5 @@ -54,7 +54,7 @@ require ( github.com/operator-framework/api v0.17.6 github.com/operator-framework/operator-lifecycle-manager v0.24.0 github.com/percona-platform/dbaas-api v0.0.0-20230103182808-d79c449a9f4c - github.com/percona-platform/saas v0.0.0-20230306173543-c223f9a47342 + github.com/percona-platform/saas v0.0.0-20230728161159-ad6bdeb8a3d9 github.com/percona/dbaas-operator v0.1.6 github.com/percona/exporter_shared v0.7.4 github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c @@ -71,26 +71,26 @@ require ( github.com/stretchr/objx v0.5.0 github.com/stretchr/testify v1.8.4 go.mongodb.org/mongo-driver v1.12.0 - go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd - golang.org/x/crypto v0.10.0 + go.starlark.net v0.0.0-20230717150657-8a3343210976 + golang.org/x/crypto v0.13.0 golang.org/x/sync v0.3.0 - golang.org/x/sys v0.9.0 - golang.org/x/text v0.10.0 - golang.org/x/tools v0.10.0 - google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc - google.golang.org/grpc v1.57.0-dev + golang.org/x/sys v0.12.0 + golang.org/x/text v0.13.0 + golang.org/x/tools v0.13.0 + google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d + google.golang.org/grpc v1.58.0 google.golang.org/protobuf v1.31.0 gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/reform.v1 v1.5.1 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.27.2 + k8s.io/api v0.28.0 k8s.io/apiextensions-apiserver v0.26.2 - k8s.io/apimachinery v0.27.2 - k8s.io/cli-runtime v0.27.2 - k8s.io/client-go v0.27.2 - k8s.io/kubectl v0.27.2 - modernc.org/sqlite v1.23.0 + k8s.io/apimachinery v0.28.0 + k8s.io/cli-runtime v0.28.0 + k8s.io/client-go v0.28.0 + k8s.io/kubectl v0.28.0 + modernc.org/sqlite v1.25.0 sigs.k8s.io/controller-runtime v0.14.6 ) @@ -105,10 +105,10 @@ require ( github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-ini/ini v1.67.0 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/gnostic v0.6.9 // indirect + github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect @@ -127,28 +127,29 @@ require ( github.com/riywo/loginshell v0.0.0-20200815045211-7d26008be1ab // indirect github.com/sergi/go-diff v1.2.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/xlab/treeprint v1.1.0 // indirect - go.uber.org/atomic v1.10.0 // indirect + github.com/xlab/treeprint v1.2.0 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect + go.uber.org/atomic v1.11.0 // indirect golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect golang.org/x/time v0.3.0 // indirect - google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e // indirect + google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - k8s.io/klog/v2 v2.90.1 // indirect - k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect - k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect + k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect + k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect lukechampine.com/uint128 v1.2.0 // indirect modernc.org/cc/v3 v3.40.0 // indirect modernc.org/ccgo/v3 v3.16.13 // indirect - modernc.org/libc v1.22.5 // indirect + modernc.org/libc v1.24.1 // indirect modernc.org/mathutil v1.5.0 // indirect - modernc.org/memory v1.5.0 // indirect + modernc.org/memory v1.6.0 // indirect modernc.org/opt v0.1.3 // indirect modernc.org/strutil v1.1.3 // indirect modernc.org/token v1.0.1 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/kustomize/api v0.13.2 // indirect - sigs.k8s.io/kustomize/kyaml v0.14.1 // indirect + sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect + sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) @@ -177,7 +178,7 @@ require ( github.com/go-faster/errors v0.6.1 // indirect github.com/go-openapi/analysis v0.21.4 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect - github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/loads v0.21.2 // indirect github.com/go-openapi/spec v0.20.8 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -207,12 +208,12 @@ require ( github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/reflow v0.3.0 // indirect - github.com/muesli/termenv v0.15.1 // indirect + github.com/muesli/termenv v0.15.2 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/paulmach/orb v0.9.0 // indirect + github.com/paulmach/orb v0.10.0 // indirect github.com/pierrec/lz4/v4 v4.1.17 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/prometheus/client_model v0.4.0 // indirect @@ -225,12 +226,12 @@ require ( github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect - go.opentelemetry.io/otel v1.14.0 // indirect - go.opentelemetry.io/otel/trace v1.14.0 // indirect - golang.org/x/mod v0.11.0 // indirect - golang.org/x/net v0.11.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/term v0.9.0 // indirect + go.opentelemetry.io/otel v1.16.0 // indirect + go.opentelemetry.io/otel/trace v1.16.0 // indirect + golang.org/x/mod v0.12.0 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/oauth2 v0.12.0 // indirect + golang.org/x/term v0.12.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gotest.tools/v3 v3.3.0 // indirect diff --git a/go.sum b/go.sum index 3eff9f9962..6403803950 100644 --- a/go.sum +++ b/go.sum @@ -49,12 +49,14 @@ github.com/Azure/azure-storage-blob-go v0.13.0/go.mod h1:pA9kNqtjUeQF2zOSu4s//nU github.com/Azure/azure-storage-blob-go v0.14.0 h1:1BCg74AmVdYwO3dlKwtFU1V0wU2PZdREkXvAmZJRUlM= github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.28 h1:ndAExarwr5Y+GaHE6VCaY1kyS/HwwGGyuimVhWsHOEM= github.com/Azure/go-autorest/autorest/adal v0.9.2/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE= github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/adal v0.9.21 h1:jjQnVFXPfekaqb8vIsv2G1lxshoW+oGv4MDlhRtnYZk= +github.com/Azure/go-autorest/autorest/adal v0.9.21/go.mod h1:zua7mBUaCc5YnSLKYgGJR/w5ePdMDA6H56upLsHzA9U= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= @@ -72,8 +74,8 @@ github.com/ClickHouse/clickhouse-go v1.5.1 h1:I8zVFZTz80crCs0FFEBJooIxsPcV0xfthz github.com/ClickHouse/clickhouse-go v1.5.1/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0= github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= -github.com/ClickHouse/clickhouse-go/v2 v2.10.0 h1:0w/A50D5MfsRUYBaV6rLKwZ4LXWKLZKJ1u31QXjTIO4= -github.com/ClickHouse/clickhouse-go/v2 v2.10.0/go.mod h1:teXfZNM90iQ99Jnuht+dxQXCuhDZ8nvvMoTJOFrcmcg= +github.com/ClickHouse/clickhouse-go/v2 v2.13.0 h1:oP1OlTQIbQKKLnqLzyDhiyNFvN3pbOtM+e/3qdexG9k= +github.com/ClickHouse/clickhouse-go/v2 v2.13.0/go.mod h1:xyL0De2K54/n+HGsdtPuyYJq76wefafaHfGUXTDEq/0= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= @@ -81,7 +83,6 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXY github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Percona-Lab/go-grpc-prometheus v0.0.0-20230116133345-3487748d4592 h1:i7HDf+zPQvaPdrbLGS+wz/Ta32SszwYyHfJks1oVFzg= github.com/Percona-Lab/go-grpc-prometheus v0.0.0-20230116133345-3487748d4592/go.mod h1:xCJfGpj56ERA85Mj1VfBzoeWW4lZ00xXXkvG0LJQjZU= github.com/Percona-Lab/kingpin v2.2.6-percona+incompatible h1:N5oM40aAatvf8bCYjv69YsVdxJLIUhY/MerUG1jRL9Y= @@ -91,10 +92,12 @@ github.com/Percona-Lab/spec v0.20.5-percona/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5i github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= +github.com/alecthomas/assert/v2 v2.1.0/go.mod h1:b/+1DI2Q6NckYi+3mXyH3wFb8qG37K/DuK80n7WefXA= github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE= github.com/alecthomas/kong v0.8.0 h1:ryDCzutfIqJPnNn0omnrgHLbAggDQM2VWHikE1xqK7s= github.com/alecthomas/kong v0.8.0/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= +github.com/alecthomas/repr v0.1.0/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -106,17 +109,14 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8V github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go v1.40.7/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go v1.44.273 h1:CX8O0gK+cGrgUyv7bgJ6QQP9mQg7u5mweHdNzULH47c= -github.com/aws/aws-sdk-go v1.44.273/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= +github.com/aws/aws-sdk-go v1.45.2 h1:hTong9YUklQKqzrGk3WnKABReb5R8GjbG4Y6dEQfjnk= +github.com/aws/aws-sdk-go v1.45.2/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -132,24 +132,20 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/brianvoe/gofakeit v3.18.0+incompatible h1:wDOmHc9DLG4nRjUVVaxA+CEglKOW72Y5+4WNxUIkjM8= github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7WPaDzUjz+CZFqG+rPkOjGOc= -github.com/brianvoe/gofakeit/v6 v6.22.0 h1:BzOsDot1o3cufTfOk+fWKE9nFYojyDV+XHdCWL2+uyE= -github.com/brianvoe/gofakeit/v6 v6.22.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/brianvoe/gofakeit/v6 v6.23.0 h1:pgVhyWpYq4e0GEVCh2gdZnS/nBX+8SnyTBliHg5xjks= +github.com/brianvoe/gofakeit/v6 v6.23.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -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.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI= -github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p1kluf1uLl8iK74= -github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU= -github.com/charmbracelet/bubbletea v0.24.0 h1:l8PHrft/GIeikDPCUhQe53AJrDD8xGSn0Agirh8xbe8= -github.com/charmbracelet/bubbletea v0.24.0/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg= +github.com/charmbracelet/bubbles v0.16.1 h1:6uzpAAaT9ZqKssntbvZMlksWHruQLNxg49H5WdeuYSY= +github.com/charmbracelet/bubbles v0.16.1/go.mod h1:2QCp9LFlEsBQMvIYERr7Ww2H2bA7xen1idUDIzm/+Xc= +github.com/charmbracelet/bubbletea v0.24.1 h1:LpdYfnu+Qc6XtvMz6d/6rRY71yttHTP5HtrjMgWvixc= +github.com/charmbracelet/bubbletea v0.24.1/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg= github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= -github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= -github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= -github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= +github.com/charmbracelet/lipgloss v0.8.0 h1:IS00fk4XAHcf8uZKc3eHeMUTCxUH6NkaTrdyCQk84RU= +github.com/charmbracelet/lipgloss v0.8.0/go.mod h1:p4eYUZZJ/0oXTuCQKFF8mqyKCz0ja6y+7DniDDw5KKU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -157,10 +153,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg= 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= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/craiggwilson/goke v0.0.0-20200309222237-69a77cdfe646/go.mod h1:IX+FckvUr3c6SNWSzspUD94HqCMFCW+sIK0lJGSkWkg= @@ -172,7 +165,9 @@ github.com/denisenkom/go-mssqldb v0.9.0 h1:RSohk2RsiZqLZ0zCjtfn3S4Gp4exhpBWHyQ7D github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dhui/dktest v0.3.16 h1:i6gq2YQEtcrjKbeJpBkWjE8MmLZPYllcjOFbTZuPDnw= +github.com/dhui/dktest v0.3.16/go.mod h1:gYaA3LRmM8Z4vJl2MA0THIigJoZrwOansEOsp+kqxp0= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= @@ -184,7 +179,6 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= @@ -192,23 +186,20 @@ github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry 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= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.1 h1:kt9FtLiooDc0vbwTLhdg3dyNX1K9Qwa1EK9LcD4jVUQ= -github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.5.0/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-co-op/gocron v1.30.0 h1:7nDCO++3HqQb+gSyd0NWRjsNbyPcK9cKVepBQWWaP6E= -github.com/go-co-op/gocron v1.30.0/go.mod h1:39f6KNSGVOU1LO/ZOoZfcSxwlsJDQOKSu8erN0SH48Y= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/go-co-op/gocron v1.31.0 h1:8VaWk7ARDpsVYFP8SmjvHrBZQkcPQ7HyAzF7acG57yE= +github.com/go-co-op/gocron v1.31.0/go.mod h1:39f6KNSGVOU1LO/ZOoZfcSxwlsJDQOKSu8erN0SH48Y= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw= @@ -229,26 +220,27 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= +github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.3 h1:rz6kiC84sqNQoqrtulzaL/VERgkoCyB6WdEkc2ujzUc= -github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= +github.com/go-openapi/errors v0.20.4 h1:unTcVm6PispJsMECE3zWgvG4xTiKda1LIR5rCRWLG6M= +github.com/go-openapi/errors v0.20.4/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= -github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= @@ -272,7 +264,8 @@ github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b h1:/vQ+oYKu+JoyaMPDsv5FzwuL2wwWBgBbtj/YLCi4LuA= github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b/go.mod h1:Xo4aNUOrJnVruqWQJBtW6+bTBDTniY8yZum5rF3b5jw= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= @@ -313,6 +306,7 @@ github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2V github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -326,6 +320,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -341,7 +336,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -350,8 +344,8 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= -github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -377,11 +371,11 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= 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/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -389,13 +383,12 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/grafana/grafana-api-golang-client v0.23.0 h1:Uta0dSkxWYf1D83/E7MRLCG69387FiUc+k9U/35nMhY= -github.com/grafana/grafana-api-golang-client v0.23.0/go.mod h1:24W29gPe9yl0/3A9X624TPkAOR8DpHno490cPwnkv8E= +github.com/grafana/grafana-api-golang-client v0.24.0 h1:9cUvft7xCMnnL/Uscwy7eoldn16Gz5TH4T1MymuVs8E= +github.com/grafana/grafana-api-golang-client v0.24.0/go.mod h1:24W29gPe9yl0/3A9X624TPkAOR8DpHno490cPwnkv8E= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -409,6 +402,7 @@ github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -465,10 +459,10 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -495,22 +489,19 @@ github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqf github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= @@ -531,6 +522,7 @@ github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -545,17 +537,15 @@ github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJ github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU= github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b h1:1XF24mVaiu7u+CFywTdcDo2ie1pzzhwjt6RHqzpMU34= github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= -github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs= -github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4YJK5e2bc= -github.com/muesli/termenv v0.15.1 h1:UzuTb/+hhlBugQz28rpzey4ZuKcZ03MeKsoG7IJZIxs= -github.com/muesli/termenv v0.15.1/go.mod h1:HeAQPTzpfs016yGtA4g00CsdYnVLJvxsS4ANqrZs2sQ= +github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= +github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -568,8 +558,10 @@ github.com/nsf/termbox-go v0.0.0-20160718140619-0723e7c3d0a3/go.mod h1:IuKpRQcYE github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= -github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= +github.com/onsi/ginkgo/v2 v2.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE= +github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM= +github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= +github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -582,16 +574,16 @@ github.com/operator-framework/api v0.17.6 h1:E6+vlvYUKafvoXYtCuHlDZrXX4vl8AT+r93 github.com/operator-framework/api v0.17.6/go.mod h1:l/cuwtPxkVUY7fzYgdust2m9tlmb8I4pOvbsUufRb24= github.com/operator-framework/operator-lifecycle-manager v0.24.0 h1:9LOfvyohGEkNHwcOGOgw+w3ZAnGeT6JVh3CvIbWpnus= github.com/operator-framework/operator-lifecycle-manager v0.24.0/go.mod h1:2zDUxcpW2idTLjRw36WlMetHZ50Nlf1C3JxASPfYS20= -github.com/paulmach/orb v0.9.0 h1:MwA1DqOKtvCgm7u9RZ/pnYejTeDJPnr0+0oFajBbJqk= -github.com/paulmach/orb v0.9.0/go.mod h1:SudmOk85SXtmXAB3sLGyJ6tZy/8pdfrV0o6ef98Xc30= +github.com/paulmach/orb v0.10.0 h1:guVYVqzxHE/CQ1KpfGO077TR0ATHSNjp4s6XGLn3W9s= +github.com/paulmach/orb v0.10.0/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU= github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/percona-lab/crypto v0.0.0-20220811043533-d164de3c7f08 h1:NprWeXddFZJSgtN8hmf/hhIgiZwB3GNaKnI88iAFgEc= github.com/percona-lab/crypto v0.0.0-20220811043533-d164de3c7f08/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= github.com/percona-platform/dbaas-api v0.0.0-20230103182808-d79c449a9f4c h1:1JySfwdjVfc9ahl0466OX7nSQ7Z4SjQkLe3ZdLkMOJI= github.com/percona-platform/dbaas-api v0.0.0-20230103182808-d79c449a9f4c/go.mod h1:/jgle33awfHq1va/T6NnNS5wWAETSnl6wUZ1bew+CJ0= -github.com/percona-platform/saas v0.0.0-20230306173543-c223f9a47342 h1:ilguq4u7k08QxS3UDYINt8x6+AOgB0wZApd1o4IK8rQ= -github.com/percona-platform/saas v0.0.0-20230306173543-c223f9a47342/go.mod h1:gFUwaFp6Ugu5qsBwiOVJYbDlzgZ77tmXdXGO7tG5xVI= +github.com/percona-platform/saas v0.0.0-20230728161159-ad6bdeb8a3d9 h1:KkOH+Y4sVRP7qvRtTDmfPFNjjQcwU2054/jNl9DZhEo= +github.com/percona-platform/saas v0.0.0-20230728161159-ad6bdeb8a3d9/go.mod h1:lZuFcqj0EoQWx28SYkTcdhJOCQEbRcAyahYPfRMY7tc= github.com/percona/dbaas-operator v0.1.6 h1:NsZXDKcPXk38kET+X6r8Es+3Supyu5XJZMS0gqPejKs= github.com/percona/dbaas-operator v0.1.6/go.mod h1:52B/kh+Jmtfv0JiZgDcc34qgbwwEi9U4A3311JBxIZg= github.com/percona/exporter_shared v0.7.4 h1:S+xnfK/CySiYqr4XqLiLAfO3rxgEOUFK+m6lCBi3mgc= @@ -659,16 +651,15 @@ github.com/riywo/loginshell v0.0.0-20200815045211-7d26008be1ab h1:ZjX6I48eZSFetP github.com/riywo/loginshell v0.0.0-20200815045211-7d26008be1ab/go.mod h1:/PfPXh0EntGc3QAAyUaviy4S9tzy4Zp0e2ilq4voC6E= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= @@ -685,12 +676,10 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -699,7 +688,6 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -719,11 +707,8 @@ github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6 github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -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 v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= -github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= +github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= +github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= @@ -737,7 +722,7 @@ go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8N go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= -go.mongodb.org/mongo-driver v1.11.1/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= +go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0PiE= go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -745,23 +730,27 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= -go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= -go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= -go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd h1:Uo/x0Ir5vQJ+683GXB9Ug+4fcjsbp7z7Ul8UaZbhsRM= -go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= +go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.starlark.net v0.0.0-20230717150657-8a3343210976 h1:7ljYNcZU84T2N0tZdDgvL7U3M4iFmglAUUU1gRFE/2Q= +go.starlark.net v0.0.0-20230717150657-8a3343210976/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -800,8 +789,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -832,23 +821,21 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= +golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -905,29 +892,26 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/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-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -940,8 +924,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1000,13 +984,14 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= -golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= 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= gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= +gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= @@ -1060,20 +1045,18 @@ google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e h1:Ao9GzfUMPH3zjVfzXG5rlWlk+Q8MXWKwWpwVQE1MXfw= -google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g= +google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= +google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q= +google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1086,11 +1069,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.57.0-dev h1:XCvzqke2TBzQUs3a1MO1VsqVkWeAdJ/KmxHCAVtPpe8= -google.golang.org/grpc v1.57.0-dev/go.mod h1:ZPf89/axrdgRDfHqb7fa0GF5t4VUER0vWnqnPNuRP7k= +google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= +google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= 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= @@ -1123,7 +1103,6 @@ gopkg.in/reform.v1 v1.5.1/go.mod h1:AIv0CbDRJ0ljQwptGeaIXfpDRo02uJwTq92aMFELEeU= gopkg.in/tomb.v2 v2.0.0-20140626144623-14b3d72120e8/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1145,24 +1124,24 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.27.2 h1:+H17AJpUMvl+clT+BPnKf0E3ksMAzoBBg7CntpSuADo= -k8s.io/api v0.27.2/go.mod h1:ENmbocXfBT2ADujUXcBhHV55RIT31IIEvkntP6vZKS4= +k8s.io/api v0.28.0 h1:3j3VPWmN9tTDI68NETBWlDiA9qOiGJ7sdKeufehBYsM= +k8s.io/api v0.28.0/go.mod h1:0l8NZJzB0i/etuWnIXcwfIv+xnDOhL3lLW919AWYDuY= k8s.io/apiextensions-apiserver v0.26.2 h1:/yTG2B9jGY2Q70iGskMf41qTLhL9XeNN2KhI0uDgwko= k8s.io/apiextensions-apiserver v0.26.2/go.mod h1:Y7UPgch8nph8mGCuVk0SK83LnS8Esf3n6fUBgew8SH8= -k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg= -k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= -k8s.io/cli-runtime v0.27.2 h1:9HI8gfReNujKXt16tGOAnb8b4NZ5E+e0mQQHKhFGwYw= -k8s.io/cli-runtime v0.27.2/go.mod h1:9UecpyPDTkhiYY4d9htzRqN+rKomJgyb4wi0OfrmCjw= -k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE= -k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ= -k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= -k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= -k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= -k8s.io/kubectl v0.27.2 h1:sSBM2j94MHBFRWfHIWtEXWCicViQzZsb177rNsKBhZg= -k8s.io/kubectl v0.27.2/go.mod h1:GCOODtxPcrjh+EC611MqREkU8RjYBh10ldQCQ6zpFKw= -k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= -k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/apimachinery v0.28.0 h1:ScHS2AG16UlYWk63r46oU3D5y54T53cVI5mMJwwqFNA= +k8s.io/apimachinery v0.28.0/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw= +k8s.io/cli-runtime v0.28.0 h1:Tcz1nnccXZDNIzoH6EwjCs+7ezkUGhorzCweEvlVOFg= +k8s.io/cli-runtime v0.28.0/go.mod h1:U+ySmOKBm/JUCmebhmecXeTwNN1RzI7DW4+OM8Oryas= +k8s.io/client-go v0.28.0 h1:ebcPRDZsCjpj62+cMk1eGNX1QkMdRmQ6lmz5BLoFWeM= +k8s.io/client-go v0.28.0/go.mod h1:0Asy9Xt3U98RypWJmU1ZrRAGKhP6NqDPmptlAzK2kMc= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= +k8s.io/kubectl v0.28.0 h1:qhfju0OaU+JGeBlToPeeIg2UJUWP++QwTkpio6nlPKg= +k8s.io/kubectl v0.28.0/go.mod h1:1We+E5nSX3/TVoSQ6y5Bzld5OhTBHZHlKEYl7g/NaTk= +k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= +k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= @@ -1170,23 +1149,27 @@ modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= -modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= -modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= +modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak= modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= -modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o= +modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.23.0 h1:MWTFBI5H1WLnXpNBh/BTruBVqzzoh28DA0iOnlkkRaM= -modernc.org/sqlite v1.23.0/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= +modernc.org/sqlite v1.25.0 h1:AFweiwPNd/b3BoKnBOfFm+Y260guGMF+0UFk0savqeA= +modernc.org/sqlite v1.25.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= +modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= +modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= @@ -1195,10 +1178,10 @@ sigs.k8s.io/controller-runtime v0.14.6 h1:oxstGVvXGNnMvY7TAESYk+lzr6S3V5VFxQ6d92 sigs.k8s.io/controller-runtime v0.14.6/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/kustomize/api v0.13.2 h1:kejWfLeJhUsTGioDoFNJET5LQe/ajzXhJGYoU+pJsiA= -sigs.k8s.io/kustomize/api v0.13.2/go.mod h1:DUp325VVMFVcQSq+ZxyDisA8wtldwHxLZbr1g94UHsw= -sigs.k8s.io/kustomize/kyaml v0.14.1 h1:c8iibius7l24G2wVAGZn/Va2wNys03GXLjYVIcFVxKA= -sigs.k8s.io/kustomize/kyaml v0.14.1/go.mod h1:AN1/IpawKilWD7V+YvQwRGUvuUOOWpjsHu6uHwonSF4= +sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= +sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3/go.mod h1:9n16EZKMhXBNSiUC5kSdFQJkdH3zbxS/JoO619G1VAY= +sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM7vh3b7HvGNfXrJ/xL6BDMS0v1V/HHg5U= +sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= diff --git a/managed/Makefile b/managed/Makefile index 9412255408..5c3722002d 100644 --- a/managed/Makefile +++ b/managed/Makefile @@ -36,6 +36,10 @@ release: ## Build pmm-managed release binaries env CGO_ENABLED=0 go build -v $(PMM_LD_FLAGS) -o $(PMM_RELEASE_PATH)/ ./cmd/... $(PMM_RELEASE_PATH)/pmm-managed --version +release-starlark: + env CGO_ENABLED=0 go build -v $(PMM_LD_FLAGS) -o $(PMM_RELEASE_PATH)/ ./cmd/pmm-managed-starlark/... + $(PMM_RELEASE_PATH)/pmm-managed-starlark --version + ARCH=$(shell uname -m) release-dev: ## Build pmm-managed binaries for development if [ $(ARCH) = "aarch64" ]; then \ diff --git a/managed/cmd/pmm-managed-init/main.go b/managed/cmd/pmm-managed-init/main.go index f04f7efe0a..1d52155db1 100644 --- a/managed/cmd/pmm-managed-init/main.go +++ b/managed/cmd/pmm-managed-init/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -24,7 +24,7 @@ import ( "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services/supervisord" "github.com/percona/pmm/managed/utils/envvars" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" ) func main() { diff --git a/managed/cmd/pmm-managed-starlark/main.go b/managed/cmd/pmm-managed-starlark/main.go index 5c23efab3e..f976d67a7f 100644 --- a/managed/cmd/pmm-managed-starlark/main.go +++ b/managed/cmd/pmm-managed-starlark/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -33,7 +33,7 @@ import ( "github.com/percona/pmm/api/agentpb" "github.com/percona/pmm/managed/services/checks" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" "github.com/percona/pmm/version" ) @@ -129,13 +129,13 @@ func runChecks(l *logrus.Entry, data *checks.StarlarkScriptData) ([]check.Result if !ok { return nil, errors.Errorf("unexpected query result type: %T", dbQr) } - if dbRes[dbName], err = unmarshallQueryResult(s); err != nil { + if dbRes[dbName], err = unmarshalQueryResult(s); err != nil { return nil, err } } res[i] = dbRes case string: // used for all other databases - if res[i], err = unmarshallQueryResult(qr); err != nil { + if res[i], err = unmarshalQueryResult(qr); err != nil { return nil, err } default: @@ -158,7 +158,7 @@ func runChecks(l *logrus.Entry, data *checks.StarlarkScriptData) ([]check.Result return results, nil } -func unmarshallQueryResult(qr string) ([]map[string]any, error) { +func unmarshalQueryResult(qr string) ([]map[string]any, error) { b, err := base64.StdEncoding.DecodeString(qr) if err != nil { return nil, errors.Wrap(err, "failed to decode base64 encoded query result") diff --git a/managed/cmd/pmm-managed-starlark/main_test.go b/managed/cmd/pmm-managed-starlark/main_test.go index f52f76ce86..ecb2dde83a 100644 --- a/managed/cmd/pmm-managed-starlark/main_test.go +++ b/managed/cmd/pmm-managed-starlark/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -17,10 +17,12 @@ package main import ( "bytes" + "context" "encoding/json" "os" "os/exec" "testing" + "time" "github.com/percona-platform/saas/pkg/check" "github.com/stretchr/testify/assert" @@ -35,7 +37,7 @@ const ( // Possible errors: // fatal error: runtime: out of memory - // fatal error: out of memory allocating heap arena metadata + // fatal error: out of memory allocating heap arena metadatai. memoryConsumingScriptStderr = "out of memory" ) @@ -103,8 +105,13 @@ func TestStarlarkSandbox(t *testing.T) { //nolint:tparallel }, } + ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) + t.Cleanup(cancel) // since we run the binary as a child process to test it we need to build it first. - err := exec.Command("make", "-C", "../..", "release").Run() + command := exec.CommandContext(ctx, "make", "-C", "../..", "release-starlark") + command.Stdout = os.Stdout + command.Stderr = os.Stderr + err := command.Run() require.NoError(t, err) for _, tc := range testCases { diff --git a/managed/cmd/pmm-managed/main.go b/managed/cmd/pmm-managed/main.go index 17ea63ccbb..c49c60544f 100644 --- a/managed/cmd/pmm-managed/main.go +++ b/managed/cmd/pmm-managed/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -49,6 +49,7 @@ import ( "golang.org/x/sync/semaphore" "golang.org/x/sys/unix" "google.golang.org/grpc" + "google.golang.org/grpc/backoff" channelz "google.golang.org/grpc/channelz/service" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/grpclog" @@ -87,6 +88,7 @@ import ( "github.com/percona/pmm/managed/services/management" "github.com/percona/pmm/managed/services/management/alerting" managementbackup "github.com/percona/pmm/managed/services/management/backup" + "github.com/percona/pmm/managed/services/management/common" managementdbaas "github.com/percona/pmm/managed/services/management/dbaas" managementgrpc "github.com/percona/pmm/managed/services/management/grpc" "github.com/percona/pmm/managed/services/minio" @@ -104,9 +106,9 @@ import ( "github.com/percona/pmm/managed/utils/clean" "github.com/percona/pmm/managed/utils/envvars" "github.com/percona/pmm/managed/utils/interceptors" - "github.com/percona/pmm/managed/utils/logger" platformClient "github.com/percona/pmm/managed/utils/platform" pmmerrors "github.com/percona/pmm/utils/errors" + "github.com/percona/pmm/utils/logger" "github.com/percona/pmm/utils/sqlmetrics" "github.com/percona/pmm/version" ) @@ -255,8 +257,13 @@ func runGRPCServer(ctx context.Context, deps *gRPCServerDeps) { deps.db, deps.agentsRegistry, deps.agentsStateUpdater, deps.vmdb, deps.connectionCheck, deps.agentService) + mgmtBackupsService := managementbackup.NewBackupsService(deps.db, deps.backupService, deps.compatibilityService, deps.schedulerService) + mgmtArtifactsService := managementbackup.NewArtifactsService(deps.db, deps.backupRemovalService, deps.pbmPITRService) + mgmtRestoreHistoryService := managementbackup.NewRestoreHistoryService(deps.db) + mgmtServices := common.MgmtServices{BackupsService: mgmtBackupsService, ArtifactsService: mgmtArtifactsService, RestoreHistoryService: mgmtRestoreHistoryService} + inventorypb.RegisterNodesServer(gRPCServer, inventorygrpc.NewNodesServer(nodesSvc)) - inventorypb.RegisterServicesServer(gRPCServer, inventorygrpc.NewServicesServer(servicesSvc)) + inventorypb.RegisterServicesServer(gRPCServer, inventorygrpc.NewServicesServer(servicesSvc, mgmtServices)) inventorypb.RegisterAgentsServer(gRPCServer, inventorygrpc.NewAgentsServer(agentsSvc)) nodeSvc := management.NewNodeService(deps.db, deps.grafanaClient) @@ -288,10 +295,10 @@ func runGRPCServer(ctx context.Context, deps *gRPCServerDeps) { alertingpb.RegisterAlertingServer(gRPCServer, deps.templatesService) - backuppb.RegisterBackupsServer(gRPCServer, managementbackup.NewBackupsService(deps.db, deps.backupService, deps.compatibilityService, deps.schedulerService)) + backuppb.RegisterBackupsServer(gRPCServer, mgmtBackupsService) backuppb.RegisterLocationsServer(gRPCServer, managementbackup.NewLocationsService(deps.db, deps.minioClient)) - backuppb.RegisterArtifactsServer(gRPCServer, managementbackup.NewArtifactsService(deps.db, deps.backupRemovalService, deps.pbmPITRService)) - backuppb.RegisterRestoreHistoryServer(gRPCServer, managementbackup.NewRestoreHistoryService(deps.db)) + backuppb.RegisterArtifactsServer(gRPCServer, mgmtArtifactsService) + backuppb.RegisterRestoreHistoryServer(gRPCServer, mgmtRestoreHistoryService) k8sServer := managementdbaas.NewKubernetesServer(deps.db, deps.dbaasClient, deps.versionServiceClient, deps.grafanaClient) deps.dbaasInitializer.RegisterKubernetesServer(k8sServer) @@ -548,15 +555,15 @@ func setup(ctx context.Context, deps *setupDeps) bool { deps.l.Infof("Updating supervisord configuration...") settings, err := models.GetSettings(db.Querier) if err != nil { - deps.l.Warnf("Failed to get settings: %+v.", err) + deps.l.Warnf("Failed to get settings: %s.", err) return false } ssoDetails, err := models.GetPerconaSSODetails(ctx, db.Querier) - if err != nil { - deps.l.Warnf("Failed to get Percona SSO Details: %+v.", err) + if err != nil && !errors.Is(err, models.ErrNotConnectedToPortal) { + deps.l.Warnf("Failed to get Percona SSO Details: %s.", err) } if err = deps.supervisord.UpdateConfiguration(settings, ssoDetails); err != nil { - deps.l.Warnf("Failed to update supervisord configuration: %+v.", err) + deps.l.Warnf("Failed to update supervisord configuration: %s.", err) return false } @@ -586,9 +593,14 @@ func setup(ctx context.Context, deps *setupDeps) bool { } func getQANClient(ctx context.Context, sqlDB *sql.DB, dbName, qanAPIAddr string) *qan.Client { + bc := backoff.DefaultConfig + bc.MaxDelay = time.Second + opts := []grpc.DialOption{ grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithBackoffMaxDelay(time.Second), //nolint:staticcheck + grpc.WithConnectParams(grpc.ConnectParams{ + Backoff: bc, + }), grpc.WithUserAgent("pmm-managed/" + version.Version), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(gRPCMessageMaxSize)), } @@ -658,9 +670,9 @@ func main() { //nolint:cyclop,maintidx kingpin.Version(version.FullInfo()) kingpin.HelpFlag.Short('h') - victoriaMetricsURLF := kingpin.Flag("victoriametrics-url", "VictoriaMetrics base URL"). - Default("http://127.0.0.1:9090/prometheus/").String() - victoriaMetricsVMAlertURLF := kingpin.Flag("victoriametrics-vmalert-url", "VictoriaMetrics VMAlert base URL"). + victoriaMetricsURLF := kingpin.Flag("victoriametrics-url", "VictoriaMetrics base URL").Envar("PMM_VM_URL"). + Default(models.VMBaseURL).String() + victoriaMetricsVMAlertURLF := kingpin.Flag("victoriametrics-vmalert-url", "VictoriaMetrics VMAlert base URL").Envar("PMM_VM_ALERT_URL"). Default("http://127.0.0.1:8880/").String() victoriaMetricsConfigF := kingpin.Flag("victoriametrics-config", "VictoriaMetrics scrape configuration file path"). Default("/etc/victoriametrics-promscrape.yml").String() @@ -740,6 +752,7 @@ func main() { //nolint:cyclop,maintidx *postgresSSLModeF = models.VerifyCaSSLMode } ds := cfg.Config.Services.Telemetry.DataSources + pmmdb := ds.PmmDBSelect pmmdb.Credentials.Username = *postgresDBUsernameF pmmdb.Credentials.Password = *postgresDBPasswordF @@ -760,6 +773,15 @@ func main() { //nolint:cyclop,maintidx qanDB := ds.QanDBSelect qanDB.DSN = clickhouseDSN + ds.VM.Address = *victoriaMetricsURLF + + vmParams, err := models.NewVictoriaMetricsParams( + models.BasePrometheusConfigPath, + *victoriaMetricsURLF) + if err != nil { + l.Panicf("cannot load victoriametrics params problem: %+v", err) + } + setupParams := models.SetupDBParams{ Address: *postgresAddrF, Name: *postgresDBNameF, @@ -792,12 +814,7 @@ func main() { //nolint:cyclop,maintidx cleaner := clean.New(db) externalRules := vmalert.NewExternalRules() - - vmParams, err := models.NewVictoriaMetricsParams(victoriametrics.BasePrometheusConfigPath) - if err != nil { - l.Panicf("cannot load victoriametrics params problem: %+v", err) - } - vmdb, err := victoriametrics.NewVictoriaMetrics(*victoriaMetricsConfigF, db, *victoriaMetricsURLF, vmParams) + vmdb, err := victoriametrics.NewVictoriaMetrics(*victoriaMetricsConfigF, db, vmParams) if err != nil { l.Panicf("VictoriaMetrics service problem: %+v", err) } @@ -811,7 +828,7 @@ func main() { //nolint:cyclop,maintidx qanClient := getQANClient(ctx, sqlDB, *postgresDBNameF, *qanAPIAddrF) - agentsRegistry := agents.NewRegistry(db) + agentsRegistry := agents.NewRegistry(db, vmParams) pbmPITRService := backup.NewPBMPITRService() backupRemovalService := backup.NewRemovalService(db, pbmPITRService) backupRetentionService := backup.NewRetentionService(db, backupRemovalService) @@ -830,7 +847,7 @@ func main() { //nolint:cyclop,maintidx pmmUpdateCheck := supervisord.NewPMMUpdateChecker(logrus.WithField("component", "supervisord/pmm-update-checker")) - logs := supervisord.NewLogs(version.FullInfo(), pmmUpdateCheck) + logs := supervisord.NewLogs(version.FullInfo(), pmmUpdateCheck, vmParams) supervisord := supervisord.New( *supervisordConfigDirF, @@ -875,7 +892,7 @@ func main() { //nolint:cyclop,maintidx prom.MustRegister(grafanaClient) jobsService := agents.NewJobsService(db, agentsRegistry, backupRetentionService) - agentsStateUpdater := agents.NewStateUpdater(db, agentsRegistry, vmdb) + agentsStateUpdater := agents.NewStateUpdater(db, agentsRegistry, vmdb, vmParams) agentsHandler := agents.NewHandler(db, qanClient, vmdb, agentsRegistry, agentsStateUpdater, jobsService) actionsService := agents.NewActionsService(qanClient, agentsRegistry) @@ -890,8 +907,7 @@ func main() { //nolint:cyclop,maintidx l.Fatalf("Could not create Clickhouse client: %s", err) } - checksService := checks.New(db, platformClient, actionsService, alertManager, v1.NewAPI(vmClient), clickhouseClient) - + checksService := checks.New(db, platformClient, actionsService, v1.NewAPI(vmClient), clickhouseClient) prom.MustRegister(checksService) alertingService, err := alerting.NewService(db, platformClient, grafanaClient) @@ -907,6 +923,9 @@ func main() { //nolint:cyclop,maintidx dbaasClient := dbaas.NewClient(*dbaasControllerAPIAddrF) compatibilityService := backup.NewCompatibilityService(db, versioner) backupService := backup.NewService(db, jobsService, agentService, compatibilityService, pbmPITRService) + backupMetricsCollector := backup.NewMetricsCollector(db) + prom.MustRegister(backupMetricsCollector) + schedulerService := scheduler.New(db, backupService) versionCache := versioncache.New(db, versioner) diff --git a/managed/cmd/pmm-managed/main_test.go b/managed/cmd/pmm-managed/main_test.go index 894f272a4d..4ce740f9ef 100644 --- a/managed/cmd/pmm-managed/main_test.go +++ b/managed/cmd/pmm-managed/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -41,6 +41,7 @@ func TestPackages(t *testing.T) { func TestImports(t *testing.T) { type constraint struct { blacklistPrefixes []string + whitelistPrefixes []string } constraints := make(map[string]constraint) @@ -76,7 +77,6 @@ func TestImports(t *testing.T) { // those services should be independent too, but has some common code // as converters, errors, ... "github.com/percona/pmm/managed/services/grafana", - "github.com/percona/pmm/managed/services/inventory", "github.com/percona/pmm/managed/services/management", "github.com/percona/pmm/managed/services/server", "github.com/percona/pmm/managed/services/checks", @@ -89,6 +89,20 @@ func TestImports(t *testing.T) { } } + for _, service := range []string{ + // TODO come up with a new code structure that allows cross-service communication without the need to do tricks. + "github.com/percona/pmm/managed/services/inventory", + } { + constraints[service] = constraint{ + blacklistPrefixes: []string{ + "github.com/percona/pmm/managed/services/", + }, + whitelistPrefixes: []string{ + "github.com/percona/pmm/managed/services/management/common", + }, + } + } + // validators should not import gRPC stack, including errors constraints["github.com/percona/pmm/managed/utils/validators"] = constraint{ blacklistPrefixes: []string{ @@ -127,6 +141,18 @@ func TestImports(t *testing.T) { continue } + // check allowlist + var allow bool + for _, a := range c.whitelistPrefixes { + if strings.HasPrefix(i, a) { + allow = true + break + } + } + if allow { + continue + } + // check blacklist if strings.HasPrefix(i, b) { t.Errorf("Package %q should not import package %q (blacklisted by %q).", path, i, b) diff --git a/managed/cmd/pmm-managed/maincover_test.go b/managed/cmd/pmm-managed/maincover_test.go index a1e85dbf87..4f5accd141 100644 --- a/managed/cmd/pmm-managed/maincover_test.go +++ b/managed/cmd/pmm-managed/maincover_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/data/gen.go b/managed/data/gen.go index 5f276bc4e9..e0364769c4 100644 --- a/managed/data/gen.go +++ b/managed/data/gen.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/data/iatemplates/agent_down.yml b/managed/data/iatemplates/agent_down.yml index e913696f6e..89abeb7a12 100644 --- a/managed/data/iatemplates/agent_down.yml +++ b/managed/data/iatemplates/agent_down.yml @@ -8,6 +8,5 @@ templates: severity: critical annotations: description: |- - PMM agent on node '{{ $labels.node_id }}' cannot be reached. Host may be down. - summary: PMM agent on node '{{ $labels.node_id }}' cannot be reached. Host may be down. - + PMM agent on node '{{ $labels.node_name }}', node ID '{{ $labels.node_id }}', cannot be reached. Host may be down. + summary: PMM agent on node '{{ $labels.node_name }}' cannot be reached. Host may be down. diff --git a/managed/data/iatemplates/backup_error.yml b/managed/data/iatemplates/backup_error.yml new file mode 100644 index 0000000000..592c109c9c --- /dev/null +++ b/managed/data/iatemplates/backup_error.yml @@ -0,0 +1,12 @@ +--- +templates: + - name: pmm_backup_error + version: 1 + summary: Backup failed (Tech preview) + expr: 'pmm_managed_backups_artifacts{status="error"} == bool 1' + for: 1m + severity: error + annotations: + description: |- + Failed to create a backup artifact '{{ $labels.artifact_name}}' on service '{{ $labels.service_id }}'. + summary: Failed to create a backup artifact '{{ $labels.artifact_name}}' on service '{{ $labels.service_id }}'. diff --git a/managed/models/action_helpers.go b/managed/models/action_helpers.go index a61f08bdca..761fa84826 100644 --- a/managed/models/action_helpers.go +++ b/managed/models/action_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/action_helpers_test.go b/managed/models/action_helpers_test.go index 20270553d8..30009aeb95 100644 --- a/managed/models/action_helpers_test.go +++ b/managed/models/action_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/action_models.go b/managed/models/action_models.go index e6bc10876c..451932d8ce 100644 --- a/managed/models/action_models.go +++ b/managed/models/action_models.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -57,7 +57,7 @@ func (s *ActionResult) AfterFind() error { return nil } -// check interfaces +// check interfaces. var ( _ reform.BeforeInserter = (*ActionResult)(nil) _ reform.BeforeUpdater = (*ActionResult)(nil) diff --git a/managed/models/agent_helpers.go b/managed/models/agent_helpers.go index 21df05d004..4d6e65c22e 100644 --- a/managed/models/agent_helpers.go +++ b/managed/models/agent_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/agent_helpers_test.go b/managed/models/agent_helpers_test.go index 44c679d846..dd48be34e7 100644 --- a/managed/models/agent_helpers_test.go +++ b/managed/models/agent_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/agent_model.go b/managed/models/agent_model.go index 1ae1cb2d22..c7cfc2f5c8 100644 --- a/managed/models/agent_model.go +++ b/managed/models/agent_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/agent_model_test.go b/managed/models/agent_model_test.go index 0fa15a86af..fd4eacd881 100644 --- a/managed/models/agent_model_test.go +++ b/managed/models/agent_model_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/artifact_helpers.go b/managed/models/artifact_helpers.go index 382d153bf0..ed8a95a0cd 100644 --- a/managed/models/artifact_helpers.go +++ b/managed/models/artifact_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -36,6 +36,8 @@ type ArtifactFilters struct { ScheduleID string // Return only artifacts by specified status. Status BackupStatus + // Filters by folder. + Folder *string } // FindArtifacts returns artifact list sorted by creation time in DESCENDING order. @@ -67,6 +69,13 @@ func FindArtifacts(q *reform.Querier, filters ArtifactFilters) ([]*Artifact, err if filters.Status != "" { conditions = append(conditions, fmt.Sprintf("status = %s", q.Placeholder(idx))) args = append(args, filters.Status) + idx++ + } + + if filters.Folder != nil { + conditions = append(conditions, fmt.Sprintf("folder = %s", q.Placeholder(idx))) + args = append(args, *filters.Folder) + // idx++ } var whereClause string diff --git a/managed/models/artifact_helpers_test.go b/managed/models/artifact_helpers_test.go index e459e7c6a7..8d2cc84783 100644 --- a/managed/models/artifact_helpers_test.go +++ b/managed/models/artifact_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -167,10 +167,23 @@ func TestArtifacts(t *testing.T) { Mode: models.Snapshot, } + params3 := models.CreateArtifactParams{ + Name: "backup_name_3", + Vendor: "mongodb", + LocationID: locationID2, + ServiceID: serviceID2, + DataModel: models.LogicalDataModel, + Status: models.SuccessBackupStatus, + Mode: models.Snapshot, + Folder: "some_folder", + } + a1, err := models.CreateArtifact(q, params1) require.NoError(t, err) a2, err := models.CreateArtifact(q, params2) require.NoError(t, err) + a3, err := models.CreateArtifact(q, params3) + require.NoError(t, err) actual, err := models.FindArtifacts(q, models.ArtifactFilters{}) require.NoError(t, err) @@ -188,6 +201,19 @@ func TestArtifacts(t *testing.T) { assert.Condition(t, found(a1.ID), "The first artifact not found") assert.Condition(t, found(a2.ID), "The second artifact not found") + + // Check artifacts can be found by folder. + actual2, err := models.FindArtifacts(q, models.ArtifactFilters{Folder: &a3.Folder}) + require.NoError(t, err) + assert.Equal(t, []*models.Artifact{a3}, actual2) + + actual3, err := models.FindArtifacts(q, models.ArtifactFilters{}) + require.NoError(t, err) + require.Equal(t, 3, len(actual3)) + + for _, a := range actual3 { + assert.Contains(t, []models.Artifact{*a1, *a2, *a3}, *a) + } }) t.Run("remove", func(t *testing.T) { diff --git a/managed/models/artifact_model.go b/managed/models/artifact_model.go index 6c879d4d24..2ec01b4c6b 100644 --- a/managed/models/artifact_model.go +++ b/managed/models/artifact_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/check_settings_helper.go b/managed/models/check_settings_helper.go index ad9d09ac97..d22855ffcf 100644 --- a/managed/models/check_settings_helper.go +++ b/managed/models/check_settings_helper.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/check_settings_helper_test.go b/managed/models/check_settings_helper_test.go index 427de8750a..b64de25bd1 100644 --- a/managed/models/check_settings_helper_test.go +++ b/managed/models/check_settings_helper_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/check_settings_model.go b/managed/models/check_settings_model.go index 76c6fa62ba..133b6d64a9 100644 --- a/managed/models/check_settings_model.go +++ b/managed/models/check_settings_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/common_helpers.go b/managed/models/common_helpers.go index 5e81f7563e..ee79c6a590 100644 --- a/managed/models/common_helpers.go +++ b/managed/models/common_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/database.go b/managed/models/database.go index 342a76dc39..4839eedde8 100644 --- a/managed/models/database.go +++ b/managed/models/database.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -916,6 +916,9 @@ var databaseSchema = [][]string{ ALTER COLUMN comments_parsing_disabled DROP DEFAULT`, }, 85: { + `UPDATE services SET cluster = service_name WHERE cluster = ''`, + }, + 86: { `DROP TABLE IF EXISTS ia_channels`, `DROP TABLE IF EXISTS ia_rules`, `ALTER TABLE ia_templates RENAME TO alert_rule_templates`, diff --git a/managed/models/database_test.go b/managed/models/database_test.go index 083ab679a6..0f86574b19 100644 --- a/managed/models/database_test.go +++ b/managed/models/database_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -32,7 +32,7 @@ import ( "github.com/percona/pmm/managed/utils/testdb" ) -// See https://www.postgresql.org/docs/10/errcodes-appendix.html for error codes +// See https://www.postgresql.org/docs/10/errcodes-appendix.html for error codes. func assertUniqueViolation(t *testing.T, err error, constraint string) { t.Helper() diff --git a/managed/models/delimiter.go b/managed/models/delimiter.go index 9e96c707ff..23d9e0025b 100644 --- a/managed/models/delimiter.go +++ b/managed/models/delimiter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/dsn_helpers.go b/managed/models/dsn_helpers.go index 34d4c722b2..a702e6efac 100644 --- a/managed/models/dsn_helpers.go +++ b/managed/models/dsn_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/dsn_helpers_test.go b/managed/models/dsn_helpers_test.go index 712d3bc24c..668f8863ce 100644 --- a/managed/models/dsn_helpers_test.go +++ b/managed/models/dsn_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/errors.go b/managed/models/errors.go index a0c1551e08..f97b89692c 100644 --- a/managed/models/errors.go +++ b/managed/models/errors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/job_helpers.go b/managed/models/job_helpers.go index 1762c7b34f..08327e2cd9 100644 --- a/managed/models/job_helpers.go +++ b/managed/models/job_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/job_helpers_test.go b/managed/models/job_helpers_test.go index 9c2cf9793d..c554b04e7a 100644 --- a/managed/models/job_helpers_test.go +++ b/managed/models/job_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/job_models.go b/managed/models/job_models.go index 43cd975d84..e34d404a93 100644 --- a/managed/models/job_models.go +++ b/managed/models/job_models.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/kubernetes_helpers.go b/managed/models/kubernetes_helpers.go index 7c2a2d9447..8128803ddd 100644 --- a/managed/models/kubernetes_helpers.go +++ b/managed/models/kubernetes_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -117,7 +117,7 @@ func CreateKubernetesCluster(q *reform.Querier, params *CreateKubernetesClusterP return row, nil } -// ChangeKubernetesClusterToReady changes k8s cluster to ready state once provisioning is finished +// ChangeKubernetesClusterToReady changes k8s cluster to ready state once provisioning is finished. func ChangeKubernetesClusterToReady(q *reform.Querier, name string) error { c, err := FindKubernetesClusterByName(q, name) if err != nil { diff --git a/managed/models/kubernetes_helpers_test.go b/managed/models/kubernetes_helpers_test.go index 1b8eb72600..6b602ba728 100644 --- a/managed/models/kubernetes_helpers_test.go +++ b/managed/models/kubernetes_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/kubernetes_models.go b/managed/models/kubernetes_models.go index 1fa98726f4..aef490cd3e 100644 --- a/managed/models/kubernetes_models.go +++ b/managed/models/kubernetes_models.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -24,7 +24,7 @@ import ( //go:generate ../../bin/reform -// Component stores info about DBaaS Component +// Component stores info about DBaaS Component. type Component struct { DisabledVersions []string DefaultVersion string diff --git a/managed/models/location_helpers.go b/managed/models/location_helpers.go index de7da55a21..8172d25a0a 100644 --- a/managed/models/location_helpers.go +++ b/managed/models/location_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/location_helpers_test.go b/managed/models/location_helpers_test.go index 032240a1d1..4ad3df1796 100644 --- a/managed/models/location_helpers_test.go +++ b/managed/models/location_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/location_model.go b/managed/models/location_model.go index ddde641b1b..5272b5c624 100644 --- a/managed/models/location_model.go +++ b/managed/models/location_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -27,7 +27,7 @@ import ( // BackupLocationType represents BackupLocation type as stored in database. type BackupLocationType string -// BackupLocation types. Same as in agent/runner/jobs/backup_location.go +// BackupLocation types. Same as in agent/runner/jobs/backup_location.go. const ( S3BackupLocationType BackupLocationType = "s3" FilesystemBackupLocationType BackupLocationType = "filesystem" diff --git a/managed/models/models.go b/managed/models/models.go index b135a82f01..c92479e1b0 100644 --- a/managed/models/models.go +++ b/managed/models/models.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/models_json_test.go b/managed/models/models_json_test.go index 80e5c7a6d9..ad35313dc4 100644 --- a/managed/models/models_json_test.go +++ b/managed/models/models_json_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/models_test.go b/managed/models/models_test.go index ed5a5a4f92..4de96c5767 100644 --- a/managed/models/models_test.go +++ b/managed/models/models_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/node_helpers.go b/managed/models/node_helpers.go index 638273634a..34c743bab5 100644 --- a/managed/models/node_helpers.go +++ b/managed/models/node_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/node_helpers_test.go b/managed/models/node_helpers_test.go index 2f858d40f6..6e3ac6b770 100644 --- a/managed/models/node_helpers_test.go +++ b/managed/models/node_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -132,7 +132,7 @@ func TestNodeHelpers(t *testing.T) { }) assert.NoError(t, err) - structs, err := q.SelectAllFrom(models.NodeTable, "WHERE machine_id = $1 ORDER BY node_id DESC", machineID) + structs, err := q.SelectAllFrom(models.NodeTable, "WHERE machine_id = $1 ORDER BY node_id", machineID) require.NoError(t, err) require.Len(t, structs, 2) expected := &models.Node{ diff --git a/managed/models/node_model.go b/managed/models/node_model.go index c6ebdf104a..3406071eb5 100644 --- a/managed/models/node_model.go +++ b/managed/models/node_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -134,7 +134,7 @@ func (s *Node) UnifiedLabels() (map[string]string, error) { return res, nil } -// check interfaces +// check interfaces. var ( _ reform.BeforeInserter = (*Node)(nil) _ reform.BeforeUpdater = (*Node)(nil) diff --git a/managed/models/node_model_test.go b/managed/models/node_model_test.go index 6bda8f5b0e..cee4269105 100644 --- a/managed/models/node_model_test.go +++ b/managed/models/node_model_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/percona_sso_model.go b/managed/models/percona_sso_model.go index 15629ff959..afa5009e84 100644 --- a/managed/models/percona_sso_model.go +++ b/managed/models/percona_sso_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/percona_sso_model_helpers.go b/managed/models/percona_sso_model_helpers.go index e91935b49b..55cda53440 100644 --- a/managed/models/percona_sso_model_helpers.go +++ b/managed/models/percona_sso_model_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/percona_sso_model_helpers_test.go b/managed/models/percona_sso_model_helpers_test.go index d4386350af..23f59c2d7d 100644 --- a/managed/models/percona_sso_model_helpers_test.go +++ b/managed/models/percona_sso_model_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/postgres.go b/managed/models/postgres.go index 641abefea0..72b6dfc906 100644 --- a/managed/models/postgres.go +++ b/managed/models/postgres.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/postgresql_version.go b/managed/models/postgresql_version.go index a5e6cb53eb..47136278b0 100644 --- a/managed/models/postgresql_version.go +++ b/managed/models/postgresql_version.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -24,7 +24,7 @@ import ( "gopkg.in/reform.v1" ) -// regexps to extract version numbers from the `SELECT version()` output +// regexps to extract version numbers from the `SELECT version()` output. var ( postgresDBRegexp = regexp.MustCompile(`PostgreSQL (\d+\.?\d+)`) ) diff --git a/managed/models/postgresql_version_test.go b/managed/models/postgresql_version_test.go index 5a676118ca..98828bba84 100644 --- a/managed/models/postgresql_version_test.go +++ b/managed/models/postgresql_version_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/restore_history_helpers.go b/managed/models/restore_history_helpers.go index 8680f97341..65bef9c0d2 100644 --- a/managed/models/restore_history_helpers.go +++ b/managed/models/restore_history_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/restore_history_helpers_test.go b/managed/models/restore_history_helpers_test.go index db837c1644..1621fe51d8 100644 --- a/managed/models/restore_history_helpers_test.go +++ b/managed/models/restore_history_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/restore_history_model.go b/managed/models/restore_history_model.go index fba2d166a4..ccfdb1a4eb 100644 --- a/managed/models/restore_history_model.go +++ b/managed/models/restore_history_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/role_helpers.go b/managed/models/role_helpers.go index 9abcd2ab21..da1c25057b 100644 --- a/managed/models/role_helpers.go +++ b/managed/models/role_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/role_helpers_test.go b/managed/models/role_helpers_test.go index 17394c4ff6..9121665095 100644 --- a/managed/models/role_helpers_test.go +++ b/managed/models/role_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/role_model.go b/managed/models/role_model.go index 964098b9c4..16d653e9f3 100644 --- a/managed/models/role_model.go +++ b/managed/models/role_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/scheduled_task_models.go b/managed/models/scheduled_task_models.go index 4e928f9f84..b4419531f1 100644 --- a/managed/models/scheduled_task_models.go +++ b/managed/models/scheduled_task_models.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/scheduled_tasks_helpers.go b/managed/models/scheduled_tasks_helpers.go index f7c5f51bf0..be58f5eaf5 100644 --- a/managed/models/scheduled_tasks_helpers.go +++ b/managed/models/scheduled_tasks_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -55,6 +55,7 @@ type ScheduledTasksFilter struct { LocationID string Mode BackupMode Name string + Folder *string } // FindScheduledTasks returns all scheduled tasks satisfying filter. @@ -110,6 +111,12 @@ func FindScheduledTasks(q *reform.Querier, filters ScheduledTasksFilter) ([]*Sch crossJoin = true andConds = append(andConds, "value ->> 'name' = "+q.Placeholder(idx)) args = append(args, filters.Name) + idx++ + } + if filters.Folder != nil { + crossJoin = true + andConds = append(andConds, "value ->> 'folder' = "+q.Placeholder(idx)) + args = append(args, *filters.Folder) // idx++ } @@ -367,6 +374,15 @@ func (s *ScheduledTask) LocationID() (string, error) { return data.LocationID, nil } +// ServiceID returns task service ID. +func (s *ScheduledTask) ServiceID() (string, error) { + data, err := s.CommonBackupData() + if err != nil { + return "", err + } + return data.ServiceID, nil +} + func (s *ScheduledTask) CommonBackupData() (*CommonBackupTaskData, error) { if s.Data != nil { switch s.Type { diff --git a/managed/models/scheduled_tasks_helpers_test.go b/managed/models/scheduled_tasks_helpers_test.go index 50a1f2b555..c890838f9e 100644 --- a/managed/models/scheduled_tasks_helpers_test.go +++ b/managed/models/scheduled_tasks_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/service_helpers.go b/managed/models/service_helpers.go index a2b04f9336..257fae1f61 100644 --- a/managed/models/service_helpers.go +++ b/managed/models/service_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -402,6 +402,51 @@ func ValidateServiceType(serviceType ServiceType) error { } } +// ChangeStandardLabelsParams contains parameters for changing standard labels for a service. +type ChangeStandardLabelsParams struct { + ServiceID string + Cluster *string + Environment *string + ReplicationSet *string + ExternalGroup *string +} + +// ChangeStandardLabels changes standard labels for a service. +func ChangeStandardLabels(q *reform.Querier, serviceID string, labels ServiceStandardLabelsParams) error { + s, err := FindServiceByID(q, serviceID) + if err != nil { + return err + } + + columns := []string{} + + if labels.Cluster != nil { + columns = append(columns, "cluster") + s.Cluster = *labels.Cluster + } + + if labels.Environment != nil { + columns = append(columns, "environment") + s.Environment = *labels.Environment + } + + if labels.ReplicationSet != nil { + columns = append(columns, "replication_set") + s.ReplicationSet = *labels.ReplicationSet + } + + if labels.ExternalGroup != nil { + columns = append(columns, "external_group") + s.ExternalGroup = *labels.ExternalGroup + } + + if err = q.UpdateColumns(s, columns...); err != nil { + return err + } + + return nil +} + func initSoftwareVersions(q *reform.Querier, serviceID string, serviceType ServiceType) error { switch serviceType { case MySQLServiceType: diff --git a/managed/models/service_helpers_test.go b/managed/models/service_helpers_test.go index 140497e11a..47d4dc317c 100644 --- a/managed/models/service_helpers_test.go +++ b/managed/models/service_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -158,10 +158,11 @@ func TestServiceHelpers(t *testing.T) { services, err = models.FindServices(q, models.ServiceFilters{NodeID: "N1"}) assert.NoError(t, err) assert.Equal(t, 3, len(services)) - assert.Equal(t, services, []*models.Service{{ + assert.Equal(t, []*models.Service{{ ServiceID: "S1", ServiceType: models.MongoDBServiceType, ServiceName: "Service without Agents", + Cluster: "Service without Agents", NodeID: "N1", Address: pointer.ToString("127.0.0.1"), Port: pointer.ToUint16OrNil(27017), @@ -171,6 +172,7 @@ func TestServiceHelpers(t *testing.T) { ServiceID: "S2", ServiceType: models.MySQLServiceType, ServiceName: "Service with Agents", + Cluster: "Service with Agents", NodeID: "N1", Address: pointer.ToString("127.0.0.1"), Port: pointer.ToUint16OrNil(3306), @@ -180,35 +182,38 @@ func TestServiceHelpers(t *testing.T) { ServiceID: "S5", ServiceType: models.ProxySQLServiceType, ServiceName: "Fifth service", + Cluster: "Fifth service", NodeID: "N1", Address: pointer.ToString("127.0.0.1"), Port: pointer.ToUint16OrNil(6032), CreatedAt: now, UpdatedAt: now, - }}) + }}, services) services, err = models.FindServices(q, models.ServiceFilters{NodeID: "N1", ServiceType: pointerToServiceType(models.MySQLServiceType)}) assert.NoError(t, err) assert.Equal(t, 1, len(services)) - assert.Equal(t, services, []*models.Service{{ + assert.Equal(t, []*models.Service{{ ServiceID: "S2", ServiceType: models.MySQLServiceType, ServiceName: "Service with Agents", + Cluster: "Service with Agents", NodeID: "N1", Address: pointer.ToString("127.0.0.1"), Port: pointer.ToUint16OrNil(3306), CreatedAt: now, UpdatedAt: now, - }}) + }}, services) services, err = models.FindServices(q, models.ServiceFilters{NodeID: "N2", ServiceType: pointerToServiceType(models.ExternalServiceType)}) assert.NoError(t, err) assert.Equal(t, 2, len(services)) - assert.Equal(t, services, []*models.Service{ + assert.Equal(t, []*models.Service{ { ServiceID: "S4", ServiceType: models.ExternalServiceType, ServiceName: "Fourth service", + Cluster: "Fourth service", ExternalGroup: "external", NodeID: "N2", CreatedAt: now, @@ -218,6 +223,7 @@ func TestServiceHelpers(t *testing.T) { ServiceID: "S7", ServiceType: models.ExternalServiceType, ServiceName: "Seventh service", + Cluster: "Seventh service", NodeID: "N2", Address: pointer.ToString("127.0.0.1"), Port: pointer.ToUint16OrNil(6379), @@ -225,47 +231,50 @@ func TestServiceHelpers(t *testing.T) { CreatedAt: now, UpdatedAt: now, }, - }) + }, services) services, err = models.FindServices(q, models.ServiceFilters{NodeID: "N2", ServiceType: pointerToServiceType(models.ProxySQLServiceType)}) assert.NoError(t, err) assert.Equal(t, 1, len(services)) - assert.Equal(t, services, []*models.Service{{ + assert.Equal(t, []*models.Service{{ ServiceID: "S6", ServiceType: models.ProxySQLServiceType, ServiceName: "Sixth service", + Cluster: "Sixth service", Socket: pointer.ToStringOrNil("/tmp/proxysql_admin.sock"), NodeID: "N2", CreatedAt: now, UpdatedAt: now, - }}) + }}, services) services, err = models.FindServices(q, models.ServiceFilters{ExternalGroup: "redis"}) assert.NoError(t, err) assert.Equal(t, 1, len(services)) - assert.Equal(t, services, []*models.Service{{ + assert.Equal(t, []*models.Service{{ ServiceID: "S7", ServiceType: models.ExternalServiceType, ServiceName: "Seventh service", + Cluster: "Seventh service", NodeID: "N2", Address: pointer.ToString("127.0.0.1"), Port: pointer.ToUint16OrNil(6379), ExternalGroup: "redis", CreatedAt: now, UpdatedAt: now, - }}) + }}, services) services, err = models.FindServices(q, models.ServiceFilters{NodeID: "N2", ServiceType: pointerToServiceType(models.HAProxyServiceType)}) assert.NoError(t, err) assert.Equal(t, 1, len(services)) - assert.Equal(t, services, []*models.Service{{ + assert.Equal(t, []*models.Service{{ ServiceID: "S8", ServiceType: models.HAProxyServiceType, ServiceName: "Eighth service", + Cluster: "Eighth service", NodeID: "N2", CreatedAt: now, UpdatedAt: now, - }}) + }}, services) }) t.Run("FindActiveServiceTypes", func(t *testing.T) { @@ -442,6 +451,36 @@ func TestServiceHelpers(t *testing.T) { assert.ElementsMatch(t, []*models.Service{s1, s2}, services) }) + t.Run("Change standard labels", func(t *testing.T) { + q, teardown := setup(t) + defer teardown(t) + s, err := models.AddNewService(q, models.ExternalServiceType, &models.AddDBMSServiceParams{ + ServiceName: "mongors1", + NodeID: "N1", + Cluster: "cluster0", + ExternalGroup: "ext", + Address: pointer.ToString("127.0.0.1"), + Port: pointer.ToUint16OrNil(27017), + }) + require.NoError(t, err) + + err = models.ChangeStandardLabels(q, s.ServiceID, models.ServiceStandardLabelsParams{ + Cluster: pointer.ToString("cluster"), + Environment: pointer.ToString("env"), + ReplicationSet: pointer.ToString("rs"), + ExternalGroup: pointer.ToString("external"), + }) + require.NoError(t, err) + + ns, err := models.FindServiceByID(q, s.ServiceID) + require.NoError(t, err) + + assert.Equal(t, ns.Cluster, "cluster") + assert.Equal(t, ns.Environment, "env") + assert.Equal(t, ns.ReplicationSet, "rs") + assert.Equal(t, ns.ExternalGroup, "external") + }) + t.Run("Software versions record created when adding a service", func(t *testing.T) { q, teardown := setup(t) defer teardown(t) diff --git a/managed/models/service_model.go b/managed/models/service_model.go index 55e326826b..04c7484156 100644 --- a/managed/models/service_model.go +++ b/managed/models/service_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -27,6 +27,13 @@ import ( // pmm-managed's PostgreSQL, qan-api's ClickHouse, and VictoriaMetrics. type ServiceType string +type ServiceStandardLabelsParams struct { + Cluster *string + Environment *string + ReplicationSet *string + ExternalGroup *string +} + // Service types (in the same order as in services.proto). const ( MySQLServiceType ServiceType = "mysql" @@ -67,6 +74,9 @@ func (s *Service) BeforeInsert() error { if len(s.CustomLabels) == 0 { s.CustomLabels = nil } + if s.Cluster == "" { + s.Cluster = s.ServiceName + } return nil } @@ -76,6 +86,9 @@ func (s *Service) BeforeUpdate() error { if len(s.CustomLabels) == 0 { s.CustomLabels = nil } + if s.Cluster == "" { + s.Cluster = s.ServiceName + } return nil } @@ -125,7 +138,7 @@ func (s *Service) UnifiedLabels() (map[string]string, error) { return res, nil } -// check interfaces +// check interfaces. var ( _ reform.BeforeInserter = (*Service)(nil) _ reform.BeforeUpdater = (*Service)(nil) diff --git a/managed/models/service_model_test.go b/managed/models/service_model_test.go index 7493c5fe13..a26dcce51a 100644 --- a/managed/models/service_model_test.go +++ b/managed/models/service_model_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/settings.go b/managed/models/settings.go index 30087b1469..1327128ca4 100644 --- a/managed/models/settings.go +++ b/managed/models/settings.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/settings_helpers.go b/managed/models/settings_helpers.go index 5c83332368..c48968ddf1 100644 --- a/managed/models/settings_helpers.go +++ b/managed/models/settings_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/settings_helpers_test.go b/managed/models/settings_helpers_test.go index a810559fda..0474d3927b 100644 --- a/managed/models/settings_helpers_test.go +++ b/managed/models/settings_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/software_version.go b/managed/models/software_version.go index ac9410ff97..0fc5d38b37 100644 --- a/managed/models/software_version.go +++ b/managed/models/software_version.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/software_version_helpers.go b/managed/models/software_version_helpers.go index 9d49e33b4c..853ae749df 100644 --- a/managed/models/software_version_helpers.go +++ b/managed/models/software_version_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/software_version_helpers_test.go b/managed/models/software_version_helpers_test.go index a0ea43e75f..24b7c32a17 100644 --- a/managed/models/software_version_helpers_test.go +++ b/managed/models/software_version_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/template_helpers.go b/managed/models/template_helpers.go index e89f749f2d..7c0ca1ee57 100644 --- a/managed/models/template_helpers.go +++ b/managed/models/template_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -44,17 +44,15 @@ func checkUniqueTemplateName(q *reform.Querier, name string) error { } // FindTemplates returns saved notification rule templates. -func FindTemplates(q *reform.Querier) ([]Template, error) { +func FindTemplates(q *reform.Querier) ([]*Template, error) { structs, err := q.SelectAllFrom(TemplateTable, "") if err != nil { return nil, errors.Wrap(err, "failed to select notification rule templates") } - templates := make([]Template, len(structs)) + templates := make([]*Template, len(structs)) for i, s := range structs { - c := s.(*Template) //nolint:forcetypeassert - - templates[i] = *c + templates[i] = s.(*Template) //nolint:forcetypeassert } return templates, nil @@ -81,7 +79,6 @@ func FindTemplateByName(q *reform.Querier, name string) (*Template, error) { // CreateTemplateParams are params for creating new rule template. type CreateTemplateParams struct { Template *alert.Template - Yaml string Source Source } @@ -92,33 +89,13 @@ func CreateTemplate(q *reform.Querier, params *CreateTemplateParams) (*Template, return nil, status.Errorf(codes.InvalidArgument, "Invalid rule template: %v.", err) } - if err := checkUniqueTemplateName(q, params.Template.Name); err != nil { + if err := checkUniqueTemplateName(q, template.Name); err != nil { return nil, err } - p, err := ConvertParamsDefinitions(params.Template.Params) + row, err := ConvertTemplate(template, params.Source) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "Invalid rule template parameters: %v.", err) - } - - row := &Template{ - Name: template.Name, - Version: template.Version, - Summary: template.Summary, - Expr: template.Expr, - Params: p, - For: time.Duration(template.For), - Severity: Severity(template.Severity), - Source: params.Source, - Yaml: params.Yaml, - } - - if err := row.SetLabels(template.Labels); err != nil { - return nil, err - } - - if err := row.SetAnnotations(template.Annotations); err != nil { - return nil, err + return nil, status.Errorf(codes.InvalidArgument, "Failed to convert template: %v.", err) } if err = q.Insert(row); err != nil { @@ -132,7 +109,6 @@ func CreateTemplate(q *reform.Querier, params *CreateTemplateParams) (*Template, type ChangeTemplateParams struct { Template *alert.Template Name string - Yaml string } // ChangeTemplate updates existing rule template. @@ -151,6 +127,11 @@ func ChangeTemplate(q *reform.Querier, params *ChangeTemplateParams) (*Template, return nil, status.Errorf(codes.InvalidArgument, "Invalid rule template: %v.", err) } + yaml, err := alert.ToYAML([]alert.Template{*template}) + if err != nil { + return nil, errors.WithStack(err) + } + p, err := ConvertParamsDefinitions(params.Template.Params) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "Invalid rule template parameters: %v.", err) @@ -163,7 +144,7 @@ func ChangeTemplate(q *reform.Querier, params *ChangeTemplateParams) (*Template, row.Params = p row.For = time.Duration(template.For) row.Severity = Severity(template.Severity) - row.Yaml = params.Yaml + row.Yaml = yaml if err = row.SetLabels(template.Labels); err != nil { return nil, err @@ -193,6 +174,40 @@ func RemoveTemplate(q *reform.Querier, name string) error { return nil } +func ConvertTemplate(template *alert.Template, source Source) (*Template, error) { + p, err := ConvertParamsDefinitions(template.Params) + if err != nil { + return nil, errors.Errorf("invalid rule template parameters: %v.", err) + } + + yaml, err := alert.ToYAML([]alert.Template{*template}) + if err != nil { + return nil, errors.WithStack(err) + } + + res := &Template{ + Name: template.Name, + Version: template.Version, + Summary: template.Summary, + Expr: template.Expr, + Params: p, + For: time.Duration(template.For), + Severity: Severity(template.Severity), + Source: source, + Yaml: yaml, + } + + if err := res.SetLabels(template.Labels); err != nil { + return nil, err + } + + if err := res.SetAnnotations(template.Annotations); err != nil { + return nil, err + } + + return res, nil +} + // ConvertParamsDefinitions converts parameters definitions to the model. func ConvertParamsDefinitions(params []alert.Parameter) (AlertExprParamsDefinitions, error) { res := make(AlertExprParamsDefinitions, 0, len(params)) @@ -200,7 +215,7 @@ func ConvertParamsDefinitions(params []alert.Parameter) (AlertExprParamsDefiniti p := AlertExprParamDefinition{ Name: param.Name, Summary: param.Summary, - Unit: string(param.Unit), + Unit: ParamUnit(param.Unit), Type: ParamType(param.Type), } diff --git a/managed/models/template_helpers_test.go b/managed/models/template_helpers_test.go index 1b5f5b2508..4394cf8cce 100644 --- a/managed/models/template_helpers_test.go +++ b/managed/models/template_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -60,7 +60,7 @@ func TestRuleTemplates(t *testing.T) { models.AlertExprParamsDefinitions{{ Name: params.Template.Params[0].Name, Summary: params.Template.Params[0].Summary, - Unit: string(params.Template.Params[0].Unit), + Unit: models.ParamUnit(params.Template.Params[0].Unit), Type: models.Float, FloatParam: &models.FloatParam{ Default: pointer.ToFloat64(params.Template.Params[0].Value.(float64)), @@ -110,7 +110,7 @@ func TestRuleTemplates(t *testing.T) { models.AlertExprParamsDefinitions{{ Name: updateParams.Template.Params[0].Name, Summary: updateParams.Template.Params[0].Summary, - Unit: string(updateParams.Template.Params[0].Unit), + Unit: models.ParamUnit(updateParams.Template.Params[0].Unit), Type: models.Float, FloatParam: &models.FloatParam{ Default: pointer.ToFloat64(updateParams.Template.Params[0].Value.(float64)), diff --git a/managed/models/template_model.go b/managed/models/template_model.go index 2ecb5a656b..fc1794f6a5 100644 --- a/managed/models/template_model.go +++ b/managed/models/template_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -112,7 +112,7 @@ func (p *AlertExprParamsDefinitions) Scan(src interface{}) error { return jsonSc type AlertExprParamDefinition struct { Name string `json:"name"` Summary string `json:"summary"` - Unit string `json:"unit"` + Unit ParamUnit `json:"unit"` Type ParamType `json:"type"` FloatParam *FloatParam `json:"float_param"` @@ -130,6 +130,15 @@ const ( String = ParamType("string") ) +// ParamUnit parameter unit. +type ParamUnit string + +// Available parameter units. +const ( + Percent = ParamUnit("%") + Seconds = ParamUnit("s") +) + // BoolParam represents boolean template parameter. type BoolParam struct { Default *bool `json:"default,omitempty"` diff --git a/managed/models/user_flags_helpers.go b/managed/models/user_flags_helpers.go index 7d7b9fc969..20f7faea2b 100644 --- a/managed/models/user_flags_helpers.go +++ b/managed/models/user_flags_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/user_flags_model.go b/managed/models/user_flags_model.go index 8876c9b994..5f7e8cff1e 100644 --- a/managed/models/user_flags_model.go +++ b/managed/models/user_flags_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/user_roles_helpers.go b/managed/models/user_roles_helpers.go index 8bdbc6aa63..47c861f477 100644 --- a/managed/models/user_roles_helpers.go +++ b/managed/models/user_roles_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/user_roles_model.go b/managed/models/user_roles_model.go index 7ba870216d..ca8fa2c4d3 100644 --- a/managed/models/user_roles_model.go +++ b/managed/models/user_roles_model.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/models/victoriametrics.go b/managed/models/victoriametrics_params.go similarity index 71% rename from managed/models/victoriametrics.go rename to managed/models/victoriametrics_params.go index d8b07caf27..14a86a5d41 100644 --- a/managed/models/victoriametrics.go +++ b/managed/models/victoriametrics_params.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -16,25 +16,45 @@ package models import ( + "net/url" "os" + "strings" config "github.com/percona/promconfig" "github.com/pkg/errors" "gopkg.in/yaml.v3" ) +const ( + // BasePrometheusConfigPath - basic path with prometheus config, + // that user can mount to container. + BasePrometheusConfigPath = "/srv/prometheus/prometheus.base.yml" + VMBaseURL = "http://127.0.0.1:9090/prometheus/" +) + // VictoriaMetricsParams - defines flags and settings for victoriametrics. type VictoriaMetricsParams struct { // VMAlertFlags additional flags for VMAlert. VMAlertFlags []string // BaseConfigPath defines path for basic prometheus config. BaseConfigPath string + // url defines url of Victoria Metrics + url *url.URL } // NewVictoriaMetricsParams - returns configuration params for VictoriaMetrics. -func NewVictoriaMetricsParams(basePath string) (*VictoriaMetricsParams, error) { +func NewVictoriaMetricsParams(basePath string, vmURL string) (*VictoriaMetricsParams, error) { + if !strings.HasSuffix(vmURL, "/") { + vmURL += "/" + } + + URL, err := url.Parse(vmURL) + if err != nil { + return nil, err + } vmp := &VictoriaMetricsParams{ BaseConfigPath: basePath, + url: URL, } if err := vmp.UpdateParams(); err != nil { return vmp, err @@ -59,7 +79,7 @@ func (vmp *VictoriaMetricsParams) loadVMAlertParams() error { if !os.IsNotExist(err) { return errors.Wrap(err, "cannot read baseConfigPath for VMAlertParams") } - // fast return if users configuration doesn't exists with path + // fast return if users configuration doesn't exist with path // /srv/prometheus/prometheus.base.yml, // its maybe mounted into container by user. return nil @@ -79,3 +99,18 @@ func (vmp *VictoriaMetricsParams) loadVMAlertParams() error { return nil } + +func (vmp *VictoriaMetricsParams) ExternalVM() bool { + return vmp.url.Hostname() != "127.0.0.1" +} + +func (vmp *VictoriaMetricsParams) URL() string { + return vmp.url.String() +} + +func (vmp *VictoriaMetricsParams) URLFor(path string) (*url.URL, error) { + if path == "" { + return vmp.url, nil + } + return vmp.url.Parse(path) +} diff --git a/managed/models/victoriametrics_test.go b/managed/models/victoriametrics_params_test.go similarity index 60% rename from managed/models/victoriametrics_test.go rename to managed/models/victoriametrics_params_test.go index 02ab59b036..9f673c7518 100644 --- a/managed/models/victoriametrics_test.go +++ b/managed/models/victoriametrics_params_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -18,17 +18,48 @@ package models import ( "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestVictoriaMetricsParams(t *testing.T) { t.Run("read non exist baseConfigFile", func(t *testing.T) { - _, err := NewVictoriaMetricsParams("nonExistConfigFile.yml") + _, err := NewVictoriaMetricsParams("nonExistConfigFile.yml", VMBaseURL) require.NoError(t, err) }) t.Run("check params for VMAlert", func(t *testing.T) { - vmp, err := NewVictoriaMetricsParams("../testdata/victoriametrics/prometheus.external.alerts.yml") + vmp, err := NewVictoriaMetricsParams("../testdata/victoriametrics/prometheus.external.alerts.yml", VMBaseURL) require.NoError(t, err) require.Equal(t, []string{"--rule=/srv/external_rules/rul1.yml", "--rule=/srv/external_rules/rule2.yml", "--evaluationInterval=10s"}, vmp.VMAlertFlags) }) + t.Run("check external VM", func(t *testing.T) { + tests := []struct { + url string + want bool + }{ + { + "http://127.0.0.1:9090/prometheus", + false, + }, + { + "http://127.0.0.1:9090/prometheus/", + false, + }, + { + "http://victoriametrics:8428/", + true, + }, + { + "https://example.com:9090/", + true, + }, + } + for _, tt := range tests { + t.Run(tt.url, func(t *testing.T) { + vmp, err := NewVictoriaMetricsParams(BasePrometheusConfigPath, tt.url) + require.NoError(t, err) + assert.Equalf(t, tt.want, vmp.ExternalVM(), "ExternalVM()") + }) + } + }) } diff --git a/managed/services/agents/actions.go b/managed/services/agents/actions.go index d8a206b4e4..52a1097d8a 100644 --- a/managed/services/agents/actions.go +++ b/managed/services/agents/actions.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -66,7 +66,7 @@ func (s *ActionsService) StartMySQLExplainAction( return status.Error(codes.FailedPrecondition, "query or query_id is required") } - var q string + var q, schema string switch { case queryID != "": res, err := s.qanClient.ExplainFingerprintByQueryID(ctx, serviceID, queryID) @@ -77,8 +77,13 @@ func (s *ActionsService) StartMySQLExplainAction( if res.PlaceholdersCount != uint32(len(placeholders)) { return status.Error(codes.FailedPrecondition, "placeholders count is not correct") } - q = res.ExplainFingerprint + + s, err := s.qanClient.SchemaByQueryID(ctx, serviceID, queryID) + if err != nil { + return err + } + schema = s.Schema default: err := s.qanClient.QueryExists(ctx, serviceID, query) if err != nil { @@ -99,6 +104,7 @@ func (s *ActionsService) StartMySQLExplainAction( Dsn: dsn, Query: q, Values: placeholders, + Schema: schema, OutputFormat: format, TlsFiles: &agentpb.TextFiles{ Files: files, diff --git a/managed/services/agents/agents.go b/managed/services/agents/agents.go index 0d7ffa4853..5a6c9bb036 100644 --- a/managed/services/agents/agents.go +++ b/managed/services/agents/agents.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/agents_test.go b/managed/services/agents/agents_test.go index 1497a0ac5d..ce0e846241 100644 --- a/managed/services/agents/agents_test.go +++ b/managed/services/agents/agents_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/agentversion.go b/managed/services/agents/agentversion.go index 427b501f22..9486511d3c 100644 --- a/managed/services/agents/agentversion.go +++ b/managed/services/agents/agentversion.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/agentversion_test.go b/managed/services/agents/agentversion_test.go index f6b22abb49..ebbad646fc 100644 --- a/managed/services/agents/agentversion_test.go +++ b/managed/services/agents/agentversion_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/azure_database.go b/managed/services/agents/azure_database.go index 2ccff9d96c..c53417306a 100644 --- a/managed/services/agents/azure_database.go +++ b/managed/services/agents/azure_database.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/azure_database_test.go b/managed/services/agents/azure_database_test.go index 0cdd20b727..17d1302fbc 100644 --- a/managed/services/agents/azure_database_test.go +++ b/managed/services/agents/azure_database_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/channel/channel.go b/managed/services/agents/channel/channel.go index 6fc8b8f9ed..1229ab6fab 100644 --- a/managed/services/agents/channel/channel.go +++ b/managed/services/agents/channel/channel.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -28,7 +28,7 @@ import ( grpcstatus "google.golang.org/grpc/status" "github.com/percona/pmm/api/agentpb" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" ) const ( diff --git a/managed/services/agents/channel/channel_test.go b/managed/services/agents/channel/channel_test.go index 5f877fc60b..0944d85936 100644 --- a/managed/services/agents/channel/channel_test.go +++ b/managed/services/agents/channel/channel_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/configure_test.go b/managed/services/agents/configure_test.go index 2f56d2e1bb..be8d98b9a1 100644 --- a/managed/services/agents/configure_test.go +++ b/managed/services/agents/configure_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/connection_checker.go b/managed/services/agents/connection_checker.go index 3dc91d6f0f..256481be3b 100644 --- a/managed/services/agents/connection_checker.go +++ b/managed/services/agents/connection_checker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -31,7 +31,7 @@ import ( "github.com/percona/pmm/api/agentpb" "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" "github.com/percona/pmm/version" ) diff --git a/managed/services/agents/deps.go b/managed/services/agents/deps.go index e4b0c36014..9774ce6e73 100644 --- a/managed/services/agents/deps.go +++ b/managed/services/agents/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -17,6 +17,7 @@ package agents import ( "context" + "net/url" "github.com/sirupsen/logrus" @@ -39,6 +40,7 @@ type qanClient interface { Collect(ctx context.Context, metricsBuckets []*agentpb.MetricsBucket) error QueryExists(ctx context.Context, serviceID, query string) error ExplainFingerprintByQueryID(ctx context.Context, serviceID, queryID string) (*qanpb.ExplainFingerprintByQueryIDReply, error) + SchemaByQueryID(ctx context.Context, serviceID, queryID string) (*qanpb.SchemaByQueryIDReply, error) } // retentionService is a subset of methods of backup.Client used by this package. @@ -53,3 +55,11 @@ type jobsService interface { handleJobResult(ctx context.Context, l *logrus.Entry, result *agentpb.JobResult) handleJobProgress(ctx context.Context, progress *agentpb.JobProgress) } + +// victoriaMetricsParams is a subset of methods of models.VMParams used by this package. +// We use it instead of real type to avoid dependency cycle. +type victoriaMetricsParams interface { + ExternalVM() bool + URLFor(path string) (*url.URL, error) + URL() string +} diff --git a/managed/services/agents/grpc/agent_server.go b/managed/services/agents/grpc/agent_server.go index 42ef5b0d09..69eced0a99 100644 --- a/managed/services/agents/grpc/agent_server.go +++ b/managed/services/agents/grpc/agent_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -40,7 +40,7 @@ func (s *agentServer) Connect(stream agentpb.Agent_ConnectServer) error { return s.handler.Run(stream) } -// check interfaces +// check interfaces. var ( _ agentpb.AgentServer = (*agentServer)(nil) ) diff --git a/managed/services/agents/handler.go b/managed/services/agents/handler.go index ff45391e11..011ce90a84 100644 --- a/managed/services/agents/handler.go +++ b/managed/services/agents/handler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -31,7 +31,7 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services/agents/channel" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" ) // Handler handles agent requests. diff --git a/managed/services/agents/jobs.go b/managed/services/agents/jobs.go index a78fffd381..56a6430e14 100644 --- a/managed/services/agents/jobs.go +++ b/managed/services/agents/jobs.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/jobs_test.go b/managed/services/agents/jobs_test.go index e6788e581d..cfb93abbc6 100644 --- a/managed/services/agents/jobs_test.go +++ b/managed/services/agents/jobs_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/log_level.go b/managed/services/agents/log_level.go index 57f236c1f0..2b33b472f8 100644 --- a/managed/services/agents/log_level.go +++ b/managed/services/agents/log_level.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -22,11 +22,11 @@ import ( "github.com/percona/pmm/version" ) -// Log level available in exporters with pmm 2.28 +// Log level available in exporters with pmm 2.28. var exporterLogLevelCommandVersion = version.MustParse("2.27.99") // withLogLevel - append CLI args --log.level -// mysqld_exporter, node_exporter and postgres_exporter don't support --log.level=fatal +// mysqld_exporter, node_exporter and postgres_exporter don't support --log.level=fatal. func withLogLevel(args []string, logLevel *string, pmmAgentVersion *version.Parsed, supportLogLevelFatal bool) []string { level := pointer.GetString(logLevel) diff --git a/managed/services/agents/mongodb.go b/managed/services/agents/mongodb.go index f0d14243fe..e51f4ba393 100644 --- a/managed/services/agents/mongodb.go +++ b/managed/services/agents/mongodb.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/mongodb_test.go b/managed/services/agents/mongodb_test.go index 9630519b50..9e01fe3eff 100644 --- a/managed/services/agents/mongodb_test.go +++ b/managed/services/agents/mongodb_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/mysql.go b/managed/services/agents/mysql.go index 56a67d7077..a2ecf8bfd3 100644 --- a/managed/services/agents/mysql.go +++ b/managed/services/agents/mysql.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/mysql_test.go b/managed/services/agents/mysql_test.go index 9b80f23483..0dd26767cc 100644 --- a/managed/services/agents/mysql_test.go +++ b/managed/services/agents/mysql_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/node.go b/managed/services/agents/node.go index ddd51efe2d..0189db757b 100644 --- a/managed/services/agents/node.go +++ b/managed/services/agents/node.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/node_test.go b/managed/services/agents/node_test.go index b050f8295f..e458847eca 100644 --- a/managed/services/agents/node_test.go +++ b/managed/services/agents/node_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/postgresql.go b/managed/services/agents/postgresql.go index e3503ed638..d777e56b47 100644 --- a/managed/services/agents/postgresql.go +++ b/managed/services/agents/postgresql.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/postgresql_test.go b/managed/services/agents/postgresql_test.go index 0e0131f3d9..312fa86757 100644 --- a/managed/services/agents/postgresql_test.go +++ b/managed/services/agents/postgresql_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/proxysql.go b/managed/services/agents/proxysql.go index cccec78944..94eb9694f7 100644 --- a/managed/services/agents/proxysql.go +++ b/managed/services/agents/proxysql.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/proxysql_test.go b/managed/services/agents/proxysql_test.go index ce4ee0ae0b..afcac95b5e 100644 --- a/managed/services/agents/proxysql_test.go +++ b/managed/services/agents/proxysql_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/rds.go b/managed/services/agents/rds.go index b882a30cc3..6f255f3e6b 100644 --- a/managed/services/agents/rds.go +++ b/managed/services/agents/rds.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/rds_test.go b/managed/services/agents/rds_test.go index 5cbf6d133f..52b4c6ebc3 100644 --- a/managed/services/agents/rds_test.go +++ b/managed/services/agents/rds_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/registry.go b/managed/services/agents/registry.go index f7ee0c7f9c..9f381c8ed8 100644 --- a/managed/services/agents/registry.go +++ b/managed/services/agents/registry.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -32,7 +32,7 @@ import ( "github.com/percona/pmm/api/agentpb" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services/agents/channel" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" "github.com/percona/pmm/version" ) @@ -85,10 +85,12 @@ type Registry struct { mRoundTrip prom.Summary mClockDrift prom.Summary mAgents prom.GaugeFunc + + isExternalVM bool } // NewRegistry creates a new registry with given database connection. -func NewRegistry(db *reform.DB) *Registry { +func NewRegistry(db *reform.DB, externalVMChecker victoriaMetricsParams) *Registry { agents := make(map[string]*pmmAgentInfo) r := &Registry{ db: db, @@ -123,6 +125,8 @@ func NewRegistry(db *reform.DB) *Registry { Help: "Clock drift.", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }), + + isExternalVM: externalVMChecker.ExternalVM(), } r.mAgents = prom.NewGaugeFunc(prom.GaugeOpts{ @@ -160,7 +164,7 @@ func (r *Registry) register(stream agentpb.Agent_ConnectServer) (*pmmAgentInfo, } var node *models.Node err = r.db.InTransaction(func(tx *reform.TX) error { - node, err = authenticate(agentMD, tx.Querier) + node, err = r.authenticate(agentMD, tx.Querier) if err != nil { return err } @@ -204,7 +208,7 @@ func (r *Registry) register(stream agentpb.Agent_ConnectServer) (*pmmAgentInfo, return agent, nil } -func authenticate(md *agentpb.AgentConnectMetadata, q *reform.Querier) (*models.Node, error) { +func (r *Registry) authenticate(md *agentpb.AgentConnectMetadata, q *reform.Querier) (*models.Node, error) { if md.ID == "" { return nil, status.Error(codes.PermissionDenied, "Empty Agent ID.") } @@ -233,7 +237,7 @@ func authenticate(md *agentpb.AgentConnectMetadata, q *reform.Querier) (*models. return nil, status.Errorf(codes.InvalidArgument, "Can't parse 'version' for pmm-agent with ID %q.", md.ID) } - if err := addOrRemoveVMAgent(q, md.ID, runsOnNodeID, agentVersion); err != nil { + if err := r.addOrRemoveVMAgent(q, md.ID, runsOnNodeID, agentVersion); err != nil { return nil, err } @@ -296,18 +300,18 @@ func (r *Registry) ping(ctx context.Context, agent *pmmAgentInfo) error { // addOrRemoveVMAgent - creates vmAgent agentType if pmm-agent's version supports it and agent not exists yet, // otherwise ensures that vmAgent not exist for pmm-agent and pmm-agent's agents don't have push_metrics mode, // removes it if needed. -func addOrRemoveVMAgent(q *reform.Querier, pmmAgentID, runsOnNodeID string, pmmAgentVersion *version.Parsed) error { +func (r *Registry) addOrRemoveVMAgent(q *reform.Querier, pmmAgentID, runsOnNodeID string, pmmAgentVersion *version.Parsed) error { if pmmAgentVersion.Less(models.PMMAgentWithPushMetricsSupport) { // ensure that vmagent not exists and agents dont have push_metrics. return removeVMAgentFromPMMAgent(q, pmmAgentID) } - return addVMAgentToPMMAgent(q, pmmAgentID, runsOnNodeID) + return r.addVMAgentToPMMAgent(q, pmmAgentID, runsOnNodeID) } -func addVMAgentToPMMAgent(q *reform.Querier, pmmAgentID, runsOnNodeID string) error { +func (r *Registry) addVMAgentToPMMAgent(q *reform.Querier, pmmAgentID, runsOnNodeID string) error { // TODO remove it after fix // https://jira.percona.com/browse/PMM-4420 - if runsOnNodeID == "pmm-server" { + if runsOnNodeID == "pmm-server" && !r.isExternalVM { return nil } vmAgentType := models.VMAgentType diff --git a/managed/services/agents/roster.go b/managed/services/agents/roster.go index 4eba720bf2..4747075933 100644 --- a/managed/services/agents/roster.go +++ b/managed/services/agents/roster.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/roster_test.go b/managed/services/agents/roster_test.go index fc6b339a8c..d3e94482bc 100644 --- a/managed/services/agents/roster_test.go +++ b/managed/services/agents/roster_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/state.go b/managed/services/agents/state.go index c081af9d99..1bf2dc043b 100644 --- a/managed/services/agents/state.go +++ b/managed/services/agents/state.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -28,7 +28,7 @@ import ( "github.com/percona/pmm/api/agentpb" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" "github.com/percona/pmm/version" ) @@ -40,17 +40,19 @@ const ( // StateUpdater handles updating status of agents. type StateUpdater struct { - db *reform.DB - r *Registry - vmdb prometheusService + db *reform.DB + r *Registry + vmdb prometheusService + vmParams victoriaMetricsParams } // NewStateUpdater creates new agent state updater. -func NewStateUpdater(db *reform.DB, r *Registry, vmdb prometheusService) *StateUpdater { +func NewStateUpdater(db *reform.DB, r *Registry, vmdb prometheusService, vmParams victoriaMetricsParams) *StateUpdater { return &StateUpdater{ - db: db, - r: r, - vmdb: vmdb, + db: db, + r: r, + vmdb: vmdb, + vmParams: vmParams, } } @@ -180,7 +182,7 @@ func (u *StateUpdater) sendSetStateRequest(ctx context.Context, agent *pmmAgentI if err != nil { return errors.Wrapf(err, "cannot get agent scrape config for agent: %s", agent.id) } - agentProcesses[row.AgentID] = vmAgentConfig(string(scrapeCfg)) + agentProcesses[row.AgentID] = vmAgentConfig(string(scrapeCfg), u.vmParams) case models.NodeExporterType: node, err := models.FindNodeByID(u.db.Querier, pointer.GetString(row.NodeID)) diff --git a/managed/services/agents/versioner.go b/managed/services/agents/versioner.go index d91709128f..ae1bff828a 100644 --- a/managed/services/agents/versioner.go +++ b/managed/services/agents/versioner.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/versioner_test.go b/managed/services/agents/versioner_test.go index 53e1cc0b53..1135d44729 100644 --- a/managed/services/agents/versioner_test.go +++ b/managed/services/agents/versioner_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/agents/vmagent.go b/managed/services/agents/vmagent.go index f12d345d36..b13bfc9876 100644 --- a/managed/services/agents/vmagent.go +++ b/managed/services/agents/vmagent.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -16,8 +16,10 @@ package agents import ( + "fmt" "os" "sort" + "strings" "github.com/percona/pmm/api/agentpb" "github.com/percona/pmm/api/inventorypb" @@ -30,7 +32,11 @@ var ( ) // vmAgentConfig returns desired configuration of vmagent process. -func vmAgentConfig(scrapeCfg string) *agentpb.SetStateRequest_AgentProcess { +func vmAgentConfig(scrapeCfg string, params victoriaMetricsParams) *agentpb.SetStateRequest_AgentProcess { + serverURL := "{{.server_url}}/victoriametrics/" + if params.ExternalVM() { + serverURL = params.URL() + } maxScrapeSize := maxScrapeSizeDefault if space := os.Getenv(maxScrapeSizeEnv); space != "" { maxScrapeSize = space @@ -39,7 +45,7 @@ func vmAgentConfig(scrapeCfg string) *agentpb.SetStateRequest_AgentProcess { interfaceToBind := envvars.GetInterfaceToBind() args := []string{ - "-remoteWrite.url={{.server_url}}/victoriametrics/api/v1/write", + fmt.Sprintf("-remoteWrite.url=%sapi/v1/write", serverURL), "-remoteWrite.tlsInsecureSkipVerify={{.server_insecure}}", "-remoteWrite.tmpDataPath={{.tmp_dir}}/vmagent-temp-dir", "-promscrape.config={{.TextFiles.vmagentscrapecfg}}", @@ -50,13 +56,22 @@ func vmAgentConfig(scrapeCfg string) *agentpb.SetStateRequest_AgentProcess { "-httpListenAddr=" + interfaceToBind + ":{{.listen_port}}", // needed for login/password at client side. "-envflag.enable=true", + "-envflag.prefix=VMAGENT_", } sort.Strings(args) - envs := []string{ - "remoteWrite_basicAuth_username={{.server_username}}", - "remoteWrite_basicAuth_password={{.server_password}}", + var envs []string + if !params.ExternalVM() { + envs = []string{ + "VMAGENT_remoteWrite_basicAuth_username={{.server_username}}", + "VMAGENT_remoteWrite_basicAuth_password={{.server_password}}", + } + } + for _, env := range os.Environ() { + if strings.HasPrefix(env, envvars.ENVvmAgentPrefix) { + envs = append(envs, env) + } } sort.Strings(envs) diff --git a/managed/services/agents/vmagent_test.go b/managed/services/agents/vmagent_test.go index 2adc5fded8..a7bce4b3d6 100644 --- a/managed/services/agents/vmagent_test.go +++ b/managed/services/agents/vmagent_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -19,17 +19,43 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/percona/pmm/managed/models" ) func TestMaxScrapeSize(t *testing.T) { t.Run("by default 64MiB", func(t *testing.T) { - actual := vmAgentConfig("") + params, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, models.VMBaseURL) + require.NoError(t, err) + actual := vmAgentConfig("", params) assert.Contains(t, actual.Args, "-promscrape.maxScrapeSize="+maxScrapeSizeDefault) }) t.Run("overridden with ENV", func(t *testing.T) { + params, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, models.VMBaseURL) + require.NoError(t, err) newValue := "16MiB" t.Setenv(maxScrapeSizeEnv, newValue) - actual := vmAgentConfig("") + actual := vmAgentConfig("", params) assert.Contains(t, actual.Args, "-promscrape.maxScrapeSize="+newValue) }) + t.Run("VMAGENT_ ENV variables", func(t *testing.T) { + params, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, models.VMBaseURL) + require.NoError(t, err) + t.Setenv("VMAGENT_promscrape_maxScrapeSize", "16MiB") + t.Setenv("VM_remoteWrite_basicAuth_password", "password") + actual := vmAgentConfig("", params) + assert.Contains(t, actual.Env, "VMAGENT_promscrape_maxScrapeSize=16MiB") + assert.Contains(t, actual.Env, "VMAGENT_remoteWrite_basicAuth_username={{.server_username}}") + assert.NotContains(t, actual.Env, "VM_remoteWrite_basicAuth_password=password") + }) + t.Run("External Victoria Metrics ENV variables", func(t *testing.T) { + params, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, "http://victoriametrics:8428") + require.NoError(t, err) + t.Setenv("VMAGENT_promscrape_maxScrapeSize", "16MiB") + actual := vmAgentConfig("", params) + assert.Contains(t, actual.Args, "-remoteWrite.url=http://victoriametrics:8428/api/v1/write") + assert.Contains(t, actual.Env, "VMAGENT_promscrape_maxScrapeSize=16MiB") + assert.NotContains(t, actual.Env, "VMAGENT_remoteWrite_basicAuth_username={{.server_username}}") + }) } diff --git a/managed/services/alert_rule.go b/managed/services/alert_rule.go index 563aa2dc5f..8c6517957a 100644 --- a/managed/services/alert_rule.go +++ b/managed/services/alert_rule.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/alertmanager/alertmanager.go b/managed/services/alertmanager/alertmanager.go index 12cf00aede..37027a72c8 100644 --- a/managed/services/alertmanager/alertmanager.go +++ b/managed/services/alertmanager/alertmanager.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/alertmanager/alertmanager_test.go b/managed/services/alertmanager/alertmanager_test.go index 9fe0e5ecd3..0ad493e571 100644 --- a/managed/services/alertmanager/alertmanager_test.go +++ b/managed/services/alertmanager/alertmanager_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/backup/backup_service.go b/managed/services/backup/backup_service.go index 07a59a37ae..2e730b366b 100644 --- a/managed/services/backup/backup_service.go +++ b/managed/services/backup/backup_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -93,6 +93,10 @@ func (s *Service) PerformBackup(ctx context.Context, params PerformBackupParams) errTX = s.db.InTransactionContext(ctx, &sql.TxOptions{Isolation: sql.LevelSerializable}, func(tx *reform.TX) error { var err error + if err = services.CheckArtifactOverlapping(tx.Querier, params.ServiceID, params.LocationID, params.Folder); err != nil { + return err + } + svc, err = models.FindServiceByID(tx.Querier, params.ServiceID) if err != nil { return err @@ -603,7 +607,7 @@ func checkArtifactMode(artifact *models.Artifact, pitrTimestamp time.Time) error return nil } -// inTimeSpan checks whether given time is in the given range +// inTimeSpan checks whether given time is in the given range. func inTimeSpan(start, end, check time.Time) bool { if start.Before(end) { return !check.Before(start) && !check.After(end) diff --git a/managed/services/backup/backup_service_test.go b/managed/services/backup/backup_service_test.go index 0afeff434e..1b5d80801f 100644 --- a/managed/services/backup/backup_service_test.go +++ b/managed/services/backup/backup_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -81,8 +81,6 @@ func TestPerformBackup(t *testing.T) { mockedCompatibilityService := &mockCompatibilityService{} backupService := NewService(db, mockedJobsService, mockedAgentService, mockedCompatibilityService, nil) - artifactFolder := "artifact_folder" - s3Location, err := models.CreateBackupLocation(db.Querier, models.CreateBackupLocationParams{ Name: "Test s3 location", Description: "Test s3 description", @@ -164,7 +162,7 @@ func TestPerformBackup(t *testing.T) { S3Config: tc.locationModel.S3Config, } mockedJobsService.On("StartMySQLBackupJob", mock.Anything, pointer.GetString(agent.PMMAgentID), time.Duration(0), - mock.Anything, mock.Anything, locationConfig, artifactFolder).Return(nil).Once() + mock.Anything, mock.Anything, locationConfig, "artifact_folder").Return(nil).Once() } artifactID, err := backupService.PerformBackup(ctx, PerformBackupParams{ @@ -173,7 +171,7 @@ func TestPerformBackup(t *testing.T) { Name: tc.name + "_" + "test_backup", DataModel: tc.dataModel, Mode: models.Snapshot, - Folder: artifactFolder, + Folder: "artifact_folder", }) if tc.expectedError != nil { @@ -204,7 +202,7 @@ func TestPerformBackup(t *testing.T) { Name: "test_backup", DataModel: models.PhysicalDataModel, Mode: models.PITR, - Folder: artifactFolder, + Folder: "artifact_folder_2", }) assert.ErrorIs(t, err, ErrIncompatibleDataModel) assert.Empty(t, artifactID) @@ -218,7 +216,7 @@ func TestPerformBackup(t *testing.T) { Name: "test_backup", DataModel: models.PhysicalDataModel, Mode: models.PITR, - Folder: artifactFolder, + Folder: "artifact_folder_3", }) assert.ErrorContains(t, err, "Empty Service ID") assert.Empty(t, artifactID) @@ -233,7 +231,7 @@ func TestPerformBackup(t *testing.T) { Name: "test_backup", DataModel: models.PhysicalDataModel, Mode: models.Incremental, - Folder: artifactFolder, + Folder: "artifact_folder_4", }) assert.ErrorContains(t, err, "the only supported backups mode for mongoDB is snapshot and PITR") assert.Empty(t, artifactID) diff --git a/managed/services/backup/compatibility_helpers.go b/managed/services/backup/compatibility_helpers.go index 299a4c68e7..94f0f18882 100644 --- a/managed/services/backup/compatibility_helpers.go +++ b/managed/services/backup/compatibility_helpers.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -221,10 +221,7 @@ func mongoDBBackupSoftwareInstalledAndCompatible(svm map[models.SoftwareName]str } // isOnlySameService checks if restore is only available to the same service. -func isOnlySameService(artifactDBVersion string, serviceType models.ServiceType) bool { - // allow restore to the same service if db version is unknown or service type is MongoDB. - if artifactDBVersion == "" || serviceType == models.MongoDBServiceType { - return true - } - return false +func isOnlySameService(artifactDBVersion string) bool { + // allow restore only to the same service if db version is unknown. + return artifactDBVersion == "" } diff --git a/managed/services/backup/compatibility_helpers_test.go b/managed/services/backup/compatibility_helpers_test.go index 7795d73187..9d5e975572 100644 --- a/managed/services/backup/compatibility_helpers_test.go +++ b/managed/services/backup/compatibility_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/backup/compatibility_service.go b/managed/services/backup/compatibility_service.go index af2536634d..1e6c70c3ba 100644 --- a/managed/services/backup/compatibility_service.go +++ b/managed/services/backup/compatibility_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -96,13 +96,29 @@ func (s *CompatibilityService) findCompatibleServiceIDs(artifactModel *models.Ar compatibleServiceIDs := make([]string, 0, len(svs)) for _, sv := range svs { svm := softwareVersionsToMap(sv.SoftwareVersions) + var ( + serviceDBVersion string + err error + ) - if err := mySQLBackupSoftwareInstalledAndCompatible(svm); err != nil { + switch artifactModel.Vendor { + case "mysql": + serviceDBVersion = svm[models.MysqldSoftwareName] + err = mySQLBackupSoftwareInstalledAndCompatible(svm) + + case "mongodb": + serviceDBVersion = svm[models.MongoDBSoftwareName] + err = mongoDBBackupSoftwareInstalledAndCompatible(svm) + + default: + return nil + } + + if err != nil { s.l.WithError(err).Debugf("skip incompatible service id %q", sv.ServiceID) continue } - serviceDBVersion := svm[models.MysqldSoftwareName] if artifactModel.DBVersion != serviceDBVersion { s.l.Debugf("skip incompatible service id %q: artifact version %q != db version %q\"", sv.ServiceID, artifactModel.DBVersion, serviceDBVersion) @@ -174,7 +190,7 @@ func (s *CompatibilityService) FindArtifactCompatibleServices( return err } - onlySameService := isOnlySameService(artifactModel.DBVersion, serviceType) + onlySameService := isOnlySameService(artifactModel.DBVersion) if onlySameService { service, err := models.FindServiceByID(tx.Querier, artifactModel.ServiceID) @@ -230,7 +246,7 @@ func (s *CompatibilityService) CheckArtifactCompatibility(artifactID, targetDBVe return s.artifactCompatibility(artifactModel, serviceModel, targetDBVersion) } -// artifactCompatibility contains logic for CheckArtifactCompatibility +// artifactCompatibility contains logic for CheckArtifactCompatibility. func (s *CompatibilityService) artifactCompatibility(artifactModel *models.Artifact, serviceModel *models.Service, targetDBVersion string) error { var err error if artifactModel.DBVersion != "" && artifactModel.DBVersion != targetDBVersion { diff --git a/managed/services/backup/compatibility_service_test.go b/managed/services/backup/compatibility_service_test.go index eb3724dba8..4859073fd8 100644 --- a/managed/services/backup/compatibility_service_test.go +++ b/managed/services/backup/compatibility_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -212,100 +212,162 @@ func TestFindCompatibleServiceIDs(t *testing.T) { t.Parallel() cSvc := NewCompatibilityService(nil, nil) - testSet := []*models.ServiceSoftwareVersions{ - { - ServiceID: "1", - SoftwareVersions: models.SoftwareVersions{ - {Name: models.MysqldSoftwareName, Version: ""}, - {Name: models.XtrabackupSoftwareName, Version: "8.0.25"}, - {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, - {Name: models.QpressSoftwareName, Version: "1.1"}, + t.Run("mysql", func(t *testing.T) { + testSet := []*models.ServiceSoftwareVersions{ + { + ServiceID: "1", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MysqldSoftwareName, Version: ""}, + {Name: models.XtrabackupSoftwareName, Version: "8.0.25"}, + {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, + {Name: models.QpressSoftwareName, Version: "1.1"}, + }, }, - }, - { - ServiceID: "2", - SoftwareVersions: models.SoftwareVersions{ - {Name: models.MysqldSoftwareName, Version: "8.0.25"}, - {Name: models.XtrabackupSoftwareName, Version: "8.0.24"}, - {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, - {Name: models.QpressSoftwareName, Version: "1.1"}, + { + ServiceID: "2", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MysqldSoftwareName, Version: "8.0.25"}, + {Name: models.XtrabackupSoftwareName, Version: "8.0.24"}, + {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, + {Name: models.QpressSoftwareName, Version: "1.1"}, + }, }, - }, - { - ServiceID: "3", - SoftwareVersions: models.SoftwareVersions{ - {Name: models.MysqldSoftwareName, Version: "8.0.25"}, - {Name: models.XtrabackupSoftwareName, Version: "8.0.25"}, - {Name: models.XbcloudSoftwareName, Version: "8.0.24"}, - {Name: models.QpressSoftwareName, Version: "1.1"}, + { + ServiceID: "3", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MysqldSoftwareName, Version: "8.0.25"}, + {Name: models.XtrabackupSoftwareName, Version: "8.0.25"}, + {Name: models.XbcloudSoftwareName, Version: "8.0.24"}, + {Name: models.QpressSoftwareName, Version: "1.1"}, + }, }, - }, - { - ServiceID: "4", - SoftwareVersions: models.SoftwareVersions{ - {Name: models.MysqldSoftwareName, Version: "8.0.25"}, - {Name: models.XtrabackupSoftwareName, Version: "8.0.25"}, - {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, - {Name: models.QpressSoftwareName, Version: ""}, + { + ServiceID: "4", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MysqldSoftwareName, Version: "8.0.25"}, + {Name: models.XtrabackupSoftwareName, Version: "8.0.25"}, + {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, + {Name: models.QpressSoftwareName, Version: ""}, + }, }, - }, - { - ServiceID: "5", - SoftwareVersions: models.SoftwareVersions{ - {Name: models.MysqldSoftwareName, Version: "8.0.25"}, - {Name: models.XtrabackupSoftwareName, Version: "8.0.25"}, - {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, - {Name: models.QpressSoftwareName, Version: "1.1"}, + { + ServiceID: "5", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MysqldSoftwareName, Version: "8.0.25"}, + {Name: models.XtrabackupSoftwareName, Version: "8.0.25"}, + {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, + {Name: models.QpressSoftwareName, Version: "1.1"}, + }, }, - }, - { - ServiceID: "6", - SoftwareVersions: models.SoftwareVersions{ - {Name: models.MysqldSoftwareName, Version: "8.0.25"}, - {Name: models.XtrabackupSoftwareName, Version: ""}, - {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, - {Name: models.QpressSoftwareName, Version: "1.1"}, + { + ServiceID: "6", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MysqldSoftwareName, Version: "8.0.25"}, + {Name: models.XtrabackupSoftwareName, Version: ""}, + {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, + {Name: models.QpressSoftwareName, Version: "1.1"}, + }, }, - }, - { - ServiceID: "7", - SoftwareVersions: models.SoftwareVersions{ - {Name: models.MysqldSoftwareName, Version: "8.0.24"}, - {Name: models.XtrabackupSoftwareName, Version: "8.0.25"}, - {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, - {Name: models.QpressSoftwareName, Version: "1.1"}, + { + ServiceID: "7", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MysqldSoftwareName, Version: "8.0.24"}, + {Name: models.XtrabackupSoftwareName, Version: "8.0.25"}, + {Name: models.XbcloudSoftwareName, Version: "8.0.25"}, + {Name: models.QpressSoftwareName, Version: "1.1"}, + }, }, - }, - { - ServiceID: "8", - SoftwareVersions: models.SoftwareVersions{ - {Name: models.MysqldSoftwareName, Version: "8.0.25"}, - {Name: models.XtrabackupSoftwareName, Version: "8.0.26"}, - {Name: models.XbcloudSoftwareName, Version: "8.0.26"}, - {Name: models.QpressSoftwareName, Version: "1.1"}, + { + ServiceID: "8", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MysqldSoftwareName, Version: "8.0.25"}, + {Name: models.XtrabackupSoftwareName, Version: "8.0.26"}, + {Name: models.XbcloudSoftwareName, Version: "8.0.26"}, + {Name: models.QpressSoftwareName, Version: "1.1"}, + }, }, - }, - } + } - t.Run("empty db version", func(t *testing.T) { - t.Parallel() - res := cSvc.findCompatibleServiceIDs(&models.Artifact{DBVersion: ""}, testSet) - assert.Equal(t, 0, len(res)) - }) - t.Run("matches several", func(t *testing.T) { - t.Parallel() - res := cSvc.findCompatibleServiceIDs(&models.Artifact{DBVersion: "8.0.25"}, testSet) - assert.ElementsMatch(t, []string{"5", "8"}, res) - }) - t.Run("matches one", func(t *testing.T) { - t.Parallel() - res := cSvc.findCompatibleServiceIDs(&models.Artifact{DBVersion: "8.0.24"}, testSet) - assert.ElementsMatch(t, []string{"7"}, res) + t.Run("empty db version", func(t *testing.T) { + t.Parallel() + res := cSvc.findCompatibleServiceIDs(&models.Artifact{Vendor: "mysql", DBVersion: ""}, testSet) + assert.Equal(t, 0, len(res)) + }) + t.Run("matches several", func(t *testing.T) { + t.Parallel() + res := cSvc.findCompatibleServiceIDs(&models.Artifact{Vendor: "mysql", DBVersion: "8.0.25"}, testSet) + assert.ElementsMatch(t, []string{"5", "8"}, res) + }) + t.Run("matches one", func(t *testing.T) { + t.Parallel() + res := cSvc.findCompatibleServiceIDs(&models.Artifact{Vendor: "mysql", DBVersion: "8.0.24"}, testSet) + assert.ElementsMatch(t, []string{"7"}, res) + }) + t.Run("artifact version greater then existing services", func(t *testing.T) { + t.Parallel() + res := cSvc.findCompatibleServiceIDs(&models.Artifact{Vendor: "mysql", DBVersion: "8.0.30"}, testSet) + assert.Equal(t, 0, len(res)) + }) }) - t.Run("artifact version greater then existing services", func(t *testing.T) { - t.Parallel() - res := cSvc.findCompatibleServiceIDs(&models.Artifact{DBVersion: "8.0.30"}, testSet) - assert.Equal(t, 0, len(res)) + + t.Run("mongo", func(t *testing.T) { + testSet := []*models.ServiceSoftwareVersions{ + { + ServiceID: "1", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MongoDBSoftwareName, Version: ""}, + {Name: models.PBMSoftwareName, Version: "2.0.1"}, + }, + }, + { + ServiceID: "2", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MongoDBSoftwareName, Version: "6.0.5"}, + {Name: models.PBMSoftwareName, Version: "2.0.0"}, + }, + }, + { + ServiceID: "3", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MongoDBSoftwareName, Version: "6.0.5"}, + {Name: models.PBMSoftwareName, Version: ""}, + }, + }, + { + ServiceID: "4", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MongoDBSoftwareName, Version: "6.0.5"}, + {Name: models.PBMSoftwareName, Version: "2.0.1"}, + }, + }, + { + ServiceID: "5", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MongoDBSoftwareName, Version: "5.0.5"}, + {Name: models.PBMSoftwareName, Version: "2.0.5"}, + }, + }, + { + ServiceID: "6", + SoftwareVersions: models.SoftwareVersions{ + {Name: models.MongoDBSoftwareName, Version: "5.0.5"}, + {Name: models.PBMSoftwareName, Version: "2.0.5"}, + }, + }, + } + + t.Run("empty db version", func(t *testing.T) { + res := cSvc.findCompatibleServiceIDs(&models.Artifact{Vendor: "mongodb", DBVersion: ""}, testSet) + assert.Equal(t, 0, len(res)) + }) + t.Run("matches several", func(t *testing.T) { + res := cSvc.findCompatibleServiceIDs(&models.Artifact{Vendor: "mongodb", DBVersion: "5.0.5"}, testSet) + assert.ElementsMatch(t, []string{"5", "6"}, res) + }) + t.Run("matches one", func(t *testing.T) { + res := cSvc.findCompatibleServiceIDs(&models.Artifact{Vendor: "mongodb", DBVersion: "6.0.5"}, testSet) + assert.ElementsMatch(t, []string{"4"}, res) + }) }) } @@ -376,24 +438,6 @@ func TestFindArtifactCompatibleServices(t *testing.T) { errString: "", expectEmptyResult: false, }, - { - name: "non-mysql db vendor", - artifactIDToSearch: "test_artifact_id", - artifact: models.Artifact{ - ID: "test_artifact_id", - Name: " ", - Vendor: "mongodb", - DBVersion: "8.0.25", - LocationID: "test_location_id", - ServiceID: "test_service_id", - DataModel: " ", - Mode: " ", - Status: " ", - Type: " ", - }, - errString: "", - expectEmptyResult: false, - }, { name: "no software versions data for mysql", artifactIDToSearch: "test_artifact_id", diff --git a/managed/services/backup/deps.go b/managed/services/backup/deps.go index 86c0caf8a4..3ec7340976 100644 --- a/managed/services/backup/deps.go +++ b/managed/services/backup/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/backup/errors.go b/managed/services/backup/errors.go index f6b5d15c6b..4001dbba8e 100644 --- a/managed/services/backup/errors.go +++ b/managed/services/backup/errors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/backup/metrics.go b/managed/services/backup/metrics.go new file mode 100644 index 0000000000..1aa661deca --- /dev/null +++ b/managed/services/backup/metrics.go @@ -0,0 +1,113 @@ +// Copyright (C) 2023 Percona LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package backup + +import ( + "context" + "time" + + "github.com/pkg/errors" + prom "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" + "gopkg.in/reform.v1" + + "github.com/percona/pmm/managed/models" +) + +const ( + requestTimeout = 3 * time.Second + artifactExists float64 = 1 + prometheusNamespace = "pmm_managed" + prometheusSubsystem = "backups" +) + +type MetricsCollector struct { + db *reform.DB + l *logrus.Entry + + mArtifactsDesc *prom.Desc +} + +func NewMetricsCollector(db *reform.DB) *MetricsCollector { + return &MetricsCollector{ + db: db, + l: logrus.WithField("component", "backups/metrics"), + mArtifactsDesc: prom.NewDesc( + prom.BuildFQName(prometheusNamespace, prometheusSubsystem, "artifacts"), + "Artifacts", + []string{ + "artifact_id", "artifact_name", "artifact_vendor", "service_id", "service_name", + "type", "db_version", "data_model", "mode", "status", + }, + nil), + } +} + +func (c *MetricsCollector) Describe(ch chan<- *prom.Desc) { + ch <- c.mArtifactsDesc +} + +func (c *MetricsCollector) Collect(ch chan<- prom.Metric) { + ctx, cancelCtx := context.WithTimeout(context.Background(), requestTimeout) + defer cancelCtx() + + var artifacts []*models.Artifact + var services map[string]*models.Service + errTx := c.db.InTransactionContext(ctx, nil, func(t *reform.TX) error { + var err error + artifacts, err = models.FindArtifacts(t.Querier, models.ArtifactFilters{}) + if err != nil { + return errors.WithStack(err) + } + + serviceIDs := make([]string, 0, len(artifacts)) + for _, artifact := range artifacts { + serviceIDs = append(serviceIDs, artifact.ServiceID) + } + + services, err = models.FindServicesByIDs(t.Querier, serviceIDs) + if err != nil { + return errors.WithStack(err) + } + return nil + }) + if errTx != nil { + c.l.Warnf("Failed to get artifacts: %v", errTx) + return + } + + for _, artifact := range artifacts { + var serviceName string + if service, ok := services[artifact.ServiceID]; ok { + serviceName = service.ServiceName + } + + ch <- prom.MustNewConstMetric( + c.mArtifactsDesc, + prom.GaugeValue, + artifactExists, + artifact.ID, + artifact.Name, + artifact.Vendor, + artifact.ServiceID, + serviceName, + string(artifact.Type), + artifact.DBVersion, + string(artifact.DataModel), + string(artifact.Mode), + string(artifact.Status)) + } +} diff --git a/managed/services/backup/mock_agent_service_test.go b/managed/services/backup/mock_agent_service_test.go index 3be56de1ac..88f28a59c4 100644 --- a/managed/services/backup/mock_agent_service_test.go +++ b/managed/services/backup/mock_agent_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/backup/mock_compatibility_service_test.go b/managed/services/backup/mock_compatibility_service_test.go index e0cf6b26df..ba208d718f 100644 --- a/managed/services/backup/mock_compatibility_service_test.go +++ b/managed/services/backup/mock_compatibility_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/backup/mock_jobs_service_test.go b/managed/services/backup/mock_jobs_service_test.go index b85845eb81..4aff8d72e6 100644 --- a/managed/services/backup/mock_jobs_service_test.go +++ b/managed/services/backup/mock_jobs_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/backup/mock_pbm_pitr_service_test.go b/managed/services/backup/mock_pbm_pitr_service_test.go index b9a9bd71dd..d39a3ebb15 100644 --- a/managed/services/backup/mock_pbm_pitr_service_test.go +++ b/managed/services/backup/mock_pbm_pitr_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/backup/mock_removal_service_test.go b/managed/services/backup/mock_removal_service_test.go index 8fcd7e6ef4..d21aff6858 100644 --- a/managed/services/backup/mock_removal_service_test.go +++ b/managed/services/backup/mock_removal_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/backup/mock_storage_test.go b/managed/services/backup/mock_storage_test.go index 699052bd20..cbd607a9b1 100644 --- a/managed/services/backup/mock_storage_test.go +++ b/managed/services/backup/mock_storage_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/backup/mock_versioner_test.go b/managed/services/backup/mock_versioner_test.go index 10830471f6..9f9f8d830e 100644 --- a/managed/services/backup/mock_versioner_test.go +++ b/managed/services/backup/mock_versioner_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/backup/pitr_timerange_service.go b/managed/services/backup/pitr_timerange_service.go index 8f691a7777..84050aa139 100644 --- a/managed/services/backup/pitr_timerange_service.go +++ b/managed/services/backup/pitr_timerange_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -37,7 +37,7 @@ const ( var errUnsupportedLocation = errors.New("unsupported location config") -// PBMPITRService helps to perform PITR chunks lookup in a backup storage +// PBMPITRService helps to perform PITR chunks lookup in a backup storage. type PBMPITRService struct { l *logrus.Entry } @@ -49,7 +49,7 @@ func NewPBMPITRService() *PBMPITRService { } } -// oplogChunk is index metadata for the oplog chunks +// oplogChunk is index metadata for the oplog chunks. type oplogChunk struct { RS string `bson:"rs"` FName string `bson:"fname"` @@ -59,7 +59,7 @@ type oplogChunk struct { size int64 `bson:"-"` } -// Timeline is an internal representation of a PITR Timeline +// Timeline is an internal representation of a PITR Timeline. type Timeline struct { ReplicaSet string `json:"replica_set"` Start uint32 `json:"start"` @@ -79,7 +79,7 @@ func (x gaps) Less(i, j int) bool { } func (x gaps) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -// compressionType is the type of compression used for PITR oplog +// compressionType is the type of compression used for PITR oplog. type compressionType string const ( @@ -91,7 +91,7 @@ const ( compressionTypeZstandard compressionType = "zstd" ) -// file return compression alg based on given file extension +// file return compression alg based on given file extension. func file(ext string) compressionType { switch ext { case "gz": @@ -190,7 +190,7 @@ func trimTimelines(timelines []Timeline) { // current format is 20200715155939-0.20200715160029-1.oplog.snappy // (https://github.com/percona/percona-backup-mongodb/wiki/PITR:-storage-layout) // -// !!! Should be agreed with pbm/pitr.chunkPath() +// !!! Should be agreed with pbm/pitr.chunkPath(). func pitrMetaFromFileName(prefix, f string) *oplogChunk { ppath := strings.Split(f, "/") if len(ppath) < 2 { @@ -251,7 +251,7 @@ func getTimelines(slices []*oplogChunk) []Timeline { var timelines []Timeline var prevEnd primitive.Timestamp for _, s := range slices { - if prevEnd.T != 0 && primitive.CompareTimestamp(prevEnd, s.StartTS) == -1 { + if prevEnd.T != 0 && prevEnd.Compare(s.StartTS) == -1 { timelines = append(timelines, tl) tl = Timeline{} } @@ -269,7 +269,7 @@ func getTimelines(slices []*oplogChunk) []Timeline { } // mergeTimelines merges overlapping sets on timelines -// it presumes timelines are sorted and don't start from 0 +// it presumes timelines are sorted and don't start from 0. func mergeTimelines(timelines ...[]Timeline) []Timeline { // fast paths if len(timelines) == 0 { diff --git a/managed/services/backup/pitr_timerange_service_test.go b/managed/services/backup/pitr_timerange_service_test.go index ed9765293b..4f7e3cbfee 100644 --- a/managed/services/backup/pitr_timerange_service_test.go +++ b/managed/services/backup/pitr_timerange_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/backup/removal_service.go b/managed/services/backup/removal_service.go index ae0733acdf..dff93e5cac 100644 --- a/managed/services/backup/removal_service.go +++ b/managed/services/backup/removal_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -91,18 +91,12 @@ func (s *RemovalService) DeleteArtifact(storage Storage, artifactID string, remo return } - service, err := models.FindServiceByID(s.db.Querier, artifact.ServiceID) - if err != nil { - s.l.WithError(err).Error("couldn't get service") - return - } - if err = s.deleteArtifactFiles(context.Background(), storage, location, artifact, len(artifact.MetadataList)); err != nil { s.l.WithError(err).Error("couldn't delete artifact files") return } - if service.ServiceType == models.MongoDBServiceType && artifact.Mode == models.PITR { + if artifact.Vendor == string(models.MongoDBServiceType) && artifact.Mode == models.PITR { if err = s.deleteArtifactPITRChunks(context.Background(), storage, location, artifact, nil); err != nil { s.l.WithError(err).Error("couldn't delete artifact PITR chunks") return diff --git a/managed/services/backup/removal_service_test.go b/managed/services/backup/removal_service_test.go index d88b35cb9e..b0f9b2dc13 100644 --- a/managed/services/backup/removal_service_test.go +++ b/managed/services/backup/removal_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -185,7 +185,7 @@ func TestDeleteArtifact(t *testing.T) { artifact, err := models.CreateArtifact(db.Querier, models.CreateArtifactParams{ Name: "artifact_name", - Vendor: "MongoDB", + Vendor: "mongodb", LocationID: locationRes.ID, ServiceID: *agent.ServiceID, DataModel: models.LogicalDataModel, diff --git a/managed/services/backup/retention_service.go b/managed/services/backup/retention_service.go index c46a56e1ec..562babc703 100644 --- a/managed/services/backup/retention_service.go +++ b/managed/services/backup/retention_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/backup/retention_service_test.go b/managed/services/backup/retention_service_test.go index 738729fb8f..66bc5fb4b0 100644 --- a/managed/services/backup/retention_service_test.go +++ b/managed/services/backup/retention_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/checks/checks.go b/managed/services/checks/checks.go index 72c915ed30..4a58993930 100644 --- a/managed/services/checks/checks.go +++ b/managed/services/checks/checks.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -33,7 +33,6 @@ import ( "time" "github.com/percona-platform/saas/pkg/check" - "github.com/percona-platform/saas/pkg/common" "github.com/pkg/errors" v1 "github.com/prometheus/client_golang/api/prometheus/v1" prom "github.com/prometheus/client_golang/prometheus" @@ -58,7 +57,6 @@ const ( // Environment variables that affect checks service; only for testing. envCheckFile = "PERCONA_TEST_CHECKS_FILE" - envResendInterval = "PERCONA_TEST_CHECKS_RESEND_INTERVAL" envDisableStartDelay = "PERCONA_TEST_CHECKS_DISABLE_START_DELAY" checkExecutionTimeout = 5 * time.Minute // limits execution time for every single check @@ -67,14 +65,9 @@ const ( scriptExecutionTimeout = 5 * time.Second // time limit for running pmm-managed-starlark resultCheckInterval = time.Second - // Sync with API tests. - resolveTimeoutFactor = 3 - defaultResendInterval = 2 * time.Second - prometheusNamespace = "pmm_managed" prometheusSubsystem = "advisor" - alertsPrefix = "/stt/" maxSupportedVersion = 2 ) @@ -91,17 +84,15 @@ var ( // Service is responsible for interactions with Percona Check service. type Service struct { - platformClient *platform.Client - agentsRegistry agentsRegistry - alertmanagerService alertmanagerService - db *reform.DB - alertsRegistry *registry - vmClient v1.API - clickhouseDB *sql.DB + platformClient *platform.Client + agentsRegistry agentsRegistry + db *reform.DB + alertsRegistry *registry + vmClient v1.API + clickhouseDB *sql.DB l *logrus.Entry startDelay time.Duration - resendInterval time.Duration platformPublicKeys []string localChecksFile string // For testing @@ -131,18 +122,11 @@ func New( db *reform.DB, platformClient *platform.Client, agentsRegistry agentsRegistry, - alertmanagerService alertmanagerService, vmClient v1.API, clickhouseDB *sql.DB, ) *Service { l := logrus.WithField("component", "checks") - resendInterval := defaultResendInterval - if d, err := time.ParseDuration(os.Getenv(envResendInterval)); err == nil && d > 0 { - l.Warnf("Interval changed to %s.", d) - resendInterval = d - } - var platformPublicKeys []string if k := envvars.GetPlatformPublicKeys(); k != nil { l.Warnf("Percona Platform public keys changed to %q.", k) @@ -150,17 +134,15 @@ func New( } s := &Service{ - db: db, - agentsRegistry: agentsRegistry, - alertmanagerService: alertmanagerService, - alertsRegistry: newRegistry(resolveTimeoutFactor * resendInterval), - vmClient: vmClient, - clickhouseDB: clickhouseDB, + db: db, + agentsRegistry: agentsRegistry, + alertsRegistry: newRegistry(), + vmClient: vmClient, + clickhouseDB: clickhouseDB, l: l, platformClient: platformClient, startDelay: defaultStartDelay, - resendInterval: resendInterval, platformPublicKeys: platformPublicKeys, localChecksFile: os.Getenv(envCheckFile), @@ -226,12 +208,6 @@ func (s *Service) Run(ctx context.Context) { var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - s.resendAlerts(ctx) - }() - wg.Add(1) go func() { defer wg.Done() @@ -241,23 +217,6 @@ func (s *Service) Run(ctx context.Context) { wg.Wait() } -// resendAlerts resends collected alerts until ctx is canceled. -func (s *Service) resendAlerts(ctx context.Context) { - t := time.NewTicker(s.resendInterval) - defer t.Stop() - - for { - s.alertmanagerService.SendAlerts(ctx, s.alertsRegistry.collect()) - - select { - case <-ctx.Done(): - return - case <-t.C: - // nothing, continue for loop - } - } -} - // runChecksLoop starts checks execution loop. func (s *Service) runChecksLoop(ctx context.Context) { // First checks run, start all checks from all groups. @@ -298,11 +257,11 @@ func (s *Service) GetSecurityCheckResults() ([]services.CheckResult, error) { return nil, services.ErrAdvisorsDisabled } - return s.alertsRegistry.getCheckResults(), nil + return s.alertsRegistry.getCheckResults(""), nil } // GetChecksResults returns the failed checks for a given service from AlertManager. -func (s *Service) GetChecksResults(ctx context.Context, serviceID string) ([]services.CheckResult, error) { +func (s *Service) GetChecksResults(_ context.Context, serviceID string) ([]services.CheckResult, error) { settings, err := models.GetSettings(s.db) if err != nil { return nil, err @@ -312,59 +271,7 @@ func (s *Service) GetChecksResults(ctx context.Context, serviceID string) ([]ser return nil, services.ErrAdvisorsDisabled } - filters := &services.FilterParams{ - IsCheck: true, - ServiceID: serviceID, - } - res, err := s.alertmanagerService.GetAlerts(ctx, filters) - if err != nil { - return nil, err - } - - checkResults := make([]services.CheckResult, 0, len(res)) - for _, alert := range res { - checkResults = append(checkResults, services.CheckResult{ - CheckName: alert.Labels[model.AlertNameLabel], - Silenced: len(alert.Status.SilencedBy) != 0, - AlertID: alert.Labels["alert_id"], - Interval: check.Interval(alert.Labels["interval_group"]), - Target: services.Target{ - AgentID: alert.Labels["agent_id"], - ServiceID: alert.Labels["service_id"], - ServiceName: alert.Labels["service_name"], - NodeName: alert.Labels["node_name"], - Labels: alert.Labels, - }, - Result: check.Result{ - Summary: alert.Annotations["summary"], - Description: alert.Annotations["description"], - ReadMoreURL: alert.Annotations["read_more_url"], - Severity: common.ParseSeverity(alert.Labels["severity"]), - Labels: alert.Labels, - }, - }) - } - return checkResults, nil -} - -// ToggleCheckAlert toggles the silence state of the check with the provided alertID. -func (s *Service) ToggleCheckAlert(ctx context.Context, alertID string, silence bool) error { - filters := &services.FilterParams{ - IsCheck: true, - AlertID: alertID, - } - res, err := s.alertmanagerService.GetAlerts(ctx, filters) - if err != nil { - return errors.Wrapf(err, "failed to get alerts with id: %s", alertID) - } - - if silence { - err = s.alertmanagerService.SilenceAlerts(ctx, res) - } else { - err = s.alertmanagerService.UnsilenceAlerts(ctx, res) - } - - return err + return s.alertsRegistry.getCheckResults(serviceID), nil } // runChecksGroup downloads and executes Advisors checks that should run in the interval specified by intervalGroup. @@ -411,11 +318,24 @@ func (s *Service) run(ctx context.Context, intervalGroup check.Interval, checkNa return errors.WithStack(err) } - if err := s.executeChecks(ctx, intervalGroup, checkNames); err != nil { + res, err := s.executeChecks(ctx, intervalGroup, checkNames) + if err != nil { return errors.WithStack(err) } - s.alertmanagerService.SendAlerts(ctx, s.alertsRegistry.collect()) + switch { + case len(checkNames) != 0: + // If we run some specific checks, delete previous results for them. + s.alertsRegistry.deleteByName(checkNames) + case intervalGroup != "": + // If we run whole interval group, delete previous results for that group. + s.alertsRegistry.deleteByInterval(intervalGroup) + default: + // If we run all checks, delete all previous results. + s.alertsRegistry.cleanup() + } + + s.alertsRegistry.set(res) return nil } @@ -706,46 +626,32 @@ func (s *Service) filterChecks(checks map[string]check.Check, group check.Interv // executeChecks runs checks for all reachable services. If intervalGroup specified only checks from that group will be // executed. If checkNames specified then only matched checks will be executed. -func (s *Service) executeChecks(ctx context.Context, intervalGroup check.Interval, checkNames []string) error { +func (s *Service) executeChecks(ctx context.Context, intervalGroup check.Interval, checkNames []string) ([]services.CheckResult, error) { disabledChecks, err := s.GetDisabledChecks() if err != nil { - return errors.WithStack(err) + return nil, errors.WithStack(err) } - var checkResults []services.CheckResult + var res []services.CheckResult checks, err := s.GetChecks() if err != nil { - return errors.WithStack(err) + return nil, errors.WithStack(err) } - mySQLChecks, postgreSQLChecks, mongoDBChecks := services.GroupChecksByDB(s.l, checks) + mySQLChecks, postgreSQLChecks, mongoDBChecks := groupChecksByDB(s.l, checks) mySQLChecks = s.filterChecks(mySQLChecks, intervalGroup, disabledChecks, checkNames) mySQLCheckResults := s.executeChecksForTargetType(ctx, models.MySQLServiceType, mySQLChecks) - checkResults = append(checkResults, mySQLCheckResults...) + res = append(res, mySQLCheckResults...) postgreSQLChecks = s.filterChecks(postgreSQLChecks, intervalGroup, disabledChecks, checkNames) postgreSQLCheckResults := s.executeChecksForTargetType(ctx, models.PostgreSQLServiceType, postgreSQLChecks) - checkResults = append(checkResults, postgreSQLCheckResults...) + res = append(res, postgreSQLCheckResults...) mongoDBChecks = s.filterChecks(mongoDBChecks, intervalGroup, disabledChecks, checkNames) mongoDBCheckResults := s.executeChecksForTargetType(ctx, models.MongoDBServiceType, mongoDBChecks) - checkResults = append(checkResults, mongoDBCheckResults...) + res = append(res, mongoDBCheckResults...) - switch { - case len(checkNames) != 0: - // If we run some specific checks, delete previous results for them. - s.alertsRegistry.deleteByName(checkNames) - case intervalGroup != "": - // If we run whole interval group, delete previous results for that group. - s.alertsRegistry.deleteByInterval(intervalGroup) - default: - // If we run all checks, delete all previous results. - s.alertsRegistry.cleanup() - } - - s.alertsRegistry.set(checkResults) - - return nil + return res, nil } func (s *Service) executeChecksForTargetType(ctx context.Context, serviceType models.ServiceType, checks map[string]check.Check) []services.CheckResult { @@ -767,8 +673,10 @@ func (s *Service) executeChecksForTargetType(ctx context.Context, serviceType mo s.mChecksExecuted.WithLabelValues(string(target.ServiceType), c.Advisor, c.Name, "error").Inc() continue } - s.mChecksExecuted.WithLabelValues(string(target.ServiceType), c.Advisor, c.Name, "ok").Inc() + res = append(res, results...) + + s.mChecksExecuted.WithLabelValues(string(target.ServiceType), c.Advisor, c.Name, "ok").Inc() } } @@ -1689,7 +1597,7 @@ func (s *Service) refreshChecksInMemoryMetric() { return } s.mChecksAvailable.Reset() - mySQLChecks, postgreSQLChecks, mongoDBChecks := services.GroupChecksByDB(s.l, checks) + mySQLChecks, postgreSQLChecks, mongoDBChecks := groupChecksByDB(s.l, checks) s.incChecksInMemoryMetric(models.MySQLServiceType, mySQLChecks) s.incChecksInMemoryMetric(models.PostgreSQLServiceType, postgreSQLChecks) s.incChecksInMemoryMetric(models.MongoDBServiceType, mongoDBChecks) @@ -1701,6 +1609,27 @@ func (s *Service) incChecksInMemoryMetric(serviceType models.ServiceType, checks } } +// groupChecksByDB splits provided checks by database and returns three slices: for MySQL, for PostgreSQL and for MongoDB. +func groupChecksByDB(l *logrus.Entry, checks map[string]check.Check) (mySQLChecks, postgreSQLChecks, mongoDBChecks map[string]check.Check) { //nolint:nonamedreturns + mySQLChecks = make(map[string]check.Check) + postgreSQLChecks = make(map[string]check.Check) + mongoDBChecks = make(map[string]check.Check) + for _, c := range checks { + switch c.GetFamily() { + case check.MySQL: + mySQLChecks[c.Name] = c + case check.PostgreSQL: + postgreSQLChecks[c.Name] = c + case check.MongoDB: + mongoDBChecks[c.Name] = c + default: + l.Warnf("Unknown check family %s, will be skipped.", c.Family) + } + } + + return +} + // check interfaces. var ( _ prom.Collector = (*Service)(nil) diff --git a/managed/services/checks/checks_test.go b/managed/services/checks/checks_test.go index 4803f47e37..b38f0b1d4e 100644 --- a/managed/services/checks/checks_test.go +++ b/managed/services/checks/checks_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -28,14 +28,12 @@ import ( "github.com/percona-platform/saas/pkg/common" metrics "github.com/prometheus/client_golang/api" v1 "github.com/prometheus/client_golang/api/prometheus/v1" - "github.com/prometheus/common/model" + "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "gopkg.in/reform.v1" "gopkg.in/reform.v1/dialects/postgresql" - "github.com/percona/pmm/api/alertmanager/ammodels" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services" "github.com/percona/pmm/managed/utils/platform" @@ -71,7 +69,7 @@ func TestDownloadAdvisors(t *testing.T) { platformClient, err := platform.NewClient(db, devPlatformAddress) require.NoError(t, err) - s := New(db, platformClient, nil, nil, vmClient, clickhouseDB) + s := New(db, platformClient, nil, vmClient, clickhouseDB) s.platformPublicKeys = []string{devPlatformPublicKey} require.NoError(t, err) @@ -120,7 +118,7 @@ func TestDownloadAdvisors(t *testing.T) { } func TestLoadLocalChecks(t *testing.T) { - s := New(nil, nil, nil, nil, vmClient, clickhouseDB) + s := New(nil, nil, nil, vmClient, clickhouseDB) checks, err := s.loadLocalChecks(testChecksFile) require.NoError(t, err) @@ -166,7 +164,7 @@ func TestCollectAdvisors(t *testing.T) { require.NoError(t, err) t.Run("collect local checks", func(t *testing.T) { - s := New(db, platformClient, nil, nil, vmClient, clickhouseDB) + s := New(db, platformClient, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -197,7 +195,7 @@ func TestCollectAdvisors(t *testing.T) { }) t.Run("download checks", func(t *testing.T) { - s := New(db, platformClient, nil, nil, vmClient, clickhouseDB) + s := New(db, platformClient, nil, vmClient, clickhouseDB) s.platformPublicKeys = []string{devPlatformPublicKey} s.CollectAdvisors(context.Background()) @@ -230,7 +228,7 @@ func TestDisableChecks(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -259,7 +257,7 @@ func TestDisableChecks(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -291,7 +289,7 @@ func TestDisableChecks(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -314,7 +312,7 @@ func TestEnableChecks(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -340,8 +338,6 @@ func TestEnableChecks(t *testing.T) { func TestChangeInterval(t *testing.T) { t.Run("normal", func(t *testing.T) { - var ams mockAlertmanagerService - ams.On("SendAlerts", mock.Anything, mock.Anything).Return() sqlDB := testdb.Open(t, models.SkipFixtures, nil) t.Cleanup(func() { require.NoError(t, sqlDB.Close()) @@ -349,7 +345,7 @@ func TestChangeInterval(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - s := New(db, nil, nil, &ams, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -394,7 +390,7 @@ func TestGetSecurityCheckResults(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) t.Run("STT enabled", func(t *testing.T) { - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) results, err := s.GetSecurityCheckResults() assert.Empty(t, results) @@ -402,7 +398,7 @@ func TestGetSecurityCheckResults(t *testing.T) { }) t.Run("STT disabled", func(t *testing.T) { - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) settings, err := models.GetSettings(db) require.NoError(t, err) @@ -427,7 +423,7 @@ func TestStartChecks(t *testing.T) { setupClients(t) t.Run("unknown interval", func(t *testing.T) { - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile err := s.runChecksGroup(context.Background(), check.Interval("unknown")) @@ -435,10 +431,7 @@ func TestStartChecks(t *testing.T) { }) t.Run("stt enabled", func(t *testing.T) { - var ams mockAlertmanagerService - ams.On("SendAlerts", mock.Anything, mock.Anything).Return() - - s := New(db, nil, nil, &ams, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) s.localChecksFile = testChecksFile s.CollectAdvisors(context.Background()) @@ -450,7 +443,7 @@ func TestStartChecks(t *testing.T) { }) t.Run("stt disabled", func(t *testing.T) { - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) settings, err := models.GetSettings(db) require.NoError(t, err) @@ -540,7 +533,7 @@ func TestFilterChecks(t *testing.T) { partiallyValidAdvisor.Checks = partiallyValidAdvisor.Checks[0:1] // remove invalid check expected := append(valid, partiallyValidAdvisor) //nolint:gocritic - s := New(nil, nil, nil, nil, vmClient, clickhouseDB) + s := New(nil, nil, nil, vmClient, clickhouseDB) actual := s.filterSupportedChecks(checks) assert.ElementsMatch(t, expected, actual) } @@ -565,7 +558,7 @@ func TestMinPMMAgents(t *testing.T) { {name: "PostgreSQL Family", minVersion: pmmAgent2_6_0, check: check.Check{Version: 2, Queries: []check.Query{{Type: check.PostgreSQLShow}, {Type: check.PostgreSQLSelect}}}}, } - s := New(nil, nil, nil, nil, vmClient, clickhouseDB) + s := New(nil, nil, nil, vmClient, clickhouseDB) for _, test := range tests { test := test @@ -626,7 +619,7 @@ func TestFindTargets(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - s := New(db, nil, nil, nil, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) t.Run("unknown service", func(t *testing.T) { t.Parallel() @@ -679,7 +672,7 @@ func TestFindTargets(t *testing.T) { func TestFilterChecksByInterval(t *testing.T) { t.Parallel() - s := New(nil, nil, nil, nil, vmClient, clickhouseDB) + s := New(nil, nil, nil, vmClient, clickhouseDB) rareCheck := check.Check{Name: "rareCheck", Interval: check.Rare} standardCheck := check.Check{Name: "standardCheck", Interval: check.Standard} @@ -712,11 +705,7 @@ func TestGetFailedChecks(t *testing.T) { db := reform.NewDB(sqlDB, postgresql.Dialect, nil) t.Run("no failed check for service", func(t *testing.T) { - var ams mockAlertmanagerService - ctx := context.Background() - ams.On("GetAlerts", ctx, mock.Anything).Return([]*ammodels.GettableAlert{}, nil) - - s := New(db, nil, nil, &ams, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) results, err := s.GetChecksResults(context.Background(), "test_svc") assert.Empty(t, results) @@ -724,65 +713,112 @@ func TestGetFailedChecks(t *testing.T) { }) t.Run("non empty failed checks", func(t *testing.T) { - alertLabels := map[string]string{ - model.AlertNameLabel: "test_check", - "alert_id": "test_alert", - "service_name": "test_svc", - "service_id": "/service_id/test_svc1", - "interval_group": "frequent", - "severity": common.Severity(4).String(), - } - - testAlert := ammodels.GettableAlert{ - Annotations: map[string]string{ - "summary": "Check summary", - "description": "Check description", - "read_more_url": "https://www.example.com", + checkResults := []services.CheckResult{ + { + CheckName: "test_check", + Interval: check.Frequent, + Target: services.Target{ + ServiceName: "test_svc1", + ServiceID: "/service_id/test_svc1", + Labels: map[string]string{ + "targetLabel": "targetLabelValue", + }, + }, + Result: check.Result{ + Summary: "Check summary", + Description: "Check description", + ReadMoreURL: "https://www.example.com", + Severity: common.Error, + Labels: map[string]string{ + "resultLabel": "reslutLabelValue", + }, + }, }, - Alert: ammodels.Alert{ - Labels: alertLabels, + { + CheckName: "test_check2", + Interval: check.Frequent, + Target: services.Target{ + ServiceName: "test_svc2", + ServiceID: "/service_id/test_svc2", + Labels: map[string]string{ + "targetLabel": "targetLabelValue", + }, + }, + Result: check.Result{ + Summary: "Check summary", + Description: "Check description", + ReadMoreURL: "https://www.example.com", + Severity: common.Error, + Labels: map[string]string{ + "resultLabel": "reslutLabelValue", + }, + }, }, - Status: &ammodels.AlertStatus{}, } - results := []services.CheckResult{ + s := New(db, nil, nil, vmClient, clickhouseDB) + s.alertsRegistry.set(checkResults) + + response, err := s.GetChecksResults(context.Background(), "") + require.NoError(t, err) + assert.ElementsMatch(t, checkResults, response) + }) + + t.Run("non empty failed checks for specific service", func(t *testing.T) { + checkResults := []services.CheckResult{ { CheckName: "test_check", - AlertID: "test_alert", - Silenced: false, Interval: check.Frequent, Target: services.Target{ - ServiceName: "test_svc", + ServiceName: "test_svc1", ServiceID: "/service_id/test_svc1", - Labels: alertLabels, + Labels: map[string]string{ + "targetLabel": "targetLabelValue", + }, + }, + Result: check.Result{ + Summary: "Check summary", + Description: "Check description", + ReadMoreURL: "https://www.example.com", + Severity: common.Error, + Labels: map[string]string{ + "resultLabel": "reslutLabelValue", + }, + }, + }, + { + CheckName: "test_check2", + Interval: check.Frequent, + Target: services.Target{ + ServiceName: "test_svc2", + ServiceID: "/service_id/test_svc2", + Labels: map[string]string{ + "targetLabel": "targetLabelValue", + }, }, Result: check.Result{ Summary: "Check summary", Description: "Check description", ReadMoreURL: "https://www.example.com", Severity: common.Error, - Labels: alertLabels, + Labels: map[string]string{ + "resultLabel": "reslutLabelValue", + }, }, }, } - ams := mockAlertmanagerService{} - ctx := context.Background() - ams.On("GetAlerts", ctx, mock.Anything).Return([]*ammodels.GettableAlert{&testAlert}, nil) + s := New(db, nil, nil, vmClient, clickhouseDB) + s.alertsRegistry.set(checkResults) - s := New(db, nil, nil, &ams, vmClient, clickhouseDB) - - response, err := s.GetChecksResults(ctx, "test_svc") + response, err := s.GetChecksResults(context.Background(), "/service_id/test_svc1") require.NoError(t, err) - assert.Equal(t, results, response) + require.Len(t, response, 1) + assert.Equal(t, checkResults[0], response[0]) }) t.Run("STT disabled", func(t *testing.T) { - ams := mockAlertmanagerService{} - ctx := context.Background() - ams.On("GetAlerts", ctx, mock.Anything).Return(nil, services.ErrAdvisorsDisabled) - - s := New(db, nil, nil, &ams, vmClient, clickhouseDB) + s := New(db, nil, nil, vmClient, clickhouseDB) settings, err := models.GetSettings(db) require.NoError(t, err) @@ -791,66 +827,12 @@ func TestGetFailedChecks(t *testing.T) { err = models.SaveSettings(db, settings) require.NoError(t, err) - results, err := s.GetChecksResults(ctx, "test_svc") + results, err := s.GetChecksResults(context.Background(), "test_svc") assert.Nil(t, results) assert.ErrorIs(t, err, services.ErrAdvisorsDisabled) }) } -func TestToggleCheckAlert(t *testing.T) { - t.Parallel() - - t.Run("silence alert", func(t *testing.T) { - t.Parallel() - - testAlert := &ammodels.GettableAlert{ - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "test_alert_1", - }, - }, - Status: &ammodels.AlertStatus{}, - } - - var ams mockAlertmanagerService - ctx := context.Background() - ams.On("GetAlerts", ctx, mock.Anything).Return([]*ammodels.GettableAlert{testAlert}, nil) - ams.On("SilenceAlerts", ctx, []*ammodels.GettableAlert{testAlert}).Return(nil) - - s := New(nil, nil, nil, &ams, vmClient, clickhouseDB) - - active := len(testAlert.Status.SilencedBy) == 0 - err := s.ToggleCheckAlert(ctx, "test_alert_1", active) - require.NoError(t, err) - ams.AssertCalled(t, "SilenceAlerts", ctx, []*ammodels.GettableAlert{testAlert}) - }) - - t.Run("unsilence alert", func(t *testing.T) { - t.Parallel() - - testAlert := &ammodels.GettableAlert{ - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "test_alert_2", - }, - }, - Status: &ammodels.AlertStatus{SilencedBy: []string{"test_silence"}}, - } - - var ams mockAlertmanagerService - ctx := context.Background() - ams.On("GetAlerts", ctx, mock.Anything).Return([]*ammodels.GettableAlert{testAlert}, nil) - ams.On("UnsilenceAlerts", ctx, []*ammodels.GettableAlert{testAlert}).Return(nil) - - s := New(nil, nil, nil, &ams, vmClient, clickhouseDB) - - active := len(testAlert.Status.SilencedBy) == 0 - err := s.ToggleCheckAlert(ctx, "test_alert_1", active) - require.NoError(t, err) - ams.AssertCalled(t, "UnsilenceAlerts", ctx, []*ammodels.GettableAlert{testAlert}) - }) -} - func TestFillQueryPlaceholders(t *testing.T) { t.Parallel() @@ -929,3 +911,50 @@ func TestFillQueryPlaceholders(t *testing.T) { }) } } + +func TestGroupChecksByDB(t *testing.T) { + t.Parallel() + + checks := map[string]check.Check{ + "MySQLShow": {Name: "MySQLShow", Version: 1, Type: check.MySQLShow}, + "MySQLSelect": {Name: "MySQLSelect", Version: 1, Type: check.MySQLSelect}, + "PostgreSQLShow": {Name: "PostgreSQLShow", Version: 1, Type: check.PostgreSQLShow}, + "PostgreSQLSelect": {Name: "PostgreSQLSelect", Version: 1, Type: check.PostgreSQLSelect}, + "MongoDBGetParameter": {Name: "MongoDBGetParameter", Version: 1, Type: check.MongoDBGetParameter}, + "MongoDBBuildInfo": {Name: "MongoDBBuildInfo", Version: 1, Type: check.MongoDBBuildInfo}, + "MongoDBGetCmdLineOpts": {Name: "MongoDBGetCmdLineOpts", Version: 1, Type: check.MongoDBGetCmdLineOpts}, + "MongoDBReplSetGetStatus": {Name: "MongoDBReplSetGetStatus", Version: 1, Type: check.MongoDBReplSetGetStatus}, + "MongoDBGetDiagnosticData": {Name: "MongoDBGetDiagnosticData", Version: 1, Type: check.MongoDBGetDiagnosticData}, + "unsupported type": {Name: "unsupported type", Version: 1, Type: check.Type("RedisInfo")}, + "missing type": {Name: "missing type", Version: 1}, + "MySQL family V2": {Name: "MySQL family V2", Version: 2, Family: check.MySQL}, + "PostgreSQL family V2": {Name: "PostgreSQL family V2", Version: 2, Family: check.PostgreSQL}, + "MongoDB family V2": {Name: "MongoDB family V2", Version: 2, Family: check.MongoDB}, + "missing family": {Name: "missing family", Version: 2}, + } + + l := logrus.WithField("component", "tests") + mySQLChecks, postgreSQLChecks, mongoDBChecks := groupChecksByDB(l, checks) + + require.Len(t, mySQLChecks, 3) + require.Len(t, postgreSQLChecks, 3) + require.Len(t, mongoDBChecks, 6) + + // V1 checks + assert.Equal(t, check.MySQLShow, mySQLChecks["MySQLShow"].Type) + assert.Equal(t, check.MySQLSelect, mySQLChecks["MySQLSelect"].Type) + + assert.Equal(t, check.PostgreSQLShow, postgreSQLChecks["PostgreSQLShow"].Type) + assert.Equal(t, check.PostgreSQLSelect, postgreSQLChecks["PostgreSQLSelect"].Type) + + assert.Equal(t, check.MongoDBGetParameter, mongoDBChecks["MongoDBGetParameter"].Type) + assert.Equal(t, check.MongoDBBuildInfo, mongoDBChecks["MongoDBBuildInfo"].Type) + assert.Equal(t, check.MongoDBGetCmdLineOpts, mongoDBChecks["MongoDBGetCmdLineOpts"].Type) + assert.Equal(t, check.MongoDBReplSetGetStatus, mongoDBChecks["MongoDBReplSetGetStatus"].Type) + assert.Equal(t, check.MongoDBGetDiagnosticData, mongoDBChecks["MongoDBGetDiagnosticData"].Type) + + // V2 checks + assert.Equal(t, check.MySQL, mySQLChecks["MySQL family V2"].Family) + assert.Equal(t, check.PostgreSQL, postgreSQLChecks["PostgreSQL family V2"].Family) + assert.Equal(t, check.MongoDB, mongoDBChecks["MongoDB family V2"].Family) +} diff --git a/managed/services/checks/deps.go b/managed/services/checks/deps.go index d4b3feeccb..8e9912ba16 100644 --- a/managed/services/checks/deps.go +++ b/managed/services/checks/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -18,13 +18,10 @@ package checks import ( "context" - "github.com/percona/pmm/api/alertmanager/ammodels" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services" ) //go:generate ../../../bin/mockery --name=agentsRegistry --case=snake --inpackage --testonly -//go:generate ../../../bin/mockery --name=alertmanagerService --case=snake --inpackage --testonly // agentsRegistry is a subset of methods of agents.Registry used by this package. // We use it instead of real type for testing and to avoid dependency cycle. @@ -39,12 +36,3 @@ type agentsRegistry interface { StartMongoDBQueryReplSetGetStatusAction(ctx context.Context, id, pmmAgentID, dsn string, files map[string]string, tdp *models.DelimiterPair) error StartMongoDBQueryGetDiagnosticDataAction(ctx context.Context, id, pmmAgentID, dsn string, files map[string]string, tdp *models.DelimiterPair) error } - -// alertmanagerService is a subset of methods of alertmanager.Service used by this package. -// We use it instead of real type for testing and to avoid dependency cycle. -type alertmanagerService interface { - SendAlerts(ctx context.Context, alerts ammodels.PostableAlerts) - SilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error - UnsilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error - GetAlerts(ctx context.Context, params *services.FilterParams) ([]*ammodels.GettableAlert, error) -} diff --git a/managed/services/checks/funcs.go b/managed/services/checks/funcs.go index 29927f4832..aa046777d5 100644 --- a/managed/services/checks/funcs.go +++ b/managed/services/checks/funcs.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/checks/funcs_test.go b/managed/services/checks/funcs_test.go index 2212e34e6f..2723d4e8c8 100644 --- a/managed/services/checks/funcs_test.go +++ b/managed/services/checks/funcs_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/checks/mock_agents_registry_test.go b/managed/services/checks/mock_agents_registry_test.go index 4783d9703e..e57b3fdfd5 100644 --- a/managed/services/checks/mock_agents_registry_test.go +++ b/managed/services/checks/mock_agents_registry_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package checks diff --git a/managed/services/checks/mock_alertmanager_service_test.go b/managed/services/checks/mock_alertmanager_service_test.go deleted file mode 100644 index 0b3c450ce2..0000000000 --- a/managed/services/checks/mock_alertmanager_service_test.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. - -package checks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - ammodels "github.com/percona/pmm/api/alertmanager/ammodels" - services "github.com/percona/pmm/managed/services" -) - -// mockAlertmanagerService is an autogenerated mock type for the alertmanagerService type -type mockAlertmanagerService struct { - mock.Mock -} - -// GetAlerts provides a mock function with given fields: ctx, params -func (_m *mockAlertmanagerService) GetAlerts(ctx context.Context, params *services.FilterParams) ([]*ammodels.GettableAlert, error) { - ret := _m.Called(ctx, params) - - var r0 []*ammodels.GettableAlert - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) ([]*ammodels.GettableAlert, error)); ok { - return rf(ctx, params) - } - if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) []*ammodels.GettableAlert); ok { - r0 = rf(ctx, params) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*ammodels.GettableAlert) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *services.FilterParams) error); ok { - r1 = rf(ctx, params) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SendAlerts provides a mock function with given fields: ctx, alerts -func (_m *mockAlertmanagerService) SendAlerts(ctx context.Context, alerts ammodels.PostableAlerts) { - _m.Called(ctx, alerts) -} - -// SilenceAlerts provides a mock function with given fields: ctx, alerts -func (_m *mockAlertmanagerService) SilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error { - ret := _m.Called(ctx, alerts) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []*ammodels.GettableAlert) error); ok { - r0 = rf(ctx, alerts) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UnsilenceAlerts provides a mock function with given fields: ctx, alerts -func (_m *mockAlertmanagerService) UnsilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error { - ret := _m.Called(ctx, alerts) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []*ammodels.GettableAlert) error); ok { - r0 = rf(ctx, alerts) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// newMockAlertmanagerService creates a new instance of mockAlertmanagerService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockAlertmanagerService(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockAlertmanagerService { - mock := &mockAlertmanagerService{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/checks/registry.go b/managed/services/checks/registry.go index b357de660a..1ccb42932c 100644 --- a/managed/services/checks/registry.go +++ b/managed/services/checks/registry.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -16,18 +16,11 @@ package checks import ( - "crypto/sha1" //nolint:gosec - "encoding/hex" - "fmt" "sync" - "time" - "github.com/go-openapi/strfmt" "github.com/percona-platform/saas/pkg/check" prom "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/model" - "github.com/percona/pmm/api/alertmanager/ammodels" "github.com/percona/pmm/managed/services" ) @@ -36,20 +29,13 @@ type registry struct { rw sync.RWMutex // Results stored grouped by interval and by check name. It allows us to remove results for specific group. checkResults map[check.Interval]map[string][]services.CheckResult - - alertTTL time.Duration - nowF func() time.Time // for tests - - mInsights *prom.GaugeVec + mInsights *prom.GaugeVec } // newRegistry creates a new registry. -func newRegistry(alertTTL time.Duration) *registry { +func newRegistry() *registry { return ®istry{ checkResults: make(map[check.Interval]map[string][]services.CheckResult), - alertTTL: alertTTL, - nowF: time.Now, - mInsights: prom.NewGaugeVec(prom.GaugeOpts{ Namespace: prometheusNamespace, Subsystem: prometheusSubsystem, @@ -105,70 +91,25 @@ func (r *registry) cleanup() { r.checkResults = make(map[check.Interval]map[string][]services.CheckResult) } -// collect returns a slice of alerts created from the stored check results. -func (r *registry) collect() ammodels.PostableAlerts { +// getCheckResults returns checks results for the given service. If serviceID is empty it returns results for all services. +func (r *registry) getCheckResults(serviceID string) []services.CheckResult { r.rw.RLock() defer r.rw.RUnlock() - var alerts ammodels.PostableAlerts + var results []services.CheckResult for _, intervalGroup := range r.checkResults { for _, checkNameGroup := range intervalGroup { for _, checkResult := range checkNameGroup { - checkResult := checkResult - alerts = append(alerts, r.createAlert(&checkResult)) + if serviceID == "" || checkResult.Target.ServiceID == serviceID { + results = append(results, checkResult) + } } } } - return alerts -} - -func (r *registry) getCheckResults() []services.CheckResult { - r.rw.RLock() - defer r.rw.RUnlock() - - var results []services.CheckResult - for _, intervalGroup := range r.checkResults { - for _, checkNameGroup := range intervalGroup { - results = append(results, checkNameGroup...) - } - } return results } -func (r *registry) createAlert(checkResult *services.CheckResult) *ammodels.PostableAlert { - name, target, result, alertTTL := checkResult.CheckName, &checkResult.Target, &checkResult.Result, r.alertTTL - labels := make(map[string]string, len(target.Labels)+len(result.Labels)+4) - annotations := make(map[string]string, 2) - for k, v := range result.Labels { - labels[k] = v - } - for k, v := range target.Labels { - labels[k] = v - } - - labels[model.AlertNameLabel] = name - checkResult.AlertID = makeID(target, result) - labels["severity"] = result.Severity.String() - labels["stt_check"] = "1" - labels["alert_id"] = checkResult.AlertID - labels["interval_group"] = string(checkResult.Interval) - - annotations["summary"] = result.Summary - annotations["description"] = result.Description - annotations["read_more_url"] = result.ReadMoreURL - - endsAt := r.nowF().Add(alertTTL).UTC().Round(0) // strip a monotonic clock reading - return &ammodels.PostableAlert{ - Alert: ammodels.Alert{ - // GeneratorURL: "TODO", - Labels: labels, - }, - EndsAt: strfmt.DateTime(endsAt), - Annotations: annotations, - } -} - // Describe implements prom.Collector. func (r *registry) Describe(ch chan<- *prom.Desc) { r.mInsights.Describe(ch) @@ -177,21 +118,9 @@ func (r *registry) Describe(ch chan<- *prom.Desc) { // Collect implements prom.Collector. func (r *registry) Collect(ch chan<- prom.Metric) { r.mInsights.Reset() - res := r.getCheckResults() + res := r.getCheckResults("") for _, re := range res { r.mInsights.WithLabelValues(string(re.Target.ServiceType), re.AdvisorName, re.CheckName).Inc() } r.mInsights.Collect(ch) } - -// makeID creates an ID for STT check alert. -func makeID(target *services.Target, result *check.Result) string { - s := sha1.New() //nolint:gosec - fmt.Fprintf(s, "%s\n", target.AgentID) - fmt.Fprintf(s, "%s\n", target.ServiceID) - fmt.Fprintf(s, "%s\n", result.Summary) - fmt.Fprintf(s, "%s\n", result.Description) - fmt.Fprintf(s, "%s\n", result.ReadMoreURL) - fmt.Fprintf(s, "%v\n", result.Severity) - return alertsPrefix + hex.EncodeToString(s.Sum(nil)) -} diff --git a/managed/services/checks/registry_test.go b/managed/services/checks/registry_test.go index 0b4ca97e9b..6ef6d1d26a 100644 --- a/managed/services/checks/registry_test.go +++ b/managed/services/checks/registry_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -17,25 +17,18 @@ package checks import ( "testing" - "time" - "github.com/go-openapi/strfmt" "github.com/percona-platform/saas/pkg/check" "github.com/percona-platform/saas/pkg/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/percona/pmm/api/alertmanager/ammodels" "github.com/percona/pmm/managed/services" ) func TestRegistry(t *testing.T) { t.Run("create and collect Alerts", func(t *testing.T) { - alertTTL := resolveTimeoutFactor * defaultResendInterval - r := newRegistry(alertTTL) - - nowValue := time.Now().UTC().Round(0) // strip a monotonic clock reading - r.nowF = func() time.Time { return nowValue } + r := newRegistry() checkResults := []services.CheckResult{ { CheckName: "name", @@ -80,57 +73,15 @@ func TestRegistry(t *testing.T) { r.set(checkResults) - expectedAlerts := []*ammodels.PostableAlert{ - { - Annotations: map[string]string{ - "summary": "check summary", - "description": "check description", - "read_more_url": "https://www.example.com", - }, - EndsAt: strfmt.DateTime(nowValue.Add(alertTTL)), - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "/stt/e7b471407fe9734eac5b6adb178ee0ef08ef45f2", - "alertname": "name", - "baz": "qux", - "foo": "bar", - "severity": "warning", - "stt_check": "1", - "interval_group": string(check.Standard), - }, - }, - }, - { - Annotations: map[string]string{ - "summary": "check summary 2", - "description": "check description 2", - "read_more_url": "https://www.example2.com", - }, - EndsAt: strfmt.DateTime(nowValue.Add(alertTTL)), - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "/stt/8fa5695dc34160333eeeb05f00bf1ddbd98be59c", - "alertname": "name2", - "qux": "baz", - "bar": "foo", - "severity": "notice", - "stt_check": "1", - "interval_group": string(check.Standard), - }, - }, - }, - } + // Empty interval means standard + checkResults[1].Interval = check.Standard - collectedAlerts := r.collect() - assert.ElementsMatch(t, expectedAlerts, collectedAlerts) + collectedAlerts := r.getCheckResults("") + assert.ElementsMatch(t, checkResults, collectedAlerts) }) t.Run("delete check results by interval", func(t *testing.T) { - alertTTL := resolveTimeoutFactor * defaultResendInterval - r := newRegistry(alertTTL) - - nowValue := time.Now().UTC().Round(0) // strip a monotonic clock reading - r.nowF = func() time.Time { return nowValue } + r := newRegistry() checkResults := []services.CheckResult{ { CheckName: "name", @@ -177,40 +128,17 @@ func TestRegistry(t *testing.T) { r.set(checkResults) r.deleteByInterval(check.Standard) - expectedAlert := &ammodels.PostableAlert{ - Annotations: map[string]string{ - "summary": "check summary 2", - "description": "check description 2", - "read_more_url": "https://www.example2.com", - }, - EndsAt: strfmt.DateTime(nowValue.Add(alertTTL)), - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "/stt/8fa5695dc34160333eeeb05f00bf1ddbd98be59c", - "alertname": "name2", - "qux": "baz", - "bar": "foo", - "severity": "notice", - "stt_check": "1", - "interval_group": string(check.Frequent), - }, - }, - } - - collectedAlerts := r.collect() + collectedAlerts := r.getCheckResults("") require.Len(t, collectedAlerts, 1) - assert.Equal(t, expectedAlert, collectedAlerts[0]) + assert.Equal(t, checkResults[1], collectedAlerts[0]) }) t.Run("delete check result by name", func(t *testing.T) { - alertTTL := resolveTimeoutFactor * defaultResendInterval - r := newRegistry(alertTTL) - - nowValue := time.Now().UTC().Round(0) // strip a monotonic clock reading - r.nowF = func() time.Time { return nowValue } + r := newRegistry() checkResults := []services.CheckResult{ { CheckName: "name1", + Interval: check.Standard, Target: services.Target{ AgentID: "/agent_id/123", ServiceID: "/service_id/123", @@ -230,6 +158,7 @@ func TestRegistry(t *testing.T) { }, { CheckName: "name2", + Interval: check.Standard, Target: services.Target{ AgentID: "/agent_id/321", ServiceID: "/service_id/321", @@ -252,37 +181,13 @@ func TestRegistry(t *testing.T) { r.set(checkResults) r.deleteByName([]string{"name1"}) - expectedAlert := &ammodels.PostableAlert{ - Annotations: map[string]string{ - "summary": "check summary 2", - "description": "check description 2", - "read_more_url": "https://www.example2.com", - }, - EndsAt: strfmt.DateTime(nowValue.Add(alertTTL)), - Alert: ammodels.Alert{ - Labels: map[string]string{ - "alert_id": "/stt/8fa5695dc34160333eeeb05f00bf1ddbd98be59c", - "alertname": "name2", - "qux": "baz", - "bar": "foo", - "severity": "notice", - "stt_check": "1", - "interval_group": string(check.Standard), - }, - }, - } - - collectedAlerts := r.collect() + collectedAlerts := r.getCheckResults("") require.Len(t, collectedAlerts, 1) - assert.Equal(t, expectedAlert, collectedAlerts[0]) + assert.Equal(t, checkResults[1], collectedAlerts[0]) }) t.Run("empty interval recognized as standard", func(t *testing.T) { - alertTTL := resolveTimeoutFactor * defaultResendInterval - r := newRegistry(alertTTL) - - nowValue := time.Now().UTC().Round(0) // strip a monotonic clock reading - r.nowF = func() time.Time { return nowValue } + r := newRegistry() checkResults := []services.CheckResult{ { CheckName: "name", @@ -328,7 +233,7 @@ func TestRegistry(t *testing.T) { r.set(checkResults) r.deleteByInterval(check.Standard) - collectedAlerts := r.collect() + collectedAlerts := r.getCheckResults("") assert.Empty(t, collectedAlerts) }) } diff --git a/managed/services/config/config.go b/managed/services/config/config.go index c8637bd278..da63fa58e7 100644 --- a/managed/services/config/config.go +++ b/managed/services/config/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/config/pmm-managed.yaml b/managed/services/config/pmm-managed.yaml index af40bfc254..d9341b020f 100644 --- a/managed/services/config/pmm-managed.yaml +++ b/managed/services/config/pmm-managed.yaml @@ -6,7 +6,6 @@ services: VM: enabled: true timeout: 2s - address: http://localhost:9090/prometheus QANDB_SELECT: enabled: true timeout: 2s diff --git a/managed/services/converters.go b/managed/services/converters.go index edfcf3f4e9..a4da1283f0 100644 --- a/managed/services/converters.go +++ b/managed/services/converters.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -475,7 +475,7 @@ func ToAPIAgent(q *reform.Querier, agent *models.Agent) (inventorypb.Agent, erro } // SpecifyLogLevel - convert proto enum to string -// mysqld_exporter, node_exporter and postgres_exporter don't support --log.level=fatal +// mysqld_exporter, node_exporter and postgres_exporter don't support --log.level=fatal. func SpecifyLogLevel(variant, minLogLevel inventorypb.LogLevel) string { if variant == inventorypb.LogLevel_auto { return "" diff --git a/managed/services/dbaas/dbaas_client.go b/managed/services/dbaas/dbaas_client.go index 2e3ec415f6..2768eea2b1 100644 --- a/managed/services/dbaas/dbaas_client.go +++ b/managed/services/dbaas/dbaas_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/dbaas/kubernetes/client/client.go b/managed/services/dbaas/kubernetes/client/client.go index 309887ee9f..832023e00b 100644 --- a/managed/services/dbaas/kubernetes/client/client.go +++ b/managed/services/dbaas/kubernetes/client/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -// Package client TODO +// Package client TODO. package client import ( @@ -107,7 +107,7 @@ type Client struct { namespace string } -// SortableEvents implements sort.Interface for []api.Event based on the Timestamp field +// SortableEvents implements sort.Interface for []api.Event based on the Timestamp field. type SortableEvents []corev1.Event func (list SortableEvents) Len() int { @@ -192,7 +192,7 @@ func NewFromInCluster() (*Client, error) { } // NewFromKubeConfigString creates a new client for the given config string. -// It's intended for clients that expect to be running outside of a cluster +// It's intended for clients that expect to be running outside of a cluster. func NewFromKubeConfigString(kubeconfig string) (*Client, error) { config, err := clientcmd.BuildConfigFromKubeconfigGetter("", NewConfigGetter(kubeconfig).loadFromString) if err != nil { @@ -235,7 +235,7 @@ func (c *Client) setup() error { return c.initOperatorClients() } -// Initializes clients for operators +// Initializes clients for operators. func (c *Client) initOperatorClients() error { dbClusterClient, err := database.NewForConfig(c.restConfig) if err != nil { @@ -246,7 +246,7 @@ func (c *Client) initOperatorClients() error { return err } -// GetSecretsForServiceAccount returns secret by given service account name +// GetSecretsForServiceAccount returns secret by given service account name. func (c *Client) GetSecretsForServiceAccount(ctx context.Context, accountName string) (*corev1.Secret, error) { serviceAccount, err := c.clientset.CoreV1().ServiceAccounts(c.namespace).Get(ctx, accountName, metav1.GetOptions{}) if err != nil { @@ -263,7 +263,7 @@ func (c *Client) GetSecretsForServiceAccount(ctx context.Context, accountName st metav1.GetOptions{}) } -// GenerateKubeConfig generates kubeconfig +// GenerateKubeConfig generates kubeconfig. func (c *Client) GenerateKubeConfig(secret *corev1.Secret) ([]byte, error) { conf := &Config{ Kind: configKind, @@ -301,7 +301,7 @@ func (c *Client) GenerateKubeConfig(secret *corev1.Secret) ([]byte, error) { return c.marshalKubeConfig(conf) } -// GetServerVersion returns server version +// GetServerVersion returns server version. func (c *Client) GetServerVersion() (*version.Info, error) { return c.clientset.Discovery().ServerVersion() } @@ -320,27 +320,27 @@ func (c *Client) GetDatabaseCluster(ctx context.Context, name string) (*dbaasv1. return cluster, nil } -// GetStorageClasses returns all storage classes available in the cluster +// GetStorageClasses returns all storage classes available in the cluster. func (c *Client) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error) { return c.clientset.StorageV1().StorageClasses().List(ctx, metav1.ListOptions{}) } -// GetDeployment returns deployment by name +// GetDeployment returns deployment by name. func (c *Client) GetDeployment(ctx context.Context, name string) (*appsv1.Deployment, error) { return c.clientset.AppsV1().Deployments(c.namespace).Get(ctx, name, metav1.GetOptions{}) } -// GetSecret returns secret by name +// GetSecret returns secret by name. func (c *Client) GetSecret(ctx context.Context, name string) (*corev1.Secret, error) { return c.clientset.CoreV1().Secrets(c.namespace).Get(ctx, name, metav1.GetOptions{}) } -// ListSecrets returns secrets +// ListSecrets returns secrets. func (c *Client) ListSecrets(ctx context.Context) (*corev1.SecretList, error) { return c.clientset.CoreV1().Secrets(c.namespace).List(ctx, metav1.ListOptions{}) } -// DeleteObject deletes object from the k8s cluster +// DeleteObject deletes object from the k8s cluster. func (c *Client) DeleteObject(obj runtime.Object) error { groupResources, err := restmapper.GetAPIGroupResources(c.clientset.Discovery()) if err != nil { @@ -459,12 +459,12 @@ func (c *Client) marshalKubeConfig(conf *Config) ([]byte, error) { return yaml.Marshal(jsonObj) } -// GetPersistentVolumes returns Persistent Volumes available in the cluster +// GetPersistentVolumes returns Persistent Volumes available in the cluster. func (c *Client) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error) { return c.clientset.CoreV1().PersistentVolumes().List(ctx, metav1.ListOptions{}) } -// GetPods returns list of pods +// GetPods returns list of pods. func (c *Client) GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error) { options := metav1.ListOptions{} if labelSelector != nil && (labelSelector.MatchLabels != nil || labelSelector.MatchExpressions != nil) { @@ -474,12 +474,12 @@ func (c *Client) GetPods(ctx context.Context, namespace string, labelSelector *m return c.clientset.CoreV1().Pods(namespace).List(ctx, options) } -// GetNodes returns list of nodes +// GetNodes returns list of nodes. func (c *Client) GetNodes(ctx context.Context) (*corev1.NodeList, error) { return c.clientset.CoreV1().Nodes().List(ctx, metav1.ListOptions{}) } -// GetLogs returns logs for pod +// GetLogs returns logs for pod. func (c *Client) GetLogs(ctx context.Context, pod, container string) (string, error) { defaultLogLines := int64(3000) options := &corev1.PodLogOptions{} @@ -671,7 +671,7 @@ func translateTimestampSince(timestamp metav1.Time) string { } // ApplyFile accepts manifest file contents, parses into []runtime.Object -// and applies them against the cluster +// and applies them against the cluster. func (c *Client) ApplyFile(fileBytes []byte) error { objs, err := c.getObjects(fileBytes) if err != nil { diff --git a/managed/services/dbaas/kubernetes/client/client_test.go b/managed/services/dbaas/kubernetes/client/client_test.go index 542fa2b927..6bcdcf0e62 100644 --- a/managed/services/dbaas/kubernetes/client/client_test.go +++ b/managed/services/dbaas/kubernetes/client/client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/dbaas/kubernetes/client/ctl.go b/managed/services/dbaas/kubernetes/client/ctl.go index 795f0863f9..a3081c35bb 100644 --- a/managed/services/dbaas/kubernetes/client/ctl.go +++ b/managed/services/dbaas/kubernetes/client/ctl.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/dbaas/kubernetes/client/database/database.go b/managed/services/dbaas/kubernetes/client/database/database.go index f803a10e72..b332f0f1e9 100644 --- a/managed/services/dbaas/kubernetes/client/database/database.go +++ b/managed/services/dbaas/kubernetes/client/database/database.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -// Package database TODO +// Package database TODO. package database import ( diff --git a/managed/services/dbaas/kubernetes/client/gen.go b/managed/services/dbaas/kubernetes/client/gen.go index fe733886cf..1b9eddf585 100644 --- a/managed/services/dbaas/kubernetes/client/gen.go +++ b/managed/services/dbaas/kubernetes/client/gen.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/dbaas/kubernetes/client/kubeclient_interface.go b/managed/services/dbaas/kubernetes/client/kubeclient_interface.go index e64a80225e..4a258117c6 100644 --- a/managed/services/dbaas/kubernetes/client/kubeclient_interface.go +++ b/managed/services/dbaas/kubernetes/client/kubeclient_interface.go @@ -23,38 +23,38 @@ import ( // KubeClientConnector ... type KubeClientConnector interface { - // GetSecretsForServiceAccount returns secret by given service account name + // GetSecretsForServiceAccount returns secret by given service account name. GetSecretsForServiceAccount(ctx context.Context, accountName string) (*corev1.Secret, error) - // GenerateKubeConfig generates kubeconfig + // GenerateKubeConfig generates kubeconfig. GenerateKubeConfig(secret *corev1.Secret) ([]byte, error) - // GetServerVersion returns server version + // GetServerVersion returns server version. GetServerVersion() (*version.Info, error) // ListDatabaseClusters returns list of managed PCX clusters. ListDatabaseClusters(ctx context.Context) (*dbaasv1.DatabaseClusterList, error) // GetDatabaseCluster returns PXC clusters by provided name. GetDatabaseCluster(ctx context.Context, name string) (*dbaasv1.DatabaseCluster, error) - // GetStorageClasses returns all storage classes available in the cluster + // GetStorageClasses returns all storage classes available in the cluster. GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error) - // GetDeployment returns deployment by name + // GetDeployment returns deployment by name. GetDeployment(ctx context.Context, name string) (*appsv1.Deployment, error) - // GetSecret returns secret by name + // GetSecret returns secret by name. GetSecret(ctx context.Context, name string) (*corev1.Secret, error) - // ListSecrets returns secrets + // ListSecrets returns secrets. ListSecrets(ctx context.Context) (*corev1.SecretList, error) - // DeleteObject deletes object from the k8s cluster + // DeleteObject deletes object from the k8s cluster. DeleteObject(obj runtime.Object) error ApplyObject(obj runtime.Object) error - // GetPersistentVolumes returns Persistent Volumes available in the cluster + // GetPersistentVolumes returns Persistent Volumes available in the cluster. GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error) - // GetPods returns list of pods + // GetPods returns list of pods. GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error) - // GetNodes returns list of nodes + // GetNodes returns list of nodes. GetNodes(ctx context.Context) (*corev1.NodeList, error) - // GetLogs returns logs for pod + // GetLogs returns logs for pod. GetLogs(ctx context.Context, pod, container string) (string, error) GetEvents(ctx context.Context, name string) (string, error) // ApplyFile accepts manifest file contents, parses into []runtime.Object - // and applies them against the cluster + // and applies them against the cluster. ApplyFile(fileBytes []byte) error // DoCSVWait waits until for a CSV to be applied. DoCSVWait(ctx context.Context, key types.NamespacedName) error diff --git a/managed/services/dbaas/kubernetes/client/load_config.go b/managed/services/dbaas/kubernetes/client/load_config.go index 4d993af1ba..ec8cffa41c 100644 --- a/managed/services/dbaas/kubernetes/client/load_config.go +++ b/managed/services/dbaas/kubernetes/client/load_config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go b/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go index cc28b426e8..1a84ff20de 100644 --- a/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go +++ b/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package client diff --git a/managed/services/dbaas/kubernetes/client/writer.go b/managed/services/dbaas/kubernetes/client/writer.go index a058cc0531..2c5839504c 100644 --- a/managed/services/dbaas/kubernetes/client/writer.go +++ b/managed/services/dbaas/kubernetes/client/writer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/dbaas/kubernetes/kubernetes.go b/managed/services/dbaas/kubernetes/kubernetes.go index 5fe45368a7..207bff645a 100644 --- a/managed/services/dbaas/kubernetes/kubernetes.go +++ b/managed/services/dbaas/kubernetes/kubernetes.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -185,7 +185,7 @@ func NewEmpty() *Kubernetes { } } -// SetKubeconfig changes kubeconfig for active client +// SetKubeconfig changes kubeconfig for active client. func (k *Kubernetes) SetKubeconfig(kubeconfig string) error { k.lock.Lock() defer k.lock.Unlock() @@ -231,7 +231,7 @@ func (k *Kubernetes) GetDatabaseCluster(ctx context.Context, name string) (*dbaa return k.client.GetDatabaseCluster(ctx, name) } -// RestartDatabaseCluster restarts database cluster +// RestartDatabaseCluster restarts database cluster. func (k *Kubernetes) RestartDatabaseCluster(ctx context.Context, name string) error { k.lock.Lock() defer k.lock.Unlock() @@ -255,7 +255,7 @@ func (k *Kubernetes) PatchDatabaseCluster(cluster *dbaasv1.DatabaseCluster) erro return k.client.ApplyObject(cluster) } -// CreateDatabaseCluster creates database cluster +// CreateDatabaseCluster creates database cluster. func (k *Kubernetes) CreateDatabaseCluster(cluster *dbaasv1.DatabaseCluster) error { k.lock.Lock() defer k.lock.Unlock() @@ -266,7 +266,7 @@ func (k *Kubernetes) CreateDatabaseCluster(cluster *dbaasv1.DatabaseCluster) err return k.client.ApplyObject(cluster) } -// DeleteDatabaseCluster deletes database cluster +// DeleteDatabaseCluster deletes database cluster. func (k *Kubernetes) DeleteDatabaseCluster(ctx context.Context, name string) error { k.lock.Lock() defer k.lock.Unlock() @@ -279,7 +279,7 @@ func (k *Kubernetes) DeleteDatabaseCluster(ctx context.Context, name string) err return k.client.DeleteObject(cluster) } -// GetDefaultStorageClassName returns first storageClassName from kubernetes cluster +// GetDefaultStorageClassName returns first storageClassName from kubernetes cluster. func (k *Kubernetes) GetDefaultStorageClassName(ctx context.Context) (string, error) { k.lock.RLock() defer k.lock.RUnlock() @@ -293,7 +293,7 @@ func (k *Kubernetes) GetDefaultStorageClassName(ctx context.Context) (string, er return "", errors.New("no storage classes available") } -// GetClusterType tries to guess the underlying kubernetes cluster based on storage class +// GetClusterType tries to guess the underlying kubernetes cluster based on storage class. func (k *Kubernetes) GetClusterType(ctx context.Context) (ClusterType, error) { k.lock.RLock() defer k.lock.RUnlock() @@ -314,7 +314,7 @@ func (k *Kubernetes) GetClusterType(ctx context.Context) (ClusterType, error) { return ClusterTypeGeneric, nil } -// getOperatorVersion parses operator version from operator deployment +// getOperatorVersion parses operator version from operator deployment. func (k *Kubernetes) getOperatorVersion(ctx context.Context, deploymentName, containerName string) (string, error) { deployment, err := k.client.GetDeployment(ctx, deploymentName) if err != nil { @@ -328,7 +328,7 @@ func (k *Kubernetes) getOperatorVersion(ctx context.Context, deploymentName, con return "", errors.New("unknown version of operator") } -// GetPSMDBOperatorVersion parses PSMDB operator version from operator deployment +// GetPSMDBOperatorVersion parses PSMDB operator version from operator deployment. func (k *Kubernetes) GetPSMDBOperatorVersion(ctx context.Context) (string, error) { k.lock.RLock() defer k.lock.RUnlock() @@ -342,21 +342,21 @@ func (k *Kubernetes) GetPXCOperatorVersion(ctx context.Context) (string, error) return k.getOperatorVersion(ctx, pxcDeploymentName, pxcOperatorContainerName) } -// GetDBaaSOperatorVersion parses DBaaS operator version from operator deployment +// GetDBaaSOperatorVersion parses DBaaS operator version from operator deployment. func (k *Kubernetes) GetDBaaSOperatorVersion(ctx context.Context) (string, error) { k.lock.RLock() defer k.lock.RUnlock() return k.getOperatorVersion(ctx, dbaasDeploymentName, dbaasOperatorContainerName) } -// GetSecret returns secret by name +// GetSecret returns secret by name. func (k *Kubernetes) GetSecret(ctx context.Context, name string) (*corev1.Secret, error) { k.lock.RLock() defer k.lock.RUnlock() return k.client.GetSecret(ctx, name) } -// ListSecrets returns secret by name +// ListSecrets returns secret by name. func (k *Kubernetes) ListSecrets(ctx context.Context) (*corev1.SecretList, error) { k.lock.RLock() defer k.lock.RUnlock() @@ -912,7 +912,7 @@ func (k *Kubernetes) UpgradeOperator(ctx context.Context, namespace, name string return err } -// GetServerVersion returns server version +// GetServerVersion returns server version. func (k *Kubernetes) GetServerVersion() (*version.Info, error) { return k.client.GetServerVersion() } diff --git a/managed/services/dbaas/kubernetes/olm_operator_test.go b/managed/services/dbaas/kubernetes/olm_operator_test.go index b9cb55d414..83906ee61b 100644 --- a/managed/services/dbaas/kubernetes/olm_operator_test.go +++ b/managed/services/dbaas/kubernetes/olm_operator_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2020 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/dbaas/kubernetes/types.go b/managed/services/dbaas/kubernetes/types.go index 867491f48f..db29220e1c 100644 --- a/managed/services/dbaas/kubernetes/types.go +++ b/managed/services/dbaas/kubernetes/types.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/dbaas/kubernetes/types_test.go b/managed/services/dbaas/kubernetes/types_test.go index 21f132a3f3..08daf4c349 100644 --- a/managed/services/dbaas/kubernetes/types_test.go +++ b/managed/services/dbaas/kubernetes/types_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/dbaas/utils/convertors/convertors.go b/managed/services/dbaas/utils/convertors/convertors.go index b6481ae467..a7f3d2f55d 100644 --- a/managed/services/dbaas/utils/convertors/convertors.go +++ b/managed/services/dbaas/utils/convertors/convertors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/dbaas/utils/convertors/convertors_test.go b/managed/services/dbaas/utils/convertors/convertors_test.go index fd9ab7b1c6..d3eefec788 100644 --- a/managed/services/dbaas/utils/convertors/convertors_test.go +++ b/managed/services/dbaas/utils/convertors/convertors_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/errors.go b/managed/services/errors.go index 7b09154abb..5e752cd96c 100644 --- a/managed/services/errors.go +++ b/managed/services/errors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -17,8 +17,13 @@ package services import "github.com/pkg/errors" -// ErrAdvisorsDisabled means that advisors checks are disabled and can't be executed. -var ErrAdvisorsDisabled = errors.New("Advisor checks are disabled") +var ( + // ErrAdvisorsDisabled means that advisors checks are disabled and can't be executed. + ErrAdvisorsDisabled = errors.New("Advisor checks are disabled") -// ErrAlertingDisabled means Percona Alerting is disabled and its APIs can't be executed. -var ErrAlertingDisabled = errors.New("Alerting is disabled") + // ErrLocationFolderPairAlreadyUsed returned when location-folder pair already in use and cannot be used for backup. + ErrLocationFolderPairAlreadyUsed = errors.New("location-folder pair already used") + + // ErrAlertingDisabled means Percona Alerting is disabled and its APIs can't be executed. + ErrAlertingDisabled = errors.New("Alerting is disabled") +) diff --git a/managed/services/grafana/auth_server.go b/managed/services/grafana/auth_server.go index 5f39ba3d8c..2d7cf38cc3 100644 --- a/managed/services/grafana/auth_server.go +++ b/managed/services/grafana/auth_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -358,9 +358,14 @@ func (s *AuthServer) getFiltersForVMProxy(userID int) ([]string, error) { filters := make([]string, 0, len(roles)) for _, r := range roles { - if r.Filter != "" { - filters = append(filters, r.Filter) + if r.Filter == "" { + // Special case when a user has assigned a role with no filters. + // In this case it's irrelevant what other roles are assigned to the user. + // The user shall have full access. + return []string{}, nil } + + filters = append(filters, r.Filter) } return filters, nil } diff --git a/managed/services/grafana/auth_server_fuzz.go b/managed/services/grafana/auth_server_fuzz.go index 2abdb9c911..d72f17a776 100644 --- a/managed/services/grafana/auth_server_fuzz.go +++ b/managed/services/grafana/auth_server_fuzz.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/grafana/auth_server_test.go b/managed/services/grafana/auth_server_test.go index 7c4d44865a..77d341a36b 100644 --- a/managed/services/grafana/auth_server_test.go +++ b/managed/services/grafana/auth_server_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -35,9 +35,9 @@ import ( "gopkg.in/reform.v1/dialects/postgresql" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) func TestNextPrefix(t *testing.T) { @@ -294,18 +294,27 @@ func TestAuthServerAddVMGatewayToken(t *testing.T) { c := NewClient("127.0.0.1:3000") s := NewAuthServer(c, &checker, db) - var roleA models.Role - roleA.Title = "Role A" - roleA.Filter = "filter A" + roleA := models.Role{ + Title: "Role A", + Filter: "filter A", + } err := models.CreateRole(db.Querier, &roleA) require.NoError(t, err) - var roleB models.Role - roleB.Title = "Role B" - roleB.Filter = "filter B" + roleB := models.Role{ + Title: "Role B", + Filter: "filter B", + } err = models.CreateRole(db.Querier, &roleB) require.NoError(t, err) + roleC := models.Role{ + Title: "Role C", + Filter: "", + } + err = models.CreateRole(db.Querier, &roleC) + require.NoError(t, err) + // Enable access control _, err = models.UpdateSettings(db.Querier, &models.ChangeSettingsParams{ EnableAccessControl: true, @@ -315,6 +324,7 @@ func TestAuthServerAddVMGatewayToken(t *testing.T) { for userID, roleIDs := range map[int][]int{ 1337: {int(roleA.ID)}, 1338: {int(roleA.ID), int(roleB.ID)}, + 1339: {int(roleA.ID), int(roleC.ID)}, 1: {int(roleA.ID)}, } { err := db.InTransaction(func(tx *reform.TX) error { @@ -382,6 +392,19 @@ func TestAuthServerAddVMGatewayToken(t *testing.T) { require.Equal(t, parsed[0], "filter A") require.Equal(t, parsed[1], "filter B") }) + + //nolint:paralleltest + t.Run("shall not add any filters if at least one role has full access", func(t *testing.T) { + rw := httptest.NewRecorder() + req, err := http.NewRequestWithContext(ctx, http.MethodGet, "/prometheus/api/v1/", nil) + require.NoError(t, err) + + err = s.maybeAddVMProxyFilters(ctx, rw, req, 1339, logrus.WithField("test", t.Name())) + require.NoError(t, err) + + headerString := rw.Header().Get(vmProxyHeaderName) + require.Equal(t, len(headerString), 0) + }) } func Test_cleanPath(t *testing.T) { diff --git a/managed/services/grafana/client.go b/managed/services/grafana/client.go index c3fe0769da..684fe94864 100644 --- a/managed/services/grafana/client.go +++ b/managed/services/grafana/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/grafana/client_test.go b/managed/services/grafana/client_test.go index 546dbcaa7f..75b4e5376f 100644 --- a/managed/services/grafana/client_test.go +++ b/managed/services/grafana/client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/grafana/deps.go b/managed/services/grafana/deps.go index e58ce85e8b..496065a021 100644 --- a/managed/services/grafana/deps.go +++ b/managed/services/grafana/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/grafana/mock_aws_instance_checker_test.go b/managed/services/grafana/mock_aws_instance_checker_test.go index c9e02a0897..66a2aee644 100644 --- a/managed/services/grafana/mock_aws_instance_checker_test.go +++ b/managed/services/grafana/mock_aws_instance_checker_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package grafana diff --git a/managed/services/inventory/agents.go b/managed/services/inventory/agents.go index deae73a93b..6a27106db9 100644 --- a/managed/services/inventory/agents.go +++ b/managed/services/inventory/agents.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -27,7 +27,7 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" ) // AgentsService works with inventory API Agents. diff --git a/managed/services/inventory/agents_test.go b/managed/services/inventory/agents_test.go index 3e9082bd87..6157ea2d9a 100644 --- a/managed/services/inventory/agents_test.go +++ b/managed/services/inventory/agents_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/inventory/deps.go b/managed/services/inventory/deps.go index a1471ea79c..37c2faab3e 100644 --- a/managed/services/inventory/deps.go +++ b/managed/services/inventory/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/inventory/grpc/agents_server.go b/managed/services/inventory/grpc/agents_server.go index b7d1a73eb5..3e4277d394 100644 --- a/managed/services/inventory/grpc/agents_server.go +++ b/managed/services/inventory/grpc/agents_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/inventory/grpc/nodes_server.go b/managed/services/inventory/grpc/nodes_server.go index ba08800ad8..18b57b1d4d 100644 --- a/managed/services/inventory/grpc/nodes_server.go +++ b/managed/services/inventory/grpc/nodes_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -106,6 +106,10 @@ func (s *nodesServer) GetNode(ctx context.Context, req *inventorypb.GetNodeReque return res, nil } +func (s *nodesServer) AddNode(ctx context.Context, req *inventorypb.AddNodeRequest) (*inventorypb.AddNodeResponse, error) { + return s.svc.AddNode(ctx, req) +} + // AddGenericNode adds Generic Node. func (s *nodesServer) AddGenericNode(ctx context.Context, req *inventorypb.AddGenericNodeRequest) (*inventorypb.AddGenericNodeResponse, error) { node, err := s.svc.AddGenericNode(ctx, req) diff --git a/managed/services/inventory/grpc/services_server.go b/managed/services/inventory/grpc/services_server.go index 72d0798124..0a6207ce87 100644 --- a/managed/services/inventory/grpc/services_server.go +++ b/managed/services/inventory/grpc/services_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -20,21 +20,29 @@ import ( "fmt" "github.com/AlekSi/pointer" + "github.com/pkg/errors" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services/inventory" + "github.com/percona/pmm/managed/services/management/common" ) type servicesServer struct { - s *inventory.ServicesService + s *inventory.ServicesService + mgmtServices common.MgmtServices inventorypb.UnimplementedServicesServer } // NewServicesServer returns Inventory API handler for managing Services. -func NewServicesServer(s *inventory.ServicesService) inventorypb.ServicesServer { //nolint:ireturn - return &servicesServer{s: s} +func NewServicesServer(s *inventory.ServicesService, mgmtServices common.MgmtServices) inventorypb.ServicesServer { //nolint:ireturn + return &servicesServer{ + s: s, + mgmtServices: mgmtServices, + } } var serviceTypes = map[inventorypb.ServiceType]models.ServiceType{ @@ -278,3 +286,29 @@ func (s *servicesServer) AddCustomLabels(ctx context.Context, req *inventorypb.A func (s *servicesServer) RemoveCustomLabels(ctx context.Context, req *inventorypb.RemoveCustomLabelsRequest) (*inventorypb.RemoveCustomLabelsResponse, error) { return s.s.RemoveCustomLabels(ctx, req) } + +// ChangeService changes service configuration. +func (s *servicesServer) ChangeService(ctx context.Context, req *inventorypb.ChangeServiceRequest) (*inventorypb.ChangeServiceResponse, error) { + err := s.s.ChangeService(ctx, s.mgmtServices, &models.ChangeStandardLabelsParams{ + ServiceID: req.ServiceId, + Cluster: req.Cluster, + Environment: req.Environment, + ReplicationSet: req.ReplicationSet, + ExternalGroup: req.ExternalGroup, + }) + if err != nil { + return nil, toAPIError(err) + } + + return &inventorypb.ChangeServiceResponse{}, nil +} + +// toAPIError converts GO errors into API-level errors. +func toAPIError(err error) error { + switch { + case errors.Is(err, common.ErrClusterLocked): + return status.Error(codes.FailedPrecondition, err.Error()) + default: + return err + } +} diff --git a/managed/services/inventory/inventory_metrics.go b/managed/services/inventory/inventory_metrics.go index 7b45b92ca4..d390b95b73 100644 --- a/managed/services/inventory/inventory_metrics.go +++ b/managed/services/inventory/inventory_metrics.go @@ -26,7 +26,7 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" ) const ( @@ -68,7 +68,7 @@ func NewInventoryMetricsCollector(metrics inventoryMetrics) *InventoryMetricsCol mAgentsDesc: prom.NewDesc( prom.BuildFQName(prometheusNamespace, prometheusSubsystem, "agents"), "Inventory Agent", - []string{"agent_id", "agent_type", "service_id", "node_id", "pmm_agent_id", "disabled", "version"}, + []string{"agent_id", "agent_type", "service_id", "node_id", "node_name", "pmm_agent_id", "disabled", "version"}, nil), mNodesDesc: prom.NewDesc( prom.BuildFQName(prometheusNamespace, prometheusSubsystem, "nodes"), @@ -85,7 +85,7 @@ func NewInventoryMetricsCollector(metrics inventoryMetrics) *InventoryMetricsCol } } -func GetRunsOnNodeIDByPMMAgentID(agents []*models.Agent, pmmAgentID string) string { +func getRunsOnNodeIDByPMMAgentID(agents []*models.Agent, pmmAgentID string) string { for _, agent := range agents { if agent.AgentID == pmmAgentID { return pointer.GetString(agent.RunsOnNodeID) @@ -103,6 +103,16 @@ func (i *InventoryMetrics) GetAgentMetrics(ctx context.Context) ([]Metric, error return err } + dbNodes, err := models.FindNodes(tx.Querier, models.NodeFilters{}) + if err != nil { + return err + } + + nodeMap := make(map[string]string, len(dbNodes)) + for _, node := range dbNodes { + nodeMap[node.NodeID] = node.NodeName + } + for _, agent := range dbAgents { runsOnNodeID := "" disabled := "0" @@ -121,14 +131,16 @@ func (i *InventoryMetrics) GetAgentMetrics(ctx context.Context) ([]Metric, error runsOnNodeID = pointer.GetString(agent.RunsOnNodeID) } else { metricValue = float64(inventorypb.AgentStatus_value[agent.Status]) - runsOnNodeID = GetRunsOnNodeIDByPMMAgentID(dbAgents, pmmAgentID) + runsOnNodeID = getRunsOnNodeIDByPMMAgentID(dbAgents, pmmAgentID) } + nodeName := nodeMap[runsOnNodeID] agentMetricLabels := []string{ agent.AgentID, string(agent.AgentType), pointer.GetString(agent.ServiceID), runsOnNodeID, + nodeName, pmmAgentID, disabled, pointer.GetString(agent.Version), diff --git a/managed/services/inventory/inventory_metrics_test.go b/managed/services/inventory/inventory_metrics_test.go index c65631588f..939ccc7b07 100644 --- a/managed/services/inventory/inventory_metrics_test.go +++ b/managed/services/inventory/inventory_metrics_test.go @@ -38,7 +38,7 @@ func TestNewInventoryMetricsCollector(t *testing.T) { agentMetrics := []Metric{ { - labels: []string{"A1", string(models.PMMAgentType), "S1", "N1", "PA1", strconv.Itoa(1), "V1"}, + labels: []string{"A1", string(models.PMMAgentType), "S1", "N1", "NN1", "PA1", strconv.Itoa(1), "V1"}, value: float64(1), }, } @@ -87,13 +87,13 @@ func TestNewInventoryMetricsCollector(t *testing.T) { const expectedAgentMetrics = ` # HELP pmm_managed_inventory_agents Inventory Agent # TYPE pmm_managed_inventory_agents gauge - pmm_managed_inventory_agents{agent_id="A1",agent_type="pmm-agent",disabled="1",node_id="N1",pmm_agent_id="PA1",service_id="S1",version="V1"} 1 + pmm_managed_inventory_agents{agent_id="A1",agent_type="pmm-agent",disabled="1",node_id="N1",node_name="NN1",pmm_agent_id="PA1",service_id="S1",version="V1"} 1 ` const expectedNodeMetrics = ` # HELP pmm_managed_inventory_nodes Inventory Node - # TYPE pmm_managed_inventory_nodes gauge - pmm_managed_inventory_nodes{container_name="C1",node_id="N1",node_name="N1",node_type="generic"} 1 + # TYPE pmm_managed_inventory_nodes gauge + pmm_managed_inventory_nodes{container_name="C1",node_id="N1",node_name="N1",node_type="generic"} 1 ` const expectedServiceMetrics = ` diff --git a/managed/services/inventory/mock_agent_service_test.go b/managed/services/inventory/mock_agent_service_test.go index e5cb5c31a8..a0d1f1aa95 100644 --- a/managed/services/inventory/mock_agent_service_test.go +++ b/managed/services/inventory/mock_agent_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package inventory diff --git a/managed/services/inventory/mock_agents_registry_test.go b/managed/services/inventory/mock_agents_registry_test.go index 17d3609ad1..b683d1ba0b 100644 --- a/managed/services/inventory/mock_agents_registry_test.go +++ b/managed/services/inventory/mock_agents_registry_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package inventory diff --git a/managed/services/inventory/mock_agents_state_updater_test.go b/managed/services/inventory/mock_agents_state_updater_test.go index a073d3ee25..7953573a32 100644 --- a/managed/services/inventory/mock_agents_state_updater_test.go +++ b/managed/services/inventory/mock_agents_state_updater_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package inventory diff --git a/managed/services/inventory/mock_connection_checker_test.go b/managed/services/inventory/mock_connection_checker_test.go index fca0ffe2da..8f73889c24 100644 --- a/managed/services/inventory/mock_connection_checker_test.go +++ b/managed/services/inventory/mock_connection_checker_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package inventory diff --git a/managed/services/inventory/mock_inventory_metrics_test.go b/managed/services/inventory/mock_inventory_metrics_test.go index 55e461e1cb..aa22cfcc6e 100644 --- a/managed/services/inventory/mock_inventory_metrics_test.go +++ b/managed/services/inventory/mock_inventory_metrics_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package inventory diff --git a/managed/services/inventory/mock_prometheus_service_test.go b/managed/services/inventory/mock_prometheus_service_test.go index 03d2770440..1b82cbe503 100644 --- a/managed/services/inventory/mock_prometheus_service_test.go +++ b/managed/services/inventory/mock_prometheus_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package inventory diff --git a/managed/services/inventory/mock_version_cache_test.go b/managed/services/inventory/mock_version_cache_test.go index 141a110d5f..4e0286a075 100644 --- a/managed/services/inventory/mock_version_cache_test.go +++ b/managed/services/inventory/mock_version_cache_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package inventory diff --git a/managed/services/inventory/nodes.go b/managed/services/inventory/nodes.go index 10516dfd2d..31a4f304d4 100644 --- a/managed/services/inventory/nodes.go +++ b/managed/services/inventory/nodes.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -46,11 +46,9 @@ func NewNodesService(db *reform.DB, r agentsRegistry, state agentsStateUpdater, } // List returns a list of all Nodes. -// -//nolint:unparam func (s *NodesService) List(ctx context.Context, filters models.NodeFilters) ([]inventorypb.Node, error) { var nodes []*models.Node - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error nodes, err = models.FindNodes(tx.Querier, filters) return err @@ -70,9 +68,9 @@ func (s *NodesService) List(ctx context.Context, filters models.NodeFilters) ([] } // Get returns a single Node by ID. -func (s *NodesService) Get(ctx context.Context, req *inventorypb.GetNodeRequest) (inventorypb.Node, error) { //nolint:unparam,ireturn +func (s *NodesService) Get(ctx context.Context, req *inventorypb.GetNodeRequest) (inventorypb.Node, error) { //nolint:ireturn modelNode := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error modelNode, err = models.FindNodeByID(tx.Querier, req.NodeId) if err != nil { @@ -92,9 +90,49 @@ func (s *NodesService) Get(ctx context.Context, req *inventorypb.GetNodeRequest) return node, nil } +// AddNode adds any type of Node. +func (s *NodesService) AddNode(ctx context.Context, req *inventorypb.AddNodeRequest) (*inventorypb.AddNodeResponse, error) { + res := &inventorypb.AddNodeResponse{} + + switch req.Request.(type) { + case *inventorypb.AddNodeRequest_Generic: + node, err := s.AddGenericNode(ctx, req.GetGeneric()) + if err != nil { + return nil, err + } + res.Node = &inventorypb.AddNodeResponse_Generic{Generic: node} + case *inventorypb.AddNodeRequest_Container: + node, err := s.AddContainerNode(ctx, req.GetContainer()) + if err != nil { + return nil, err + } + res.Node = &inventorypb.AddNodeResponse_Container{Container: node} + case *inventorypb.AddNodeRequest_Remote: + node, err := s.AddRemoteNode(ctx, req.GetRemote()) + if err != nil { + return nil, err + } + res.Node = &inventorypb.AddNodeResponse_Remote{Remote: node} + case *inventorypb.AddNodeRequest_RemoteRds: + node, err := s.AddRemoteRDSNode(ctx, req.GetRemoteRds()) + if err != nil { + return nil, err + } + res.Node = &inventorypb.AddNodeResponse_RemoteRds{RemoteRds: node} + case *inventorypb.AddNodeRequest_RemoteAzure: + node, err := s.AddRemoteAzureDatabaseNode(ctx, req.GetRemoteAzure()) + if err != nil { + return nil, err + } + res.Node = &inventorypb.AddNodeResponse_RemoteAzureDatabase{RemoteAzureDatabase: node} + default: + return nil, errors.Errorf("invalid request %v", req.GetRequest()) + } + + return res, nil +} + // AddGenericNode adds Generic Node. -// -//nolint:unparam func (s *NodesService) AddGenericNode(ctx context.Context, req *inventorypb.AddGenericNodeRequest) (*inventorypb.GenericNode, error) { params := &models.CreateNodeParams{ NodeName: req.NodeName, @@ -108,7 +146,7 @@ func (s *NodesService) AddGenericNode(ctx context.Context, req *inventorypb.AddG } node := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error node, err = models.CreateNode(tx.Querier, models.GenericNodeType, params) if err != nil { @@ -129,8 +167,6 @@ func (s *NodesService) AddGenericNode(ctx context.Context, req *inventorypb.AddG } // AddContainerNode adds Container Node. -// -//nolint:unparam func (s *NodesService) AddContainerNode(ctx context.Context, req *inventorypb.AddContainerNodeRequest) (*inventorypb.ContainerNode, error) { params := &models.CreateNodeParams{ NodeName: req.NodeName, @@ -145,7 +181,7 @@ func (s *NodesService) AddContainerNode(ctx context.Context, req *inventorypb.Ad } node := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error node, err = models.CreateNode(tx.Querier, models.ContainerNodeType, params) if err != nil { @@ -166,8 +202,6 @@ func (s *NodesService) AddContainerNode(ctx context.Context, req *inventorypb.Ad } // AddRemoteNode adds Remote Node. -// -//nolint:unparam func (s *NodesService) AddRemoteNode(ctx context.Context, req *inventorypb.AddRemoteNodeRequest) (*inventorypb.RemoteNode, error) { params := &models.CreateNodeParams{ NodeName: req.NodeName, @@ -179,7 +213,7 @@ func (s *NodesService) AddRemoteNode(ctx context.Context, req *inventorypb.AddRe } node := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error node, err = models.CreateNode(tx.Querier, models.RemoteNodeType, params) if err != nil { @@ -200,8 +234,6 @@ func (s *NodesService) AddRemoteNode(ctx context.Context, req *inventorypb.AddRe } // AddRemoteRDSNode adds a new RDS node -// -//nolint:unparam func (s *NodesService) AddRemoteRDSNode(ctx context.Context, req *inventorypb.AddRemoteRDSNodeRequest) (*inventorypb.RemoteRDSNode, error) { params := &models.CreateNodeParams{ NodeName: req.NodeName, @@ -213,7 +245,7 @@ func (s *NodesService) AddRemoteRDSNode(ctx context.Context, req *inventorypb.Ad } node := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error node, err = models.CreateNode(tx.Querier, models.RemoteRDSNodeType, params) if err != nil { @@ -235,7 +267,7 @@ func (s *NodesService) AddRemoteRDSNode(ctx context.Context, req *inventorypb.Ad // AddRemoteAzureDatabaseNode adds a new Azure database node // -//nolint:unparam,dupl +//nolint:dupl func (s *NodesService) AddRemoteAzureDatabaseNode(ctx context.Context, req *inventorypb.AddRemoteAzureDatabaseNodeRequest) (*inventorypb.RemoteAzureDatabaseNode, error) { params := &models.CreateNodeParams{ NodeName: req.NodeName, @@ -247,7 +279,7 @@ func (s *NodesService) AddRemoteAzureDatabaseNode(ctx context.Context, req *inve } node := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error node, err = models.CreateNode(tx.Querier, models.RemoteAzureDatabaseNodeType, params) if err != nil { @@ -274,7 +306,7 @@ func (s *NodesService) Remove(ctx context.Context, id string, force bool) error idsToKick := make(map[string]struct{}) idsToSetState := make(map[string]struct{}) - if e := s.db.InTransaction(func(tx *reform.TX) error { + if e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { mode := models.RemoveRestrict if force { mode = models.RemoveCascade diff --git a/managed/services/inventory/nodes_test.go b/managed/services/inventory/nodes_test.go index afd2ad42a8..d03ab7ed8c 100644 --- a/managed/services/inventory/nodes_test.go +++ b/managed/services/inventory/nodes_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -16,6 +16,7 @@ package inventory import ( + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -31,7 +32,7 @@ import ( func TestNodes(t *testing.T) { t.Run("Basic", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) actualNodes, err := ns.List(ctx, models.NodeFilters{}) require.NoError(t, err) @@ -63,7 +64,7 @@ func TestNodes(t *testing.T) { t.Run("GetEmptyID", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) getNodeResponse, err := ns.Get(ctx, &inventorypb.GetNodeRequest{NodeId: ""}) tests.AssertGRPCError(t, status.New(codes.InvalidArgument, `Empty Node ID.`), err) @@ -72,7 +73,7 @@ func TestNodes(t *testing.T) { t.Run("AddNameEmpty", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) _, err := ns.AddGenericNode(ctx, &inventorypb.AddGenericNodeRequest{NodeName: ""}) tests.AssertGRPCError(t, status.New(codes.InvalidArgument, `Empty Node name.`), err) @@ -80,7 +81,7 @@ func TestNodes(t *testing.T) { t.Run("AddNameNotUnique", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) _, err := ns.AddGenericNode(ctx, &inventorypb.AddGenericNodeRequest{NodeName: "test", Address: "test"}) require.NoError(t, err) @@ -91,7 +92,7 @@ func TestNodes(t *testing.T) { t.Run("AddHostnameNotUnique", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) _, err := ns.AddGenericNode(ctx, &inventorypb.AddGenericNodeRequest{NodeName: "test1", Address: "test"}) require.NoError(t, err) @@ -100,24 +101,9 @@ func TestNodes(t *testing.T) { require.NoError(t, err) }) - /* - TODO - t.Run("AddInstanceRegionNotUnique", func(t *testing.T) { - ns, teardown := setup(t) - defer teardown(t) - - _, err := ns.AddRemoteAmazonRDSNode(ctx, &inventorypb.AddRemoteAmazonRDSNodeRequest{NodeName: "test1", Instance: "test-instance", Region: "test-region"}) - require.NoError(t, err) - - _, err = ns.AddRemoteAmazonRDSNode(ctx, &inventorypb.AddRemoteAmazonRDSNodeRequest{NodeName: "test2", Instance: "test-instance", Region: "test-region"}) - expected := status.New(codes.AlreadyExists, `Node with instance "test-instance" and region "test-region" already exists.`) - tests.AssertGRPCError(t, expected, err) - }) - */ - - t.Run("AddRemoteRDSNode", func(t *testing.T) { + t.Run("AddRemoteRDSNodeNotUnique", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) _, err := ns.AddRemoteRDSNode(ctx, &inventorypb.AddRemoteRDSNodeRequest{NodeName: "test1", Region: "test-region", Address: "test"}) require.NoError(t, err) @@ -135,3 +121,250 @@ func TestNodes(t *testing.T) { tests.AssertGRPCError(t, status.New(codes.NotFound, `Node with ID "no-such-id" not found.`), err) }) } + +func TestAddNode(t *testing.T) { + t.Run("BasicGeneric", func(t *testing.T) { + const nodeID = "/node_id/00000000-0000-4000-8000-000000000005" + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + actualNodes, err := ns.List(ctx, models.NodeFilters{}) + require.NoError(t, err) + require.Len(t, actualNodes, 1) // PMM Server Node + + addNodeResponse, err := ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{NodeName: "test-bm", Region: "test-region", Address: "test"}, + }, + }) + require.NoError(t, err) + + expectedNode := &inventorypb.GenericNode{ + NodeId: nodeID, + NodeName: "test-bm", + Region: "test-region", + Address: "test", + } + assert.Equal(t, expectedNode, addNodeResponse.GetGeneric()) + + getNodeResponse, err := ns.Get(ctx, &inventorypb.GetNodeRequest{NodeId: nodeID}) + require.NoError(t, err) + assert.Equal(t, expectedNode, getNodeResponse) + + nodesResponse, err := ns.List(ctx, models.NodeFilters{}) + require.NoError(t, err) + require.Len(t, nodesResponse, 2) + assert.Equal(t, expectedNode, nodesResponse[0]) + + err = ns.Remove(ctx, nodeID, false) + require.NoError(t, err) + getNodeResponse, err = ns.Get(ctx, &inventorypb.GetNodeRequest{NodeId: nodeID}) + tests.AssertGRPCError(t, status.New(codes.NotFound, fmt.Sprintf("Node with ID %q not found.", nodeID)), err) + assert.Nil(t, getNodeResponse) + }) + + t.Run("AddAllNodeTypes", func(t *testing.T) { + const ( + nodeID1 = "/node_id/00000000-0000-4000-8000-000000000005" + nodeID2 = "/node_id/00000000-0000-4000-8000-000000000006" + nodeID3 = "/node_id/00000000-0000-4000-8000-000000000007" + nodeID4 = "/node_id/00000000-0000-4000-8000-000000000008" + nodeID5 = "/node_id/00000000-0000-4000-8000-000000000009" + ) + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + actualNodes, err := ns.List(ctx, models.NodeFilters{}) + require.NoError(t, err) + require.Len(t, actualNodes, 1) // PMM Server Node + + expectedNode1 := &inventorypb.GenericNode{ + NodeId: nodeID1, + NodeName: "test-name1", + Region: "test-region", + Address: "test1", + } + addNodeResponse, err := ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{ + NodeName: "test-name1", + Region: "test-region", + Address: "test1", + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, expectedNode1, addNodeResponse.GetGeneric()) + + expectedNode2 := &inventorypb.ContainerNode{ + NodeId: nodeID2, + NodeName: "test-name2", + Region: "test-region", + Address: "test2", + } + addNodeResponse, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Container{ + Container: &inventorypb.AddContainerNodeRequest{ + NodeName: "test-name2", + Region: "test-region", + Address: "test2", + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, expectedNode2, addNodeResponse.GetContainer()) + + expectedNode3 := &inventorypb.RemoteNode{ + NodeId: nodeID3, + NodeName: "test-name3", + Region: "test-region", + Address: "test3", + CustomLabels: map[string]string{ + "testkey": "test-value", + "region": "test-region", + }, + } + addNodeResponse, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Remote{ + Remote: &inventorypb.AddRemoteNodeRequest{ + NodeName: "test-name3", + Region: "test-region", + Address: "test3", + CustomLabels: map[string]string{ + "testkey": "test-value", + "region": "test-region", + }, + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, expectedNode3, addNodeResponse.GetRemote()) + + expectedNode4 := &inventorypb.RemoteAzureDatabaseNode{ + NodeId: nodeID4, + NodeName: "test-name4", + Region: "test-region", + Az: "test-region-az", + Address: "test4", + } + addNodeResponse, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_RemoteAzure{ + RemoteAzure: &inventorypb.AddRemoteAzureDatabaseNodeRequest{ + NodeName: "test-name4", + Region: "test-region", + Az: "test-region-az", + Address: "test4", + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, expectedNode4, addNodeResponse.GetRemoteAzureDatabase()) + + expectedNode5 := &inventorypb.RemoteRDSNode{ + NodeId: nodeID5, + NodeName: "test-name5", + Region: "test-region", + Az: "test-region-az", + Address: "test5", + } + addNodeResponse, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_RemoteRds{ + RemoteRds: &inventorypb.AddRemoteRDSNodeRequest{ + NodeName: "test-name5", + Region: "test-region", + Az: "test-region-az", + Address: "test5", + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, expectedNode5, addNodeResponse.GetRemoteRds()) + + getNodeResponse, err := ns.Get(ctx, &inventorypb.GetNodeRequest{NodeId: nodeID1}) + require.NoError(t, err) + assert.Equal(t, expectedNode1, getNodeResponse) + + nodesResponse, err := ns.List(ctx, models.NodeFilters{}) + require.NoError(t, err) + require.Len(t, nodesResponse, 6) + assert.Equal(t, expectedNode1, nodesResponse[0]) + + err = ns.Remove(ctx, nodeID1, false) + require.NoError(t, err) + getNodeResponse, err = ns.Get(ctx, &inventorypb.GetNodeRequest{NodeId: nodeID1}) + tests.AssertGRPCError(t, status.New(codes.NotFound, fmt.Sprintf("Node with ID %q not found.", nodeID1)), err) + assert.Nil(t, getNodeResponse) + }) + + t.Run("AddRemoteRDSNodeNonUnique", func(t *testing.T) { + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + _, err := ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_RemoteRds{ + RemoteRds: &inventorypb.AddRemoteRDSNodeRequest{NodeName: "test1", Region: "test-region", Address: "test"}, + }, + }) + require.NoError(t, err) + + _, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_RemoteRds{ + RemoteRds: &inventorypb.AddRemoteRDSNodeRequest{NodeName: "test2", Region: "test-region", Address: "test"}, + }, + }) + expected := status.New(codes.AlreadyExists, `Node with instance "test" and region "test-region" already exists.`) + tests.AssertGRPCError(t, expected, err) + }) + + t.Run("AddHostnameNotUnique", func(t *testing.T) { + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + _, err := ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{NodeName: "test1", Address: "test"}, + }, + }) + require.NoError(t, err) + + _, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{NodeName: "test2", Address: "test"}, + }, + }) + require.NoError(t, err) + }) + + t.Run("AddNameEmpty", func(t *testing.T) { + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + _, err := ns.AddNode(ctx, + &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{NodeName: ""}, + }, + }, + ) + tests.AssertGRPCError(t, status.New(codes.InvalidArgument, `Empty Node name.`), err) + }) + + t.Run("AddNameNotUnique", func(t *testing.T) { + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + _, err := ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{NodeName: "test", Address: "test"}, + }, + }) + require.NoError(t, err) + + _, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Remote{ + Remote: &inventorypb.AddRemoteNodeRequest{NodeName: "test"}, + }, + }) + tests.AssertGRPCError(t, status.New(codes.AlreadyExists, `Node with name "test" already exists.`), err) + }) +} diff --git a/managed/services/inventory/services.go b/managed/services/inventory/services.go index a742b24c92..89e6d3b966 100644 --- a/managed/services/inventory/services.go +++ b/managed/services/inventory/services.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -24,6 +24,7 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services" + "github.com/percona/pmm/managed/services/management/common" ) // ServicesService works with inventory API Services. @@ -381,18 +382,10 @@ func (ss *ServicesService) AddCustomLabels(ctx context.Context, req *inventorypb return nil, errTx } - // Update scrape configuration - ss.vmdb.RequestConfigurationUpdate() - - agents, err := models.FindPMMAgentsForService(ss.db.Querier, req.ServiceId) - if err != nil { + if err := ss.updateScrapeConfig(ctx, req.ServiceId); err != nil { return nil, err } - for _, a := range agents { - ss.state.RequestStateUpdate(ctx, a.AgentID) - } - return &inventorypb.AddCustomLabelsResponse{}, nil } @@ -432,17 +425,50 @@ func (ss *ServicesService) RemoveCustomLabels(ctx context.Context, req *inventor return nil, errTx } - // Update scrape configuration + if err := ss.updateScrapeConfig(ctx, req.ServiceId); err != nil { + return nil, err + } + + return &inventorypb.RemoveCustomLabelsResponse{}, nil +} + +// ChangeService changes service configuration. +func (ss *ServicesService) ChangeService(ctx context.Context, mgmtServices common.MgmtServices, params *models.ChangeStandardLabelsParams) error { + if err := mgmtServices.RemoveScheduledTasks(ctx, ss.db, params); err != nil { + return err + } + + errTx := ss.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { + err := models.ChangeStandardLabels(tx.Querier, params.ServiceID, models.ServiceStandardLabelsParams{ + Cluster: params.Cluster, + Environment: params.Environment, + ReplicationSet: params.ReplicationSet, + ExternalGroup: params.ExternalGroup, + }) + return err + }) + if errTx != nil { + return errTx + } + + if err := ss.updateScrapeConfig(ctx, params.ServiceID); err != nil { + return err + } + + return nil +} + +func (ss *ServicesService) updateScrapeConfig(ctx context.Context, serviceID string) error { ss.vmdb.RequestConfigurationUpdate() - agents, err := models.FindPMMAgentsForService(ss.db.Querier, req.ServiceId) + agents, err := models.FindPMMAgentsForService(ss.db.Querier, serviceID) if err != nil { - return nil, err + return err } for _, a := range agents { ss.state.RequestStateUpdate(ctx, a.AgentID) } - return &inventorypb.RemoveCustomLabelsResponse{}, nil + return nil } diff --git a/managed/services/inventory/services_test.go b/managed/services/inventory/services_test.go index e556daf998..40f0d75d0b 100644 --- a/managed/services/inventory/services_test.go +++ b/managed/services/inventory/services_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -33,9 +33,9 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) func setup(t *testing.T) (*ServicesService, *AgentsService, *NodesService, func(t *testing.T), context.Context, *mockPrometheusService) { @@ -104,6 +104,7 @@ func TestServices(t *testing.T) { expectedService := &inventorypb.MySQLService{ ServiceId: "/service_id/00000000-0000-4000-8000-000000000005", ServiceName: "test-mysql", + Cluster: "test-mysql", NodeId: models.PMMServerNodeID, Address: "127.0.0.1", Port: 3306, @@ -259,6 +260,7 @@ func TestServices(t *testing.T) { expectedService := &inventorypb.MySQLService{ ServiceId: "/service_id/00000000-0000-4000-8000-000000000005", ServiceName: "test-mysql-socket", + Cluster: "test-mysql-socket", NodeId: models.PMMServerNodeID, Socket: "/var/run/mysqld/mysqld.sock", } @@ -333,6 +335,7 @@ func TestServices(t *testing.T) { expectedMongoDBService := &inventorypb.MongoDBService{ ServiceId: "/service_id/00000000-0000-4000-8000-000000000005", ServiceName: "test-mongo", + Cluster: "test-mongo", NodeId: models.PMMServerNodeID, Address: "127.0.0.1", Port: 27017, @@ -374,6 +377,7 @@ func TestServices(t *testing.T) { expectedPostgreSQLService := &inventorypb.PostgreSQLService{ ServiceId: "/service_id/00000000-0000-4000-8000-000000000005", ServiceName: "test-postgres", + Cluster: "test-postgres", DatabaseName: "postgres", NodeId: models.PMMServerNodeID, Address: "127.0.0.1", @@ -414,6 +418,7 @@ func TestServices(t *testing.T) { expectedPostgreSQLService := &inventorypb.PostgreSQLService{ ServiceId: "/service_id/00000000-0000-4000-8000-000000000005", ServiceName: "test-postgres", + Cluster: "test-postgres", DatabaseName: "postgres", NodeId: models.PMMServerNodeID, Socket: "/var/run/postgresql", @@ -492,6 +497,7 @@ func TestServices(t *testing.T) { expectedProxySQLService := &inventorypb.ProxySQLService{ ServiceId: "/service_id/00000000-0000-4000-8000-000000000005", ServiceName: "test-proxysql", + Cluster: "test-proxysql", NodeId: models.PMMServerNodeID, Address: "127.0.0.1", Port: 6033, @@ -531,6 +537,7 @@ func TestServices(t *testing.T) { expectedService := &inventorypb.ProxySQLService{ ServiceId: "/service_id/00000000-0000-4000-8000-000000000005", ServiceName: "test-proxysql-socket", + Cluster: "test-proxysql-socket", NodeId: models.PMMServerNodeID, Socket: "/tmp/proxysql.sock", } @@ -602,6 +609,7 @@ func TestServices(t *testing.T) { expectedHAProxyService := &inventorypb.HAProxyService{ ServiceId: "/service_id/00000000-0000-4000-8000-000000000005", ServiceName: "test-haproxy-service", + Cluster: "test-haproxy-service", NodeId: models.PMMServerNodeID, } assert.Equal(t, expectedHAProxyService, actualHAProxyService) @@ -639,6 +647,7 @@ func TestServices(t *testing.T) { expectedExternalService := &inventorypb.ExternalService{ ServiceId: "/service_id/00000000-0000-4000-8000-000000000005", ServiceName: "test-external-service", + Cluster: "test-external-service", NodeId: models.PMMServerNodeID, Group: "external", } @@ -730,6 +739,7 @@ func TestServices(t *testing.T) { expectedService := &inventorypb.MongoDBService{ ServiceId: "/service_id/00000000-0000-4000-8000-000000000005", ServiceName: "test-mongodb-socket", + Cluster: "test-mongodb-socket", NodeId: models.PMMServerNodeID, Socket: "/tmp/mongodb-27017.sock", } diff --git a/managed/services/management/agent.go b/managed/services/management/agent.go index 645c31c7f9..b501440cd5 100644 --- a/managed/services/management/agent.go +++ b/managed/services/management/agent.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/agent_test.go b/managed/services/management/agent_test.go index b79b6f1a14..d88718ba99 100644 --- a/managed/services/management/agent_test.go +++ b/managed/services/management/agent_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -32,9 +32,9 @@ import ( agentv1beta1 "github.com/percona/pmm/api/managementpb/agent" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) var now time.Time diff --git a/managed/services/management/alerting/deps.go b/managed/services/management/alerting/deps.go index 6b21b5387c..42ea52543c 100644 --- a/managed/services/management/alerting/deps.go +++ b/managed/services/management/alerting/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/alerting/mock_grafana_client_test.go b/managed/services/management/alerting/mock_grafana_client_test.go index 917915019c..e57dadf233 100644 --- a/managed/services/management/alerting/mock_grafana_client_test.go +++ b/managed/services/management/alerting/mock_grafana_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package alerting diff --git a/managed/services/management/alerting/service.go b/managed/services/management/alerting/service.go index ff5453959a..cd972dd2b7 100644 --- a/managed/services/management/alerting/service.go +++ b/managed/services/management/alerting/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -32,7 +32,6 @@ import ( "github.com/AlekSi/pointer" "github.com/percona-platform/saas/pkg/alert" "github.com/percona-platform/saas/pkg/common" - "github.com/percona/promconfig" "github.com/pkg/errors" "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" @@ -59,18 +58,6 @@ const ( dirPerm = os.FileMode(0o775) ) -// TemplateInfo represents alerting rule template information from various sources. -// -// TODO We already have models.Template, iav1beta1.Template, and alert.Template. -// -// We probably can remove that type. -type TemplateInfo struct { - alert.Template - Yaml string - Source alerting.TemplateSource - CreatedAt *time.Time -} - // Service is responsible alerting templates and rules creation from them. type Service struct { db *reform.DB @@ -81,7 +68,7 @@ type Service struct { platformPublicKeys []string rw sync.RWMutex - templates map[string]TemplateInfo + templates map[string]models.Template alerting.UnimplementedAlertingServer } @@ -108,7 +95,7 @@ func NewService(db *reform.DB, platformClient *platform.Client, grafanaClient gr grafanaClient: grafanaClient, userTemplatesPath: templatesDir, platformPublicKeys: platformPublicKeys, - templates: make(map[string]TemplateInfo), + templates: make(map[string]models.Template), } return s, nil @@ -125,11 +112,11 @@ func (s *Service) Enabled() bool { } // GetTemplates return collected templates. -func (s *Service) GetTemplates() map[string]TemplateInfo { +func (s *Service) GetTemplates() map[string]models.Template { s.rw.RLock() defer s.rw.RUnlock() - res := make(map[string]TemplateInfo, len(s.templates)) + res := make(map[string]models.Template, len(s.templates)) for n, r := range s.templates { res[n] = r } @@ -142,23 +129,27 @@ func (s *Service) GetTemplates() map[string]TemplateInfo { // User file templates: read from yaml files created by the user in `/srv/alerting/templates`. // User API templates: in the DB created using the API. func (s *Service) CollectTemplates(ctx context.Context) { + var templates []*models.Template builtInTemplates, err := s.loadTemplatesFromAssets(ctx) if err != nil { s.l.Errorf("Failed to load built-in rule templates: %s.", err) return } + templates = append(templates, builtInTemplates...) userDefinedTemplates, err := s.loadTemplatesFromUserFiles(ctx) if err != nil { s.l.Errorf("Failed to load user-defined rule templates: %s.", err) return } + templates = append(templates, userDefinedTemplates...) dbTemplates, err := s.loadTemplatesFromDB() if err != nil { s.l.Errorf("Failed to load rule templates from DB: %s.", err) return } + templates = append(templates, dbTemplates...) saasTemplates, err := s.downloadTemplates(ctx) if err != nil { @@ -166,48 +157,20 @@ func (s *Service) CollectTemplates(ctx context.Context) { // we should still collect and show the Built-In templates. s.l.Errorf("Failed to download rule templates from SaaS: %s.", err) } - - templates := make([]TemplateInfo, 0, len(builtInTemplates)+len(userDefinedTemplates)+len(dbTemplates)+len(saasTemplates)) - - for _, t := range builtInTemplates { - templates = append(templates, TemplateInfo{ - Template: t, - Source: alerting.TemplateSource_BUILT_IN, - }) - } - - for _, t := range userDefinedTemplates { - templates = append(templates, TemplateInfo{ - Template: t, - Source: alerting.TemplateSource_USER_FILE, - }) - } - - for _, t := range saasTemplates { - templates = append(templates, TemplateInfo{ - Template: t, - Source: alerting.TemplateSource_SAAS, - }) - } - - templates = append(templates, dbTemplates...) + templates = append(templates, saasTemplates...) // replace previously stored templates with newly collected ones. s.rw.Lock() defer s.rw.Unlock() - s.templates = make(map[string]TemplateInfo, len(templates)) + s.templates = make(map[string]models.Template, len(templates)) for _, t := range templates { - // TODO Check for name clashes? Allow users to re-define built-in templates? - // Reserve prefix for built-in or user-defined templates? - // https://jira.percona.com/browse/PMM-7023 - - s.templates[t.Name] = t + s.templates[t.Name] = *t } } // loadTemplatesFromAssets loads built-in alerting rule templates from pmm-managed binary's assets. -func (s *Service) loadTemplatesFromAssets(ctx context.Context) ([]alert.Template, error) { - var res []alert.Template +func (s *Service) loadTemplatesFromAssets(ctx context.Context) ([]*models.Template, error) { + var res []*models.Template walkDirFunc := func(path string, d fs.DirEntry, err error) error { if err != nil { return errors.Wrapf(err, "error occurred while traversing templates folder: %s", path) @@ -259,7 +222,12 @@ func (s *Service) loadTemplatesFromAssets(ctx context.Context) ([]alert.Template return errors.Errorf("%s %q: template should contain exactly two annotations: summary and description", path, t.Name) } - res = append(res, t) + tm, err := models.ConvertTemplate(&t, models.BuiltInSource) + if err != nil { + return errors.Wrap(err, "failed to convert alert rule template") + } + + res = append(res, tm) return nil } err := fs.WalkDir(data.AlertRuleTemplates, ".", walkDirFunc) @@ -270,13 +238,13 @@ func (s *Service) loadTemplatesFromAssets(ctx context.Context) ([]alert.Template } // loadTemplatesFromUserFiles loads user's alerting rule templates from /srv/alerting/templates. -func (s *Service) loadTemplatesFromUserFiles(ctx context.Context) ([]alert.Template, error) { +func (s *Service) loadTemplatesFromUserFiles(ctx context.Context) ([]*models.Template, error) { paths, err := dir.FindFilesWithExtensions(s.userTemplatesPath, "yml", "yaml") if err != nil { return nil, errors.Wrap(err, "failed to get paths") } - res := make([]alert.Template, 0, len(paths)) + res := make([]*models.Template, 0, len(paths)) for _, path := range paths { if ctx.Err() != nil { return nil, ctx.Err() @@ -300,89 +268,39 @@ func (s *Service) loadTemplatesFromUserFiles(ctx context.Context) ([]alert.Templ } for _, t := range templates { - if err = validateUserTemplate(&t); err != nil { //nolint:gosec + t := t + if err = validateUserTemplate(&t); err != nil { s.l.Warnf("%s %s", path, err) continue } - res = append(res, t) + tm, err := models.ConvertTemplate(&t, models.UserFileSource) + if err != nil { + return nil, errors.Wrap(err, "failed to convert alert rule template") + } + + res = append(res, tm) } } return res, nil } -func (s *Service) loadTemplatesFromDB() ([]TemplateInfo, error) { - var templates []models.Template - e := s.db.InTransaction(func(tx *reform.TX) error { +func (s *Service) loadTemplatesFromDB() ([]*models.Template, error) { + var templates []*models.Template + errTx := s.db.InTransaction(func(tx *reform.TX) error { var err error templates, err = models.FindTemplates(tx.Querier) return err }) - if e != nil { - return nil, errors.Wrap(e, "failed to load rule templates from DB") + if errTx != nil { + return nil, errors.Wrap(errTx, "failed to load rule templates from DB") } - res := make([]TemplateInfo, 0, len(templates)) - for _, t := range templates { - t := t - params := make([]alert.Parameter, 0, len(t.Params)) - for _, param := range t.Params { - p := alert.Parameter{ - Name: param.Name, - Summary: param.Summary, - Unit: alert.Unit(param.Unit), - Type: alert.Type(param.Type), - } - - if alert.Type(param.Type) == alert.Float { - f := param.FloatParam - - if f.Default != nil { - p.Value = *f.Default - } - - if f.Min != nil && f.Max != nil { - p.Range = []interface{}{*f.Min, *f.Max} - } - } - - params = append(params, p) - } - - labels, err := t.GetLabels() - if err != nil { - return nil, errors.Wrap(err, "failed to load template labels") - } - - annotations, err := t.GetAnnotations() - if err != nil { - return nil, errors.Wrap(err, "failed to load template annotations") - } - - res = append(res, - TemplateInfo{ - Template: alert.Template{ - Name: t.Name, - Version: t.Version, - Summary: t.Summary, - Expr: t.Expr, - Params: params, - For: promconfig.Duration(t.For), - Severity: common.Severity(t.Severity), - Labels: labels, - Annotations: annotations, - }, - Yaml: t.Yaml, - Source: convertSource(t.Source), - CreatedAt: &t.CreatedAt, - }, - ) - } - return res, nil + return templates, nil } // downloadTemplates downloads Percona Alerting templates from Percona Portal. -func (s *Service) downloadTemplates(ctx context.Context) ([]alert.Template, error) { +func (s *Service) downloadTemplates(ctx context.Context) ([]*models.Template, error) { settings, err := models.GetSettings(s.db) if err != nil { return nil, err @@ -415,7 +333,17 @@ func (s *Service) downloadTemplates(ctx context.Context) ([]alert.Template, erro return nil, err } - return templates, nil + res := make([]*models.Template, 0, len(templates)) + for _, t := range templates { + t := t + tm, err := models.ConvertTemplate(&t, models.SAASSource) + if err != nil { + return nil, errors.Wrap(err, "failed to convert alert rule template") + } + res = append(res, tm) + } + + return res, nil } // validateUserTemplate validates user-provided template (API or file). @@ -468,14 +396,19 @@ func convertSource(source models.Source) alerting.TemplateSource { } } -func convertParamType(t alert.Type) alerting.ParamType { - // TODO: add another types. +func convertParamType(t models.ParamType) alerting.ParamType { switch t { - case alert.Float: + case models.Float: return alerting.ParamType_FLOAT - default: - return alerting.ParamType_PARAM_TYPE_INVALID + case models.Bool: + return alerting.ParamType_BOOL + case models.String: + return alerting.ParamType_STRING } + + // do not add `default:` to make exhaustive linter do its job + + return alerting.ParamType_PARAM_TYPE_INVALID } // ListTemplates returns a list of all collected Alert Rule Templates. @@ -562,32 +495,34 @@ func (s *Service) CreateTemplate(ctx context.Context, req *alerting.CreateTempla templates, err := alert.Parse(strings.NewReader(req.Yaml), pParams) if err != nil { s.l.Errorf("failed to parse rule template form request: +%v", err) - return nil, status.Error(codes.InvalidArgument, "Failed to parse rule template.") - } - - if len(templates) != 1 { - return nil, status.Error(codes.InvalidArgument, "Request should contain exactly one rule template.") + return nil, status.Errorf(codes.InvalidArgument, "Failed to parse rule template: %v.", err) } + uniqueNames := make(map[string]struct{}, len(templates)) for _, t := range templates { + if _, ok := uniqueNames[t.Name]; ok { + return nil, status.Errorf(codes.InvalidArgument, "Template with name '%s' declared more that once.", t.Name) + } + uniqueNames[t.Name] = struct{}{} if err = validateUserTemplate(&t); err != nil { //nolint:gosec return nil, status.Errorf(codes.InvalidArgument, "%s.", err) } } - params := &models.CreateTemplateParams{ - Template: &templates[0], - Yaml: req.Yaml, - Source: models.UserAPISource, - } - - e := s.db.InTransaction(func(tx *reform.TX) error { - var err error - _, err = models.CreateTemplate(tx.Querier, params) - return err + errTx := s.db.InTransaction(func(tx *reform.TX) error { + for _, t := range templates { + t := t + if _, err = models.CreateTemplate(tx.Querier, &models.CreateTemplateParams{ + Template: &t, + Source: models.UserAPISource, + }); err != nil { + return err + } + } + return nil }) - if e != nil { - return nil, e + if errTx != nil { + return nil, errTx } s.CollectTemplates(ctx) @@ -630,7 +565,6 @@ func (s *Service) UpdateTemplate(ctx context.Context, req *alerting.UpdateTempla changeParams := &models.ChangeTemplateParams{ Template: &tmpl, Name: req.Name, - Yaml: req.Yaml, } e := s.db.InTransaction(func(tx *reform.TX) error { @@ -670,37 +604,38 @@ func (s *Service) DeleteTemplate(ctx context.Context, req *alerting.DeleteTempla return &alerting.DeleteTemplateResponse{}, nil } -func convertTemplate(l *logrus.Entry, template TemplateInfo) (*alerting.Template, error) { - var err error +func convertTemplate(l *logrus.Entry, template models.Template) (*alerting.Template, error) { + labels, err := template.GetLabels() + if err != nil { + return nil, errors.WithStack(err) + } + annotations, err := template.GetAnnotations() + if err != nil { + return nil, errors.WithStack(err) + } + t := &alerting.Template{ Name: template.Name, Summary: template.Summary, Expr: template.Expr, - Params: make([]*alerting.ParamDefinition, 0, len(template.Params)), - For: durationpb.New(time.Duration(template.For)), + Params: convertParamDefinitions(l, template.Params), + For: durationpb.New(template.For), Severity: managementpb.Severity(template.Severity), - Labels: template.Labels, - Annotations: template.Annotations, - Source: template.Source, + Labels: labels, + Annotations: annotations, + Source: convertSource(template.Source), Yaml: template.Yaml, } - if template.CreatedAt != nil { - t.CreatedAt = timestamppb.New(*template.CreatedAt) - if err = t.CreatedAt.CheckValid(); err != nil { - return nil, err - } - } - - t.Params, err = convertParamDefinitions(l, template.Params) - if err != nil { + t.CreatedAt = timestamppb.New(template.CreatedAt) + if err = t.CreatedAt.CheckValid(); err != nil { return nil, err } return t, nil } -func convertParamDefinitions(l *logrus.Entry, params []alert.Parameter) ([]*alerting.ParamDefinition, error) { +func convertParamDefinitions(l *logrus.Entry, params models.AlertExprParamsDefinitions) []*alerting.ParamDefinition { res := make([]*alerting.ParamDefinition, 0, len(params)) for _, p := range params { pd := &alerting.ParamDefinition{ @@ -710,37 +645,37 @@ func convertParamDefinitions(l *logrus.Entry, params []alert.Parameter) ([]*aler Type: convertParamType(p.Type), } - var err error switch p.Type { - case alert.Float: + case models.Float: var fp alerting.FloatParamDefinition - if p.Value != nil { - fp.Default, err = p.GetValueForFloat() - if err != nil { - return nil, errors.Wrap(err, "failed to get value for float parameter") + if p.FloatParam != nil { + if p.FloatParam.Default != nil { + fp.Default = *p.FloatParam.Default + fp.HasDefault = true + } + + if p.FloatParam.Min != nil { + fp.Min = *p.FloatParam.Min + fp.HasMin = true } - fp.HasDefault = true - } - if len(p.Range) != 0 { - fp.Min, fp.Max, err = p.GetRangeForFloat() - if err != nil { - return nil, errors.Wrap(err, "failed to get range for float parameter") + if p.FloatParam.Max != nil { + fp.Max = *p.FloatParam.Max + fp.HasMax = true } - fp.HasMin, fp.HasMax = true, true } pd.Value = &alerting.ParamDefinition_Float{Float: &fp} res = append(res, pd) - case alert.Bool, alert.String: + case models.Bool, models.String: l.Warnf("Skipping unsupported parameter type %q.", p.Type) } // do not add `default:` to make exhaustive linter do its job } - return res, nil + return res } // CreateRule creates alert rule from the given template. @@ -781,21 +716,16 @@ func (s *Service) CreateRule(ctx context.Context, req *alerting.CreateRuleReques return nil, status.Errorf(codes.NotFound, "Unknown template %s.", req.TemplateName) } - paramsDefinitions, err := models.ConvertParamsDefinitions(template.Params) - if err != nil { - return nil, err - } - paramsValues, err := convertParamsValuesToModel(req.Params) if err != nil { return nil, err } - if err := validateParameters(paramsDefinitions, paramsValues); err != nil { + if err := validateParameters(template.Params, paramsValues); err != nil { return nil, err } - forDuration := time.Duration(template.For) + forDuration := template.For if req.For != nil { forDuration = req.For.AsDuration() } @@ -816,9 +746,14 @@ func (s *Service) CreateRule(ctx context.Context, req *alerting.CreateRuleReques } } + ta, err := template.GetAnnotations() + if err != nil { + return nil, errors.Wrap(err, "failed to get template annotations") + } + // Copy annotations form template annotations := make(map[string]string) - if err = transformMaps(template.Annotations, annotations, paramsValues.AsStringMap()); err != nil { + if err = transformMaps(ta, annotations, paramsValues.AsStringMap()); err != nil { return nil, errors.Wrap(err, "failed to fill template annotations placeholders") } @@ -828,8 +763,13 @@ func (s *Service) CreateRule(ctx context.Context, req *alerting.CreateRuleReques return nil, errors.Wrap(err, "failed to fill rule labels placeholders") } + tl, err := template.GetLabels() + if err != nil { + return nil, errors.Wrap(err, "failed to get template labels") + } + // Add rule labels - if err = transformMaps(template.Labels, labels, paramsValues.AsStringMap()); err != nil { + if err = transformMaps(tl, labels, paramsValues.AsStringMap()); err != nil { return nil, errors.Wrap(err, "failed to fill template labels placeholders") } @@ -914,11 +854,11 @@ func transformMaps(src map[string]string, dest map[string]string, data map[strin return nil } -func convertParamUnit(u alert.Unit) alerting.ParamUnit { +func convertParamUnit(u models.ParamUnit) alerting.ParamUnit { switch u { - case alert.Percentage: + case models.Percent: return alerting.ParamUnit_PERCENTAGE - case alert.Seconds: + case models.Seconds: return alerting.ParamUnit_SECONDS } diff --git a/managed/services/management/alerting/service_test.go b/managed/services/management/alerting/service_test.go index 9f69f8745d..08bc38d10d 100644 --- a/managed/services/management/alerting/service_test.go +++ b/managed/services/management/alerting/service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/annotation.go b/managed/services/management/annotation.go index 1888130b33..26222cf541 100644 --- a/managed/services/management/annotation.go +++ b/managed/services/management/annotation.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/annotation_test.go b/managed/services/management/annotation_test.go index b44129379f..977a278ae4 100644 --- a/managed/services/management/annotation_test.go +++ b/managed/services/management/annotation_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -30,9 +30,9 @@ import ( "github.com/percona/pmm/api/managementpb" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) func TestAnnotations(t *testing.T) { diff --git a/managed/services/management/azure_database.go b/managed/services/management/azure_database.go index 0db8ebbb8d..dda84b4fae 100644 --- a/managed/services/management/azure_database.go +++ b/managed/services/management/azure_database.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -30,7 +30,7 @@ import ( azurev1beta1 "github.com/percona/pmm/api/managementpb/azure" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" ) const ( diff --git a/managed/services/management/backup/artifacts_service.go b/managed/services/management/backup/artifacts_service.go index e278f6dc34..3f4d212dfc 100644 --- a/managed/services/management/backup/artifacts_service.go +++ b/managed/services/management/backup/artifacts_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/backup/artifacts_service_test.go b/managed/services/management/backup/artifacts_service_test.go index 9dddfd29ae..a60afc3fe6 100644 --- a/managed/services/management/backup/artifacts_service_test.go +++ b/managed/services/management/backup/artifacts_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/backup/backups_service.go b/managed/services/management/backup/backups_service.go index d8fc1ea025..73601293fc 100644 --- a/managed/services/management/backup/backups_service.go +++ b/managed/services/management/backup/backups_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -124,7 +124,7 @@ func (s *BackupsService) StartBackup(ctx context.Context, req *backuppb.StartBac Folder: req.Folder, }) if err != nil { - return nil, convertBackupError(err) + return nil, convertError(err) } return &backuppb.StartBackupResponse{ @@ -154,7 +154,7 @@ func (s *BackupsService) RestoreBackup( id, err := s.backupService.RestoreBackup(ctx, req.ServiceId, req.ArtifactId, req.PitrTimestamp.AsTime()) if err != nil { - return nil, convertRestoreBackupError(err) + return nil, convertError(err) } return &backuppb.RestoreBackupResponse{ @@ -253,7 +253,7 @@ func (s *BackupsService) ScheduleBackup(ctx context.Context, req *backuppb.Sched StartAt: t, }) if err != nil { - return convertModelError(err) + return convertError(err) } id = scheduledTask.ID @@ -328,7 +328,7 @@ func (s *BackupsService) ChangeScheduledBackup(ctx context.Context, req *backupp errTx := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { scheduledTask, err := models.FindScheduledTaskByID(tx.Querier, req.ScheduledBackupId) if err != nil { - return convertModelError(err) + return convertError(err) } var data *models.CommonBackupTaskData @@ -381,7 +381,7 @@ func (s *BackupsService) ChangeScheduledBackup(ctx context.Context, req *backupp err = s.scheduleService.Update(req.ScheduledBackupId, params) - return convertModelError(err) + return convertError(err) }) if errTx != nil { return nil, errTx @@ -647,112 +647,58 @@ func convertModelToBackupModel(dataModel backuppb.DataModel) (models.DataModel, } } -func convertBackupError(backupErr error) error { - if backupErr == nil { +// convertError converts error from Go to API. +func convertError(e error) error { + if e == nil { return nil } var unsupportedAgentErr *agents.AgentNotSupportedError - if errors.As(backupErr, &unsupportedAgentErr) { - return status.Error(codes.FailedPrecondition, backupErr.Error()) + if errors.As(e, &unsupportedAgentErr) { + return status.Error(codes.FailedPrecondition, e.Error()) } var code backuppb.ErrorCode switch { - case errors.Is(backupErr, backup.ErrIncompatibleService): - return status.Error(codes.FailedPrecondition, backupErr.Error()) - case errors.Is(backupErr, backup.ErrXtrabackupNotInstalled): + case errors.Is(e, backup.ErrXtrabackupNotInstalled): code = backuppb.ErrorCode_ERROR_CODE_XTRABACKUP_NOT_INSTALLED - case errors.Is(backupErr, backup.ErrInvalidXtrabackup): + case errors.Is(e, backup.ErrInvalidXtrabackup): code = backuppb.ErrorCode_ERROR_CODE_INVALID_XTRABACKUP - case errors.Is(backupErr, backup.ErrIncompatibleXtrabackup): + case errors.Is(e, backup.ErrIncompatibleXtrabackup): code = backuppb.ErrorCode_ERROR_CODE_INCOMPATIBLE_XTRABACKUP - case errors.Is(backupErr, backup.ErrIncompatibleLocationType): - return status.Error(codes.FailedPrecondition, backupErr.Error()) - case errors.Is(backupErr, backup.ErrIncompatiblePBM): - return status.Error(codes.FailedPrecondition, backupErr.Error()) - - default: - return backupErr - } - - st, err := status.New(codes.FailedPrecondition, backupErr.Error()).WithDetails(&backuppb.Error{ - Code: code, - }) - if err != nil { - return fmt.Errorf("failed to construct status error: %w, restore error: %w", err, backupErr) - } - - return st.Err() -} - -func convertRestoreBackupError(restoreError error) error { - if restoreError == nil { - return nil - } - - var unsupportedAgentErr *agents.AgentNotSupportedError - if errors.As(restoreError, &unsupportedAgentErr) { - return status.Error(codes.FailedPrecondition, restoreError.Error()) - } - - var code backuppb.ErrorCode - switch { - case errors.Is(restoreError, backup.ErrIncompatibleService): - return status.Error(codes.FailedPrecondition, restoreError.Error()) - case errors.Is(restoreError, backup.ErrXtrabackupNotInstalled): - code = backuppb.ErrorCode_ERROR_CODE_XTRABACKUP_NOT_INSTALLED - case errors.Is(restoreError, backup.ErrInvalidXtrabackup): - code = backuppb.ErrorCode_ERROR_CODE_INVALID_XTRABACKUP - case errors.Is(restoreError, backup.ErrIncompatibleXtrabackup): - code = backuppb.ErrorCode_ERROR_CODE_INCOMPATIBLE_XTRABACKUP - case errors.Is(restoreError, backup.ErrIncompatibleTargetMySQL): + case errors.Is(e, backup.ErrIncompatibleTargetMySQL): code = backuppb.ErrorCode_ERROR_CODE_INCOMPATIBLE_TARGET_MYSQL - case errors.Is(restoreError, backup.ErrIncompatibleTargetMongoDB): + case errors.Is(e, backup.ErrIncompatibleTargetMongoDB): code = backuppb.ErrorCode_ERROR_CODE_INCOMPATIBLE_TARGET_MONGODB - case errors.Is(restoreError, backup.ErrTimestampOutOfRange): - return status.Error(codes.OutOfRange, restoreError.Error()) - case errors.Is(restoreError, backup.ErrIncompatibleArtifactMode): - return status.Error(codes.FailedPrecondition, restoreError.Error()) - case errors.Is(restoreError, models.ErrNotFound): - return status.Error(codes.NotFound, restoreError.Error()) - case errors.Is(restoreError, backup.ErrAnotherOperationInProgress): - return status.Error(codes.FailedPrecondition, restoreError.Error()) - case errors.Is(restoreError, backup.ErrArtifactNotReady): - return status.Error(codes.FailedPrecondition, restoreError.Error()) - case errors.Is(restoreError, backup.ErrIncompatiblePBM): - return status.Error(codes.FailedPrecondition, restoreError.Error()) + case errors.Is(e, backup.ErrTimestampOutOfRange): + return status.Error(codes.OutOfRange, e.Error()) + case errors.Is(e, models.ErrNotFound): + return status.Error(codes.NotFound, e.Error()) + case errors.Is(e, models.ErrAlreadyExists): + return status.Error(codes.AlreadyExists, e.Error()) + case errors.Is(e, backup.ErrAnotherOperationInProgress), + errors.Is(e, backup.ErrArtifactNotReady), + errors.Is(e, backup.ErrIncompatiblePBM), + errors.Is(e, backup.ErrIncompatibleLocationType), + errors.Is(e, backup.ErrIncompatibleService), + errors.Is(e, backup.ErrIncompatibleArtifactMode), + errors.Is(e, services.ErrLocationFolderPairAlreadyUsed): + return status.Error(codes.FailedPrecondition, e.Error()) default: - return restoreError + return e } - st, err := status.New(codes.FailedPrecondition, restoreError.Error()).WithDetails(&backuppb.Error{ + st, err := status.New(codes.FailedPrecondition, e.Error()).WithDetails(&backuppb.Error{ Code: code, }) if err != nil { - return fmt.Errorf("failed to construct status error: %w, restore error: %w", err, restoreError) + return fmt.Errorf("failed to construct status error: %w, original error: %w", err, e) } return st.Err() } -func convertModelError(modelError error) error { - if modelError == nil { - return nil - } - - switch { - case errors.Is(modelError, models.ErrNotFound): - return status.Error(codes.NotFound, modelError.Error()) - case errors.Is(modelError, models.ErrAlreadyExists): - return status.Error(codes.AlreadyExists, modelError.Error()) - - default: - return modelError - } -} - // isFolderSafe checks if specified path is safe against traversal attacks. func isFolderSafe(path string) error { if path == "" { diff --git a/managed/services/management/backup/backups_service_test.go b/managed/services/management/backup/backups_service_test.go index e1afdd22a0..07fdd1531f 100644 --- a/managed/services/management/backup/backups_service_test.go +++ b/managed/services/management/backup/backups_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/backup/deps.go b/managed/services/management/backup/deps.go index 5b8b794122..a8493dbe7a 100644 --- a/managed/services/management/backup/deps.go +++ b/managed/services/management/backup/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/backup/locations_service.go b/managed/services/management/backup/locations_service.go index 9b64c835e6..a81dca8aa0 100644 --- a/managed/services/management/backup/locations_service.go +++ b/managed/services/management/backup/locations_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/backup/locations_service_test.go b/managed/services/management/backup/locations_service_test.go index 00bcb2108c..b8e39f107a 100644 --- a/managed/services/management/backup/locations_service_test.go +++ b/managed/services/management/backup/locations_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/backup/mock_aws_s3_test.go b/managed/services/management/backup/mock_aws_s3_test.go index 967f65a60a..5d49f8e9c8 100644 --- a/managed/services/management/backup/mock_aws_s3_test.go +++ b/managed/services/management/backup/mock_aws_s3_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/management/backup/mock_backup_service_test.go b/managed/services/management/backup/mock_backup_service_test.go index e48d837367..c90ef292e7 100644 --- a/managed/services/management/backup/mock_backup_service_test.go +++ b/managed/services/management/backup/mock_backup_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/management/backup/mock_pbm_pitr_service_test.go b/managed/services/management/backup/mock_pbm_pitr_service_test.go index 0200781289..d7e4af696b 100644 --- a/managed/services/management/backup/mock_pbm_pitr_service_test.go +++ b/managed/services/management/backup/mock_pbm_pitr_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/management/backup/mock_removal_service_test.go b/managed/services/management/backup/mock_removal_service_test.go index 220e042193..cca93d0566 100644 --- a/managed/services/management/backup/mock_removal_service_test.go +++ b/managed/services/management/backup/mock_removal_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/management/backup/mock_schedule_service_test.go b/managed/services/management/backup/mock_schedule_service_test.go index 21c17c231b..f9cd4fe2c4 100644 --- a/managed/services/management/backup/mock_schedule_service_test.go +++ b/managed/services/management/backup/mock_schedule_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package backup diff --git a/managed/services/management/backup/restore_history_service.go b/managed/services/management/backup/restore_history_service.go index e54ee8c95a..1c901fc5d6 100644 --- a/managed/services/management/backup/restore_history_service.go +++ b/managed/services/management/backup/restore_history_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/checks.go b/managed/services/management/checks.go index 4589c6ee14..d1d8049c2b 100644 --- a/managed/services/management/checks.go +++ b/managed/services/management/checks.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -122,17 +122,23 @@ func (s *ChecksAPIService) GetFailedChecks(ctx context.Context, req *managementp failedChecks := make([]*managementpb.CheckResult, 0, len(results)) for _, result := range results { + labels := make(map[string]string, len(result.Target.Labels)+len(result.Result.Labels)) + for k, v := range result.Result.Labels { + labels[k] = v + } + for k, v := range result.Target.Labels { + labels[k] = v + } + failedChecks = append(failedChecks, &managementpb.CheckResult{ Summary: result.Result.Summary, CheckName: result.CheckName, Description: result.Result.Description, ReadMoreUrl: result.Result.ReadMoreURL, Severity: managementpb.Severity(result.Result.Severity), - Labels: result.Result.Labels, + Labels: labels, ServiceName: result.Target.ServiceName, ServiceId: result.Target.ServiceID, - AlertId: result.AlertID, - Silenced: result.Silenced, }) } @@ -167,12 +173,7 @@ func (s *ChecksAPIService) GetFailedChecks(ctx context.Context, req *managementp // ToggleCheckAlert toggles the silence state of the check with the provided alertID. func (s *ChecksAPIService) ToggleCheckAlert(ctx context.Context, req *managementpb.ToggleCheckAlertRequest) (*managementpb.ToggleCheckAlertResponse, error) { - err := s.checksService.ToggleCheckAlert(ctx, req.AlertId, req.Silence) - if err != nil { - return nil, errors.Wrapf(err, "failed to toggle silence status of alert with id: %s", req.AlertId) - } - - return &managementpb.ToggleCheckAlertResponse{}, nil + return nil, status.Error(codes.NotFound, "Advisor alerts silencing is not supported anymore.") } // GetSecurityCheckResults returns Security Thread Tool's latest checks results. @@ -240,6 +241,7 @@ func (s *ChecksAPIService) ListSecurityChecks(_ context.Context, _ *managementpb Name: c.Name, Disabled: disabled, Summary: c.Summary, + Family: convertFamily(c.GetFamily()), Description: c.Description, Interval: convertInterval(c.Interval), }) @@ -273,6 +275,7 @@ func (s *ChecksAPIService) ListAdvisors(_ context.Context, _ *managementpb.ListA Name: c.Name, Disabled: disabled, Summary: c.Summary, + Family: convertFamily(c.GetFamily()), Description: c.Description, Interval: convertInterval(c.Interval), }) @@ -282,7 +285,7 @@ func (s *ChecksAPIService) ListAdvisors(_ context.Context, _ *managementpb.ListA Name: a.Name, Description: a.Description, Summary: a.Summary, - Comment: createComment(s.l, a.Checks), + Comment: createComment(a.Checks), Category: a.Category, Checks: checks, }) @@ -291,22 +294,27 @@ func (s *ChecksAPIService) ListAdvisors(_ context.Context, _ *managementpb.ListA return &managementpb.ListAdvisorsResponse{Advisors: res}, nil } -func createComment(l *logrus.Entry, checks []check.Check) string { - checksM := make(map[string]check.Check, len(checks)) +func createComment(checks []check.Check) string { + var mySQL, postgreSQL, mongoDB bool for _, c := range checks { - checksM[c.Name] = c + switch c.GetFamily() { + case check.MySQL: + mySQL = true + case check.PostgreSQL: + postgreSQL = true + case check.MongoDB: + mongoDB = true + } } - mysqlChecks, portgreSQLChecks, mongoDBChecks := services.GroupChecksByDB(l, checksM) - b := make([]string, 0, 3) - if len(mysqlChecks) != 0 { + if mySQL { b = append(b, "MySQL") } - if len(portgreSQLChecks) != 0 { + if postgreSQL { b = append(b, "PostgreSQL") } - if len(mongoDBChecks) != 0 { + if mongoDB { b = append(b, "MongoDB") } @@ -377,6 +385,20 @@ func convertInterval(interval check.Interval) managementpb.SecurityCheckInterval } } +// convertFamily converts check.Family type to managementpb.AdvisorCheckFamily. +func convertFamily(family check.Family) managementpb.AdvisorCheckFamily { + switch family { + case check.MySQL: + return managementpb.AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_MYSQL + case check.PostgreSQL: + return managementpb.AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_POSTGRESQL + case check.MongoDB: + return managementpb.AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_MONGODB + default: + return managementpb.AdvisorCheckFamily_ADVISOR_CHECK_FAMILY_INVALID + } +} + // convertAPIInterval converts managementpb.SecurityCheckInterval type to check.Interval. func convertAPIInterval(interval managementpb.SecurityCheckInterval) (check.Interval, error) { switch interval { diff --git a/managed/services/management/checks_test.go b/managed/services/management/checks_test.go index d630910ffc..bd2e5697d1 100644 --- a/managed/services/management/checks_test.go +++ b/managed/services/management/checks_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -23,7 +23,6 @@ import ( "github.com/percona-platform/saas/pkg/check" "github.com/percona-platform/saas/pkg/common" "github.com/pkg/errors" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -465,8 +464,6 @@ func TestUpdateSecurityChecks(t *testing.T) { func TestCreateComment(t *testing.T) { t.Parallel() - l := logrus.WithField("component", "tests") - testCases := []struct { Name string Comment string @@ -502,7 +499,7 @@ func TestCreateComment(t *testing.T) { t.Run(tc.Name, func(t *testing.T) { t.Parallel() - assert.Equal(t, tc.Comment, createComment(l, tc.Checks)) + assert.Equal(t, tc.Comment, createComment(tc.Checks)) }) } } diff --git a/managed/services/management/common/common.go b/managed/services/management/common/common.go new file mode 100644 index 0000000000..9697e70451 --- /dev/null +++ b/managed/services/management/common/common.go @@ -0,0 +1,126 @@ +// Copyright (C) 2023 Percona LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Package common contains common and cross-service logics. +package common + +import ( + "context" + + "github.com/pkg/errors" + "gopkg.in/reform.v1" + + backuppb "github.com/percona/pmm/api/managementpb/backup" + "github.com/percona/pmm/managed/models" + managementbackup "github.com/percona/pmm/managed/services/management/backup" +) + +// ErrClusterLocked is returned when there is an unfinished job that doesn't allow to change service cluster name. +var ErrClusterLocked = errors.New("cluster/service is locked") + +type MgmtServices struct { + BackupsService *managementbackup.BackupsService + ArtifactsService *managementbackup.ArtifactsService + RestoreHistoryService *managementbackup.RestoreHistoryService +} + +// RemoveScheduledTasks removes scheduled backup tasks and check there are no running backup/restore tasks in case user changes service cluster label. +func (s *MgmtServices) RemoveScheduledTasks(ctx context.Context, db *reform.DB, params *models.ChangeStandardLabelsParams) error { + if params.Cluster == nil { + return nil + } + + service, err := models.FindServiceByID(db.Querier, params.ServiceID) + if err != nil { + return err + } + + var servicesInCurrentCluster, servicesInNewCluster []*models.Service + + if service.Cluster != "" { + servicesInCurrentCluster, err = models.FindServices(db.Querier, models.ServiceFilters{Cluster: service.Cluster}) + if err != nil { + return err + } + } + + if *params.Cluster != "" { + servicesInNewCluster, err = models.FindServices(db.Querier, models.ServiceFilters{Cluster: *params.Cluster}) + if err != nil { + return err + } + } + + allServices := append(servicesInCurrentCluster, servicesInNewCluster...) //nolint:gocritic + allServices = append(allServices, service) + + sMap := make(map[string]struct{}) + for _, service := range allServices { + sMap[service.ServiceID] = struct{}{} + } + + scheduledTasks, err := s.BackupsService.ListScheduledBackups(ctx, &backuppb.ListScheduledBackupsRequest{}) + if err != nil { + return err + } + + // Remove scheduled tasks. + for _, task := range scheduledTasks.ScheduledBackups { + if _, ok := sMap[task.ServiceId]; ok { + _, err = s.BackupsService.RemoveScheduledBackup(ctx, &backuppb.RemoveScheduledBackupRequest{ScheduledBackupId: task.ScheduledBackupId}) + if err != nil { + return err + } + } + } + + // Check no backup tasks running. + artifacts, err := s.ArtifactsService.ListArtifacts(ctx, &backuppb.ListArtifactsRequest{}) + if err != nil { + return err + } + + statusNotFinal := func(status backuppb.BackupStatus) bool { + switch status { + case + backuppb.BackupStatus_BACKUP_STATUS_IN_PROGRESS, + backuppb.BackupStatus_BACKUP_STATUS_PENDING, + backuppb.BackupStatus_BACKUP_STATUS_PAUSED: + return true + default: + return false + } + } + + for _, artifact := range artifacts.Artifacts { + if _, ok := sMap[artifact.ServiceId]; ok && statusNotFinal(artifact.Status) { + return errors.Wrapf(ErrClusterLocked, "there is an unfinished backup job for service %s or other service in the same cluster", service.ServiceID) + } + } + + // Check no restore tasks running. + restores, err := s.RestoreHistoryService.ListRestoreHistory(ctx, &backuppb.ListRestoreHistoryRequest{}) + if err != nil { + return err + } + + for _, restoreItem := range restores.Items { + if _, ok := sMap[restoreItem.ServiceId]; ok && restoreItem.Status == backuppb.RestoreStatus_RESTORE_STATUS_IN_PROGRESS { + return errors.Wrapf(ErrClusterLocked, "there is an unfinished restore job for service %s or other service in the same cluster", service.ServiceID) + } + } + + return nil +} diff --git a/managed/services/management/dbaas/components_service.go b/managed/services/management/dbaas/components_service.go index ffa549968a..e33497aabe 100644 --- a/managed/services/management/dbaas/components_service.go +++ b/managed/services/management/dbaas/components_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/components_service_test.go b/managed/services/management/dbaas/components_service_test.go index 5680fe59bd..3a8198301c 100644 --- a/managed/services/management/dbaas/components_service_test.go +++ b/managed/services/management/dbaas/components_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -36,9 +36,9 @@ import ( dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" pmmversion "github.com/percona/pmm/version" ) diff --git a/managed/services/management/dbaas/db_cluster_service.go b/managed/services/management/dbaas/db_cluster_service.go index 3746727b5c..fd42534e5e 100644 --- a/managed/services/management/dbaas/db_cluster_service.go +++ b/managed/services/management/dbaas/db_cluster_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/db_cluster_service_test.go b/managed/services/management/dbaas/db_cluster_service_test.go index 560b8c8ad0..8afa320443 100644 --- a/managed/services/management/dbaas/db_cluster_service_test.go +++ b/managed/services/management/dbaas/db_cluster_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -34,9 +34,9 @@ import ( dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) const dbKubeconfigTest = ` diff --git a/managed/services/management/dbaas/dbaas_initializer.go b/managed/services/management/dbaas/dbaas_initializer.go index f8b10b6529..155570e388 100644 --- a/managed/services/management/dbaas/dbaas_initializer.go +++ b/managed/services/management/dbaas/dbaas_initializer.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/deps.go b/managed/services/management/dbaas/deps.go index 84509c0236..3f9be6d5f5 100644 --- a/managed/services/management/dbaas/deps.go +++ b/managed/services/management/dbaas/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/kube_clients.go b/managed/services/management/dbaas/kube_clients.go index c6328b4f06..305cf55c7e 100644 --- a/managed/services/management/dbaas/kube_clients.go +++ b/managed/services/management/dbaas/kube_clients.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/kubeconfig_test.go b/managed/services/management/dbaas/kubeconfig_test.go index 4e71660870..670ae780f3 100644 --- a/managed/services/management/dbaas/kubeconfig_test.go +++ b/managed/services/management/dbaas/kubeconfig_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/kubernetes_server.go b/managed/services/management/dbaas/kubernetes_server.go index fcb9ed9aa6..5a72cb79e5 100644 --- a/managed/services/management/dbaas/kubernetes_server.go +++ b/managed/services/management/dbaas/kubernetes_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/kubernetes_server_test.go b/managed/services/management/dbaas/kubernetes_server_test.go index 7a2ea1640b..5794a27d41 100644 --- a/managed/services/management/dbaas/kubernetes_server_test.go +++ b/managed/services/management/dbaas/kubernetes_server_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -40,9 +40,9 @@ import ( dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services/dbaas/kubernetes" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" pmmversion "github.com/percona/pmm/version" ) diff --git a/managed/services/management/dbaas/logs_service.go b/managed/services/management/dbaas/logs_service.go index 6cef57780c..0609f58d7a 100644 --- a/managed/services/management/dbaas/logs_service.go +++ b/managed/services/management/dbaas/logs_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/mock_components_service_test.go b/managed/services/management/dbaas/mock_components_service_test.go index 4e8c1662a6..7e61ec0790 100644 --- a/managed/services/management/dbaas/mock_components_service_test.go +++ b/managed/services/management/dbaas/mock_components_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package dbaas diff --git a/managed/services/management/dbaas/mock_dbaas_client_test.go b/managed/services/management/dbaas/mock_dbaas_client_test.go index 6908f7c2c4..56055f83e4 100644 --- a/managed/services/management/dbaas/mock_dbaas_client_test.go +++ b/managed/services/management/dbaas/mock_dbaas_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package dbaas diff --git a/managed/services/management/dbaas/mock_grafana_client_test.go b/managed/services/management/dbaas/mock_grafana_client_test.go index c74aa84637..e6c5cc9565 100644 --- a/managed/services/management/dbaas/mock_grafana_client_test.go +++ b/managed/services/management/dbaas/mock_grafana_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package dbaas diff --git a/managed/services/management/dbaas/mock_kube_storage_manager_test.go b/managed/services/management/dbaas/mock_kube_storage_manager_test.go index e5f2f146a1..45cf143e0c 100644 --- a/managed/services/management/dbaas/mock_kube_storage_manager_test.go +++ b/managed/services/management/dbaas/mock_kube_storage_manager_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package dbaas diff --git a/managed/services/management/dbaas/mock_kubernetes_client_test.go b/managed/services/management/dbaas/mock_kubernetes_client_test.go index 2dd1b630f0..c4b9e38d31 100644 --- a/managed/services/management/dbaas/mock_kubernetes_client_test.go +++ b/managed/services/management/dbaas/mock_kubernetes_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package dbaas diff --git a/managed/services/management/dbaas/mock_version_service_test.go b/managed/services/management/dbaas/mock_version_service_test.go index b5da686a14..cba073721d 100644 --- a/managed/services/management/dbaas/mock_version_service_test.go +++ b/managed/services/management/dbaas/mock_version_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package dbaas diff --git a/managed/services/management/dbaas/psmdb_cluster_service.go b/managed/services/management/dbaas/psmdb_cluster_service.go index 66365ae9b9..7a9fdea706 100644 --- a/managed/services/management/dbaas/psmdb_cluster_service.go +++ b/managed/services/management/dbaas/psmdb_cluster_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/psmdb_cluster_service_test.go b/managed/services/management/dbaas/psmdb_cluster_service_test.go index 9d51595017..b406675433 100644 --- a/managed/services/management/dbaas/psmdb_cluster_service_test.go +++ b/managed/services/management/dbaas/psmdb_cluster_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -36,9 +36,9 @@ import ( dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services/dbaas/kubernetes" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" pmmversion "github.com/percona/pmm/version" ) diff --git a/managed/services/management/dbaas/pxc_cluster_service.go b/managed/services/management/dbaas/pxc_cluster_service.go index e9b007a197..de510c9998 100644 --- a/managed/services/management/dbaas/pxc_cluster_service.go +++ b/managed/services/management/dbaas/pxc_cluster_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/pxc_cluster_service_test.go b/managed/services/management/dbaas/pxc_cluster_service_test.go index ed2e747f19..d5da41acfd 100644 --- a/managed/services/management/dbaas/pxc_cluster_service_test.go +++ b/managed/services/management/dbaas/pxc_cluster_service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -39,9 +39,9 @@ import ( dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services/dbaas/kubernetes" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" pmmversion "github.com/percona/pmm/version" ) diff --git a/managed/services/management/dbaas/template_service.go b/managed/services/management/dbaas/template_service.go index 527e667857..8680164533 100644 --- a/managed/services/management/dbaas/template_service.go +++ b/managed/services/management/dbaas/template_service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/version_service_client.go b/managed/services/management/dbaas/version_service_client.go index db0fb82cb7..934d9bebba 100644 --- a/managed/services/management/dbaas/version_service_client.go +++ b/managed/services/management/dbaas/version_service_client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/dbaas/version_service_client_test.go b/managed/services/management/dbaas/version_service_client_test.go index 3eb41bff61..fed2e3037e 100644 --- a/managed/services/management/dbaas/version_service_client_test.go +++ b/managed/services/management/dbaas/version_service_client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/deps.go b/managed/services/management/deps.go index 1a873f89a4..9849a0c2f6 100644 --- a/managed/services/management/deps.go +++ b/managed/services/management/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -71,7 +71,6 @@ type checksService interface { DisableChecks(checkNames []string) error EnableChecks(checkNames []string) error ChangeInterval(params map[string]check.Interval) error - ToggleCheckAlert(ctx context.Context, alertID string, newStatus bool) error } // grafanaClient is a subset of methods of grafana.Client used by this package. diff --git a/managed/services/management/external.go b/managed/services/management/external.go index 933e02d990..7bb3253f8c 100644 --- a/managed/services/management/external.go +++ b/managed/services/management/external.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/grpc/actions_server.go b/managed/services/management/grpc/actions_server.go index 64b59b0b70..b1c2ba947a 100644 --- a/managed/services/management/grpc/actions_server.go +++ b/managed/services/management/grpc/actions_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -340,7 +340,7 @@ func (s *actionsServer) StartPostgreSQLShowIndexAction(ctx context.Context, req }, nil } -// StartMongoDBExplainAction starts MongoDB Explain action +// StartMongoDBExplainAction starts MongoDB Explain action. func (s *actionsServer) StartMongoDBExplainAction(ctx context.Context, req *managementpb.StartMongoDBExplainActionRequest) ( *managementpb.StartMongoDBExplainActionResponse, error, ) { diff --git a/managed/services/management/grpc/annotation_server.go b/managed/services/management/grpc/annotation_server.go index ed9da9dea7..47fba492bd 100644 --- a/managed/services/management/grpc/annotation_server.go +++ b/managed/services/management/grpc/annotation_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/grpc/mongodb_server.go b/managed/services/management/grpc/mongodb_server.go index c6c3a41091..201b04fd10 100644 --- a/managed/services/management/grpc/mongodb_server.go +++ b/managed/services/management/grpc/mongodb_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -22,7 +22,7 @@ import ( "github.com/percona/pmm/managed/services/management" ) -// TODO merge into ../mongodb.go +// TODO merge into ../mongodb.go. type mongoDBServer struct { svc *management.MongoDBService diff --git a/managed/services/management/grpc/mysql_server.go b/managed/services/management/grpc/mysql_server.go index 754770bbbc..6753a6c4db 100644 --- a/managed/services/management/grpc/mysql_server.go +++ b/managed/services/management/grpc/mysql_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -22,7 +22,7 @@ import ( "github.com/percona/pmm/managed/services/management" ) -// TODO merge into ../mysql.go +// TODO merge into ../mysql.go. type mySQLServer struct { svc *management.MySQLService diff --git a/managed/services/management/grpc/node_server.go b/managed/services/management/grpc/node_server.go index 57e54e5a30..1191ee3081 100644 --- a/managed/services/management/grpc/node_server.go +++ b/managed/services/management/grpc/node_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -22,7 +22,7 @@ import ( "github.com/percona/pmm/managed/services/management" ) -// TODO merge into ../node.go +// TODO merge into ../node.go. type nodeServer struct { svc *management.NodeService diff --git a/managed/services/management/grpc/postgresql_server.go b/managed/services/management/grpc/postgresql_server.go index cad7f99a94..2908045b4c 100644 --- a/managed/services/management/grpc/postgresql_server.go +++ b/managed/services/management/grpc/postgresql_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -22,7 +22,7 @@ import ( "github.com/percona/pmm/managed/services/management" ) -// TODO merge into ../postgresql.go +// TODO merge into ../postgresql.go. type postgreSQLServer struct { svc *management.PostgreSQLService diff --git a/managed/services/management/grpc/proxysql_server.go b/managed/services/management/grpc/proxysql_server.go index 2394827148..7e8456fbca 100644 --- a/managed/services/management/grpc/proxysql_server.go +++ b/managed/services/management/grpc/proxysql_server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -22,7 +22,7 @@ import ( "github.com/percona/pmm/managed/services/management" ) -// TODO merge into ../proxysql.go +// TODO merge into ../proxysql.go. type proxySQLServer struct { svc *management.ProxySQLService diff --git a/managed/services/management/haproxy.go b/managed/services/management/haproxy.go index a3763f9749..320b7bd1b5 100644 --- a/managed/services/management/haproxy.go +++ b/managed/services/management/haproxy.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/ia/deps.go b/managed/services/management/ia/deps.go deleted file mode 100644 index 12f19bc0a4..0000000000 --- a/managed/services/management/ia/deps.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package ia - -import ( - "context" - - "github.com/percona/pmm/api/alertmanager/ammodels" - "github.com/percona/pmm/managed/services" - "github.com/percona/pmm/managed/services/management/alerting" -) - -//go:generate ../../../../bin/mockery --name=alertManager --case=snake --inpackage --testonly -//go:generate ../../../../bin/mockery --name=vmAlert --case=snake --inpackage --testonly -//go:generate ../../../../bin/mockery --name=templatesService --case=snake --inpackage --testonly - -// alertManager is a subset of methods of alertmanager.Service used by this package. -// We use it instead of real type for testing and to avoid dependency cycle. -type alertManager interface { - GetAlerts(ctx context.Context, params *services.FilterParams) ([]*ammodels.GettableAlert, error) - FindAlertsByID(ctx context.Context, params *services.FilterParams, ids []string) ([]*ammodels.GettableAlert, error) - SilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error - UnsilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error - RequestConfigurationUpdate() -} - -// vmAlert is a subset of methods of vmalert.Service used by this package. -// We use it instead of real type for testing and to avoid dependency cycle. -type vmAlert interface { - RequestConfigurationUpdate() -} - -type templatesService interface { - GetTemplates() map[string]alerting.TemplateInfo -} diff --git a/managed/services/management/ia/mock_alert_manager_test.go b/managed/services/management/ia/mock_alert_manager_test.go deleted file mode 100644 index 807ea6bb70..0000000000 --- a/managed/services/management/ia/mock_alert_manager_test.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. - -package ia - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - ammodels "github.com/percona/pmm/api/alertmanager/ammodels" - services "github.com/percona/pmm/managed/services" -) - -// mockAlertManager is an autogenerated mock type for the alertManager type -type mockAlertManager struct { - mock.Mock -} - -// FindAlertsByID provides a mock function with given fields: ctx, params, ids -func (_m *mockAlertManager) FindAlertsByID(ctx context.Context, params *services.FilterParams, ids []string) ([]*ammodels.GettableAlert, error) { - ret := _m.Called(ctx, params, ids) - - var r0 []*ammodels.GettableAlert - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams, []string) ([]*ammodels.GettableAlert, error)); ok { - return rf(ctx, params, ids) - } - if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams, []string) []*ammodels.GettableAlert); ok { - r0 = rf(ctx, params, ids) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*ammodels.GettableAlert) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *services.FilterParams, []string) error); ok { - r1 = rf(ctx, params, ids) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetAlerts provides a mock function with given fields: ctx, params -func (_m *mockAlertManager) GetAlerts(ctx context.Context, params *services.FilterParams) ([]*ammodels.GettableAlert, error) { - ret := _m.Called(ctx, params) - - var r0 []*ammodels.GettableAlert - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) ([]*ammodels.GettableAlert, error)); ok { - return rf(ctx, params) - } - if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) []*ammodels.GettableAlert); ok { - r0 = rf(ctx, params) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*ammodels.GettableAlert) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *services.FilterParams) error); ok { - r1 = rf(ctx, params) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RequestConfigurationUpdate provides a mock function with given fields: -func (_m *mockAlertManager) RequestConfigurationUpdate() { - _m.Called() -} - -// SilenceAlerts provides a mock function with given fields: ctx, alerts -func (_m *mockAlertManager) SilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error { - ret := _m.Called(ctx, alerts) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []*ammodels.GettableAlert) error); ok { - r0 = rf(ctx, alerts) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UnsilenceAlerts provides a mock function with given fields: ctx, alerts -func (_m *mockAlertManager) UnsilenceAlerts(ctx context.Context, alerts []*ammodels.GettableAlert) error { - ret := _m.Called(ctx, alerts) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []*ammodels.GettableAlert) error); ok { - r0 = rf(ctx, alerts) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// newMockAlertManager creates a new instance of mockAlertManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockAlertManager(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockAlertManager { - mock := &mockAlertManager{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/management/ia/mock_templates_service_test.go b/managed/services/management/ia/mock_templates_service_test.go deleted file mode 100644 index fd979a674c..0000000000 --- a/managed/services/management/ia/mock_templates_service_test.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. - -package ia - -import ( - mock "github.com/stretchr/testify/mock" - - alerting "github.com/percona/pmm/managed/services/management/alerting" -) - -// mockTemplatesService is an autogenerated mock type for the templatesService type -type mockTemplatesService struct { - mock.Mock -} - -// GetTemplates provides a mock function with given fields: -func (_m *mockTemplatesService) GetTemplates() map[string]alerting.TemplateInfo { - ret := _m.Called() - - var r0 map[string]alerting.TemplateInfo - if rf, ok := ret.Get(0).(func() map[string]alerting.TemplateInfo); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]alerting.TemplateInfo) - } - } - - return r0 -} - -// newMockTemplatesService creates a new instance of mockTemplatesService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockTemplatesService(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockTemplatesService { - mock := &mockTemplatesService{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/management/ia/mock_vm_alert_test.go b/managed/services/management/ia/mock_vm_alert_test.go deleted file mode 100644 index f4d881db5e..0000000000 --- a/managed/services/management/ia/mock_vm_alert_test.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. - -package ia - -import mock "github.com/stretchr/testify/mock" - -// mockVmAlert is an autogenerated mock type for the vmAlert type -type mockVmAlert struct { - mock.Mock -} - -// RequestConfigurationUpdate provides a mock function with given fields: -func (_m *mockVmAlert) RequestConfigurationUpdate() { - _m.Called() -} - -// newMockVmAlert creates a new instance of mockVmAlert. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockVmAlert(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockVmAlert { - mock := &mockVmAlert{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/management/management.go b/managed/services/management/management.go index e45bbc22fd..fcf312062c 100644 --- a/managed/services/management/management.go +++ b/managed/services/management/management.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/mock_agents_registry_test.go b/managed/services/management/mock_agents_registry_test.go index 0dbb0951da..389a81139a 100644 --- a/managed/services/management/mock_agents_registry_test.go +++ b/managed/services/management/mock_agents_registry_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package management diff --git a/managed/services/management/mock_agents_state_updater_test.go b/managed/services/management/mock_agents_state_updater_test.go index ce3b259251..2115c2a4a8 100644 --- a/managed/services/management/mock_agents_state_updater_test.go +++ b/managed/services/management/mock_agents_state_updater_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package management diff --git a/managed/services/management/mock_api_key_provider_test.go b/managed/services/management/mock_api_key_provider_test.go index 212d9665c4..45ebeb1966 100644 --- a/managed/services/management/mock_api_key_provider_test.go +++ b/managed/services/management/mock_api_key_provider_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package management diff --git a/managed/services/management/mock_checks_service_test.go b/managed/services/management/mock_checks_service_test.go index b8e56ad71e..d28cd5cb01 100644 --- a/managed/services/management/mock_checks_service_test.go +++ b/managed/services/management/mock_checks_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package management @@ -202,20 +202,6 @@ func (_m *mockChecksService) StartChecks(checkNames []string) error { return r0 } -// ToggleCheckAlert provides a mock function with given fields: ctx, alertID, newStatus -func (_m *mockChecksService) ToggleCheckAlert(ctx context.Context, alertID string, newStatus bool) error { - ret := _m.Called(ctx, alertID, newStatus) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, bool) error); ok { - r0 = rf(ctx, alertID, newStatus) - } else { - r0 = ret.Error(0) - } - - return r0 -} - // newMockChecksService creates a new instance of mockChecksService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func newMockChecksService(t interface { diff --git a/managed/services/management/mock_connection_checker_test.go b/managed/services/management/mock_connection_checker_test.go index fba5fbe20e..89be9f50d8 100644 --- a/managed/services/management/mock_connection_checker_test.go +++ b/managed/services/management/mock_connection_checker_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package management diff --git a/managed/services/management/mock_grafana_client_test.go b/managed/services/management/mock_grafana_client_test.go index 47f47484f8..d170c74447 100644 --- a/managed/services/management/mock_grafana_client_test.go +++ b/managed/services/management/mock_grafana_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package management diff --git a/managed/services/management/mock_jobs_service_test.go b/managed/services/management/mock_jobs_service_test.go index 22e2e7baf3..67acf51ef5 100644 --- a/managed/services/management/mock_jobs_service_test.go +++ b/managed/services/management/mock_jobs_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package management diff --git a/managed/services/management/mock_prometheus_service_test.go b/managed/services/management/mock_prometheus_service_test.go index 2c7ae426f1..974768fb28 100644 --- a/managed/services/management/mock_prometheus_service_test.go +++ b/managed/services/management/mock_prometheus_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package management diff --git a/managed/services/management/mock_version_cache_test.go b/managed/services/management/mock_version_cache_test.go index 55b49d89ed..fd25485e30 100644 --- a/managed/services/management/mock_version_cache_test.go +++ b/managed/services/management/mock_version_cache_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package management diff --git a/managed/services/management/mock_victoria_metrics_client_test.go b/managed/services/management/mock_victoria_metrics_client_test.go index 3a9733f06b..f94d27b297 100644 --- a/managed/services/management/mock_victoria_metrics_client_test.go +++ b/managed/services/management/mock_victoria_metrics_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package management diff --git a/managed/services/management/mongodb.go b/managed/services/management/mongodb.go index de7d063415..e016d47aa5 100644 --- a/managed/services/management/mongodb.go +++ b/managed/services/management/mongodb.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/mysql.go b/managed/services/management/mysql.go index 5493bbdffb..e67f05eced 100644 --- a/managed/services/management/mysql.go +++ b/managed/services/management/mysql.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/node.go b/managed/services/management/node.go index 0c17d5e3ea..f8a43a2220 100644 --- a/managed/services/management/node.go +++ b/managed/services/management/node.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/node_mgmt.go b/managed/services/management/node_mgmt.go index 694706b116..cacc35a460 100644 --- a/managed/services/management/node_mgmt.go +++ b/managed/services/management/node_mgmt.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/node_mgmt_test.go b/managed/services/management/node_mgmt_test.go index 6cf7582e84..92ca762c90 100644 --- a/managed/services/management/node_mgmt_test.go +++ b/managed/services/management/node_mgmt_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -35,9 +35,9 @@ import ( "github.com/percona/pmm/api/inventorypb" nodev1beta1 "github.com/percona/pmm/api/managementpb/node" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) func TestMgmtNodeService(t *testing.T) { diff --git a/managed/services/management/node_test.go b/managed/services/management/node_test.go index eeb6ad0a28..8f6bcf9f14 100644 --- a/managed/services/management/node_test.go +++ b/managed/services/management/node_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -31,9 +31,9 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/api/managementpb" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) func TestNodeService(t *testing.T) { diff --git a/managed/services/management/postgresql.go b/managed/services/management/postgresql.go index dfdf559fa4..536d593b42 100644 --- a/managed/services/management/postgresql.go +++ b/managed/services/management/postgresql.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/proxysql.go b/managed/services/management/proxysql.go index 88b883bfff..d356b8b321 100644 --- a/managed/services/management/proxysql.go +++ b/managed/services/management/proxysql.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/rds.go b/managed/services/management/rds.go index ce79abf322..a669e2c472 100644 --- a/managed/services/management/rds.go +++ b/managed/services/management/rds.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -39,11 +39,11 @@ import ( "github.com/percona/pmm/api/managementpb" "github.com/percona/pmm/managed/models" "github.com/percona/pmm/managed/services" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" ) const ( - // Maximum time for AWS discover APIs calls + // Maximum time for AWS discover APIs calls. awsDiscoverTimeout = 7 * time.Second ) @@ -66,7 +66,7 @@ func NewRDSService(db *reform.DB, state agentsStateUpdater, cc connectionChecker } var ( - // See https://pkg.go.dev/github.com/aws/aws-sdk-go/service/rds?tab=doc#CreateDBInstanceInput, Engine field + // See https://pkg.go.dev/github.com/aws/aws-sdk-go/service/rds?tab=doc#CreateDBInstanceInput, Engine field. rdsEngines = map[string]managementpb.DiscoverRDSEngine{ "aurora-mysql": managementpb.DiscoverRDSEngine_DISCOVER_RDS_MYSQL, // MySQL 5.7-compatible Aurora @@ -387,6 +387,7 @@ func (s *RDSService) AddRDS(ctx context.Context, req *managementpb.AddRDSRequest CustomLabels: req.CustomLabels, Address: &req.Address, Port: pointer.ToUint16(uint16(req.Port)), + Database: req.Database, }) if err != nil { return err diff --git a/managed/services/management/rds_test.go b/managed/services/management/rds_test.go index b40fdcaed0..3cac4518e4 100644 --- a/managed/services/management/rds_test.go +++ b/managed/services/management/rds_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -38,9 +38,9 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/api/managementpb" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) func TestRDSService(t *testing.T) { @@ -88,6 +88,7 @@ func TestRDSService(t *testing.T) { "eu-west-1", "eu-west-2", "eu-west-3", + "il-central-1", "me-central-1", "me-south-1", "sa-east-1", diff --git a/managed/services/management/role.go b/managed/services/management/role.go index c8164c8e52..2448ee88dc 100644 --- a/managed/services/management/role.go +++ b/managed/services/management/role.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/role_test.go b/managed/services/management/role_test.go index b23e6270ed..5aeaa57c24 100644 --- a/managed/services/management/role_test.go +++ b/managed/services/management/role_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -28,9 +28,9 @@ import ( rolev1beta1 "github.com/percona/pmm/api/managementpb/role" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) //nolint:paralleltest diff --git a/managed/services/management/service.go b/managed/services/management/service.go index 4d9a49f68a..e659a31375 100644 --- a/managed/services/management/service.go +++ b/managed/services/management/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/service_mgmt.go b/managed/services/management/service_mgmt.go index aefa0dcc63..73f3febf5d 100644 --- a/managed/services/management/service_mgmt.go +++ b/managed/services/management/service_mgmt.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/management/service_mgmt_test.go b/managed/services/management/service_mgmt_test.go index 5946195c91..29f783428d 100644 --- a/managed/services/management/service_mgmt_test.go +++ b/managed/services/management/service_mgmt_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -30,9 +30,9 @@ import ( servicev1beta1 "github.com/percona/pmm/api/managementpb/service" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) func TestMgmtServiceService(t *testing.T) { diff --git a/managed/services/management/service_test.go b/managed/services/management/service_test.go index 4aaca4ce96..0c4c535d9d 100644 --- a/managed/services/management/service_test.go +++ b/managed/services/management/service_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -32,9 +32,9 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/api/managementpb" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" "github.com/percona/pmm/managed/utils/tests" + "github.com/percona/pmm/utils/logger" ) func TestServiceService(t *testing.T) { diff --git a/managed/services/minio/client.go b/managed/services/minio/client.go index 103ac3b19d..037d6c84cb 100644 --- a/managed/services/minio/client.go +++ b/managed/services/minio/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/platform/deps.go b/managed/services/platform/deps.go index 501299f19a..ce6e4c2f09 100644 --- a/managed/services/platform/deps.go +++ b/managed/services/platform/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/platform/platform.go b/managed/services/platform/platform.go index 5af433c5db..4b75510ed9 100644 --- a/managed/services/platform/platform.go +++ b/managed/services/platform/platform.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/preconditions.go b/managed/services/preconditions.go index 6f2f40293c..8df82edd78 100644 --- a/managed/services/preconditions.go +++ b/managed/services/preconditions.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -17,6 +17,7 @@ package services import ( "github.com/AlekSi/pointer" + "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "gopkg.in/reform.v1" @@ -25,7 +26,8 @@ import ( ) // CheckMongoDBBackupPreconditions checks compatibility of different types of scheduled backups and on-demand backups for MongoDB. -// WARNING: This function valid only when executed as part of transaction with serializable isolation level. +// +// WARNING: This function is valid only when executed as part of transaction with serializable isolation level. func CheckMongoDBBackupPreconditions(q *reform.Querier, mode models.BackupMode, clusterName, serviceID, scheduleID string) error { filter := models.ScheduledTasksFilter{ Disabled: pointer.ToBool(false), @@ -87,3 +89,88 @@ func CheckMongoDBBackupPreconditions(q *reform.Querier, mode models.BackupMode, return nil } + +// CheckArtifactOverlapping checks if there are other artifacts or scheduled tasks pointing to the same location and folder. +// Placing MySQL and MongoDB artifacts in the same folder is not desirable, while placing MongoDB artifacts of different clusters +// in the same folder may cause data inconsistency. +// +// WARNING: This function is valid only when executed as part of transaction with serializable isolation level. +func CheckArtifactOverlapping(q *reform.Querier, serviceID, locationID, folder string) error { + // TODO This doesn't work for all cases. For example, there may exist more than one storage locations pointing to the same place. + + const ( + usedByArtifactMsg = "Same location and folder already used for artifact %s of other service: %s" + usedByScheduledTaskMsg = "Same location and folder already used for scheduled task %s of other service: %s" + ) + + service, err := models.FindServiceByID(q, serviceID) + if err != nil { + return err + } + + artifacts, err := models.FindArtifacts(q, models.ArtifactFilters{ + LocationID: locationID, + Folder: &folder, + }) + if err != nil { + return err + } + + for _, artifact := range artifacts { + // We skip artifacts made on services that are no longer exists in PMM. However, in future we can improve this function + // by storing required information right in artifact model. + if artifact.ServiceID != "" && artifact.ServiceID != serviceID { + svc, err := models.FindServiceByID(q, artifact.ServiceID) + if err != nil { + return err + } + + if service.ServiceType == models.MySQLServiceType && svc.ServiceType == models.MySQLServiceType { + continue + } + + if service.ServiceType == models.MongoDBServiceType && svc.ServiceType == models.MongoDBServiceType { + if svc.Cluster != service.Cluster { + return errors.Wrapf(ErrLocationFolderPairAlreadyUsed, usedByArtifactMsg, artifact.ID, serviceID) + } + continue + } + + return errors.Wrapf(ErrLocationFolderPairAlreadyUsed, usedByArtifactMsg, artifact.ID, serviceID) + } + } + + tasks, err := models.FindScheduledTasks(q, models.ScheduledTasksFilter{ + LocationID: locationID, + Folder: &folder, + }) + if err != nil { + return err + } + + var svcID string + + for _, task := range tasks { + svcID, err = task.ServiceID() + if err != nil { + return err + } + + if svcID != serviceID { + if service.ServiceType == models.MySQLServiceType && task.Type == models.ScheduledMySQLBackupTask { + continue + } + + if service.ServiceType == models.MongoDBServiceType && task.Type == models.ScheduledMongoDBBackupTask { + if task.Data.MongoDBBackupTask.ClusterName != service.Cluster { + return errors.Wrapf(ErrLocationFolderPairAlreadyUsed, usedByScheduledTaskMsg, task.ID, serviceID) + } + continue + } + + return errors.Wrapf(ErrLocationFolderPairAlreadyUsed, usedByScheduledTaskMsg, task.ID, serviceID) + } + } + + return nil +} diff --git a/managed/services/preconditions_test.go b/managed/services/preconditions_test.go index 323da39472..259b09e4db 100644 --- a/managed/services/preconditions_test.go +++ b/managed/services/preconditions_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -19,7 +19,10 @@ import ( "context" "database/sql" "testing" + "time" + "github.com/AlekSi/pointer" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -144,3 +147,124 @@ func TestCheckMongoDBBackupPreconditions(t *testing.T) { tests.AssertGRPCError(t, status.New(codes.InvalidArgument, "Incremental backups unsupported for MongoDB"), err) }) } + +func TestCheckArtifactOverlapping(t *testing.T) { + sqlDB := testdb.Open(t, models.SkipFixtures, nil) + db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) + t.Cleanup(func() { + require.NoError(t, sqlDB.Close()) + }) + + folder1, folder2 := "folder1", "folder2" + + node, err := models.CreateNode(db.Querier, models.GenericNodeType, &models.CreateNodeParams{ + NodeName: "test-node", + }) + require.NoError(t, err) + + mongoSvc1, err := models.AddNewService(db.Querier, models.MongoDBServiceType, &models.AddDBMSServiceParams{ + ServiceName: "mongodb1", + NodeID: node.NodeID, + Address: pointer.ToString("127.0.0.1"), + Port: pointer.ToUint16(60000), + Cluster: "cluster1", + }) + require.NoError(t, err) + + mongoSvc2, err := models.AddNewService(db.Querier, models.MongoDBServiceType, &models.AddDBMSServiceParams{ + ServiceName: "mongodb2", + NodeID: node.NodeID, + Address: pointer.ToString("127.0.0.1"), + Port: pointer.ToUint16(60000), + Cluster: "cluster1", + }) + require.NoError(t, err) + + mongoSvc3, err := models.AddNewService(db.Querier, models.MongoDBServiceType, &models.AddDBMSServiceParams{ + ServiceName: "mongodb3", + NodeID: node.NodeID, + Address: pointer.ToString("127.0.0.1"), + Port: pointer.ToUint16(60000), + Cluster: "cluster2", + }) + require.NoError(t, err) + + mysqlSvc1, err := models.AddNewService(db.Querier, models.MySQLServiceType, &models.AddDBMSServiceParams{ + ServiceName: "mysql1", + NodeID: node.NodeID, + Address: pointer.ToString("127.0.0.1"), + Port: pointer.ToUint16(60000), + Cluster: "mysql_cluster_1", + }) + require.NoError(t, err) + + mysqlSvc2, err := models.AddNewService(db.Querier, models.MySQLServiceType, &models.AddDBMSServiceParams{ + ServiceName: "mysql2", + NodeID: node.NodeID, + Address: pointer.ToString("127.0.0.1"), + Port: pointer.ToUint16(60000), + Cluster: "mysql_cluster_2", + }) + require.NoError(t, err) + + location, err := models.CreateBackupLocation(db.Querier, models.CreateBackupLocationParams{ + Name: "test_location", + BackupLocationConfig: models.BackupLocationConfig{ + FilesystemConfig: &models.FilesystemLocationConfig{ + Path: "/tmp", + }, + }, + }) + require.NoError(t, err) + + _, err = models.CreateScheduledTask(db.Querier, models.CreateScheduledTaskParams{ + CronExpression: "* * * * *", + StartAt: time.Now().Truncate(time.Second).UTC(), + Type: models.ScheduledMongoDBBackupTask, + Data: &models.ScheduledTaskData{ + MongoDBBackupTask: &models.MongoBackupTaskData{ + CommonBackupTaskData: models.CommonBackupTaskData{ + ServiceID: mongoSvc1.ServiceID, + LocationID: location.ID, + Name: "test", + Description: "test backup task", + DataModel: models.LogicalDataModel, + Mode: models.Snapshot, + Retention: 7, + Retries: 3, + RetryInterval: 5 * time.Second, + ClusterName: "cluster1", + Folder: folder1, + }, + }, + }, + }) + require.NoError(t, err) + + _, err = models.CreateArtifact(db.Querier, models.CreateArtifactParams{ + Name: "test_artifact", + Vendor: "mysql", + LocationID: location.ID, + ServiceID: mysqlSvc1.ServiceID, + DataModel: models.LogicalDataModel, + Mode: models.Snapshot, + Status: models.SuccessBackupStatus, + Folder: folder2, + }) + require.NoError(t, err) + + err = CheckArtifactOverlapping(db.Querier, mongoSvc2.ServiceID, location.ID, folder1) + assert.NoError(t, err) + + err = CheckArtifactOverlapping(db.Querier, mongoSvc3.ServiceID, location.ID, folder1) + assert.ErrorIs(t, err, ErrLocationFolderPairAlreadyUsed) + + err = CheckArtifactOverlapping(db.Querier, mysqlSvc1.ServiceID, location.ID, folder1) + assert.ErrorIs(t, err, ErrLocationFolderPairAlreadyUsed) + + err = CheckArtifactOverlapping(db.Querier, mysqlSvc2.ServiceID, location.ID, folder2) + assert.NoError(t, err) + + err = CheckArtifactOverlapping(db.Querier, mongoSvc1.ServiceID, location.ID, folder2) + assert.ErrorIs(t, err, ErrLocationFolderPairAlreadyUsed) +} diff --git a/managed/services/qan/client.go b/managed/services/qan/client.go index 4b48c8e172..b84f4b87e8 100644 --- a/managed/services/qan/client.go +++ b/managed/services/qan/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -141,6 +141,21 @@ func (c *Client) ExplainFingerprintByQueryID(ctx context.Context, serviceID, que return res, nil } +// SchemaByQueryID returns schema for given queryID and serviceID. +func (c *Client) SchemaByQueryID(ctx context.Context, serviceID, queryID string) (*qanpb.SchemaByQueryIDReply, error) { + qanReq := &qanpb.SchemaByQueryIDRequest{ + ServiceId: serviceID, + QueryId: queryID, + } + c.l.Debugf("%+v", qanReq) + res, err := c.odc.SchemaByQueryID(ctx, qanReq) + if err != nil { + return nil, err + } + + return res, nil +} + // Collect adds labels to the data from pmm-agent and sends it to qan-api. func (c *Client) Collect(ctx context.Context, metricsBuckets []*agentpb.MetricsBucket) error { start := time.Now() diff --git a/managed/services/qan/client_test.go b/managed/services/qan/client_test.go index bb4bede570..dce12fce95 100644 --- a/managed/services/qan/client_test.go +++ b/managed/services/qan/client_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -33,8 +33,8 @@ import ( "github.com/percona/pmm/api/inventorypb" qanpb "github.com/percona/pmm/api/qanpb" "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/logger" "github.com/percona/pmm/managed/utils/testdb" + "github.com/percona/pmm/utils/logger" "github.com/percona/pmm/utils/sqlmetrics" ) @@ -185,6 +185,7 @@ func TestClient(t *testing.T) { MQueryTimeSum: 1234, ServiceId: "/service_id/014647c3-b2f5-44eb-94f4-d943260a968c", ServiceName: "test-mysql", + Cluster: "test-mysql", ServiceType: "mysql", NodeId: "/node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d", NodeName: "test-generic-node", @@ -254,6 +255,7 @@ func TestClient(t *testing.T) { NumQueries: 1, ServiceId: "/service_id/1fce2502-ecc7-46d4-968b-18d7907f2543", ServiceName: "test-mongodb", + Cluster: "test-mongodb", ServiceType: "mongodb", NodeId: "/node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d", NodeName: "test-generic-node", @@ -352,6 +354,7 @@ func TestClient(t *testing.T) { MQueryTimeCnt: 1, MQueryTimeSum: 55, ServiceName: "test-postgresql", + Cluster: "test-postgresql", ServiceType: "postgresql", ServiceId: "/service_id/9cffbdd4-3cd2-47f8-a5f9-a749c3d5fee1", NodeId: "/node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d", @@ -492,6 +495,7 @@ func TestClientPerformance(t *testing.T) { expectedBuckets[i] = &qanpb.MetricsBucket{ Queryid: fmt.Sprintf("bucket %d", i), ServiceName: "test-mysql", + Cluster: "test-mysql", NodeId: "pmm-server", NodeName: "pmm-server", NodeType: "generic", diff --git a/managed/services/qan/deps.go b/managed/services/qan/deps.go index f745e18e53..77ce35a6e6 100644 --- a/managed/services/qan/deps.go +++ b/managed/services/qan/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/qan/mock_qan_collector_client_test.go b/managed/services/qan/mock_qan_collector_client_test.go index d865ccac66..ba851fb0c2 100644 --- a/managed/services/qan/mock_qan_collector_client_test.go +++ b/managed/services/qan/mock_qan_collector_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package qan diff --git a/managed/services/scheduler/deps.go b/managed/services/scheduler/deps.go index 0820f524b5..e0faed3bbf 100644 --- a/managed/services/scheduler/deps.go +++ b/managed/services/scheduler/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/scheduler/mock_backup_service_test.go b/managed/services/scheduler/mock_backup_service_test.go index ca8449ad96..3973ae0e3e 100644 --- a/managed/services/scheduler/mock_backup_service_test.go +++ b/managed/services/scheduler/mock_backup_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package scheduler diff --git a/managed/services/scheduler/scheduler.go b/managed/services/scheduler/scheduler.go index 40b3d854c3..bce97c3832 100644 --- a/managed/services/scheduler/scheduler.go +++ b/managed/services/scheduler/scheduler.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -87,7 +87,7 @@ func (s *Service) Add(task Task, params AddParams) (*models.ScheduledTask, error // This transaction is valid only with serializable isolation level. On lower isolation levels it can produce anomalies. errTx := s.db.InTransactionContext(s.db.Querier.Context(), &sql.TxOptions{Isolation: sql.LevelSerializable}, func(tx *reform.TX) error { var err error - if err = checkPreconditions(tx.Querier, task.Data(), !params.Disabled, ""); err != nil { + if err = checkAddPreconditions(tx.Querier, task.Data(), !params.Disabled, ""); err != nil { return err } scheduledTask, err = models.CreateScheduledTask(tx.Querier, models.CreateScheduledTaskParams{ @@ -158,7 +158,7 @@ func (s *Service) Remove(id string) error { // Update changes scheduled task in DB and re-add it to scheduler. func (s *Service) Update(id string, params models.ChangeScheduledTaskParams) error { return s.db.InTransactionContext(s.db.Querier.Context(), &sql.TxOptions{Isolation: sql.LevelSerializable}, func(tx *reform.TX) error { - if err := checkPreconditions(tx.Querier, params.Data, !pointer.GetBool(params.Disable), id); err != nil { + if err := checkUpdatePreconditions(tx.Querier, params.Data, !pointer.GetBool(params.Disable), id); err != nil { return err } @@ -352,7 +352,29 @@ func (s *Service) convertDBTask(dbTask *models.ScheduledTask) (Task, error) { // return task, nil } -func checkPreconditions(q *reform.Querier, data *models.ScheduledTaskData, enabled bool, scheduledTaskID string) error { +func checkAddPreconditions(q *reform.Querier, data *models.ScheduledTaskData, enabled bool, scheduledTaskID string) error { + switch { + case data.MySQLBackupTask != nil: + if err := services.CheckArtifactOverlapping(q, data.MySQLBackupTask.ServiceID, data.MySQLBackupTask.LocationID, data.MySQLBackupTask.Folder); err != nil { + return err + } + case data.MongoDBBackupTask != nil: + if err := services.CheckArtifactOverlapping(q, data.MongoDBBackupTask.ServiceID, data.MongoDBBackupTask.LocationID, data.MongoDBBackupTask.Folder); err != nil { + return err + } + if enabled { + return services.CheckMongoDBBackupPreconditions( + q, + data.MongoDBBackupTask.Mode, + data.MongoDBBackupTask.ClusterName, + data.MongoDBBackupTask.ServiceID, + scheduledTaskID) + } + } + return nil +} + +func checkUpdatePreconditions(q *reform.Querier, data *models.ScheduledTaskData, enabled bool, scheduledTaskID string) error { switch { case data.MySQLBackupTask != nil: case data.MongoDBBackupTask != nil: diff --git a/managed/services/scheduler/scheduler_test.go b/managed/services/scheduler/scheduler_test.go index ae011f6525..0967c34b77 100644 --- a/managed/services/scheduler/scheduler_test.go +++ b/managed/services/scheduler/scheduler_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -20,6 +20,7 @@ import ( "testing" "time" + "github.com/AlekSi/pointer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" @@ -33,30 +34,58 @@ import ( ) func TestService(t *testing.T) { - setup := func(t *testing.T, ctx context.Context) *Service { + setup := func(t *testing.T, ctx context.Context, serviceType models.ServiceType, serviceName string) (*Service, *models.Service, *models.BackupLocation) { t.Helper() sqlDB := testdb.Open(t, models.SkipFixtures, nil) + t.Cleanup(func() { + require.NoError(t, sqlDB.Close()) + }) + db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) + + node, err := models.CreateNode(db.Querier, models.GenericNodeType, &models.CreateNodeParams{ + NodeName: "test-node-" + t.Name(), + }) + require.NoError(t, err) + + service, err := models.AddNewService(db.Querier, serviceType, &models.AddDBMSServiceParams{ + ServiceName: serviceName, + NodeID: node.NodeID, + Address: pointer.ToString("127.0.0.1"), + Port: pointer.ToUint16(60000), + }) + require.NoError(t, err) + + location, err := models.CreateBackupLocation(db.Querier, models.CreateBackupLocationParams{ + Name: "test_location", + BackupLocationConfig: models.BackupLocationConfig{ + FilesystemConfig: &models.FilesystemLocationConfig{ + Path: "/tmp", + }, + }, + }) + require.NoError(t, err) + backupService := &mockBackupService{} - svc := New(db, backupService) + schedulerSvc := New(db, backupService) - go svc.Run(ctx) - for !svc.scheduler.IsRunning() { + go schedulerSvc.Run(ctx) + for !schedulerSvc.scheduler.IsRunning() { // Wait a while, so scheduler is running time.Sleep(time.Millisecond * 10) } - return svc + return schedulerSvc, service, location } t.Run("invalid cron expression", func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - svc := setup(t, ctx) + scheduler, service, location := setup(t, ctx, models.MongoDBServiceType, "mongo_service") task, err := NewMongoDBBackupTask(&BackupTaskParams{ - ServiceID: "/service/test", - LocationID: "/location/test", + ServiceID: service.ServiceID, + LocationID: location.ID, Name: "test", Description: "test backup task", DataModel: models.LogicalDataModel, @@ -69,7 +98,7 @@ func TestService(t *testing.T) { cronExpr := "invalid * cron * expression" startAt := time.Now().Truncate(time.Second).UTC() - _, err = svc.Add(task, AddParams{ + _, err = scheduler.Add(task, AddParams{ CronExpression: cronExpr, StartAt: startAt, }) @@ -79,11 +108,11 @@ func TestService(t *testing.T) { t.Run("normal", func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - svc := setup(t, ctx) + scheduler, service, location := setup(t, ctx, models.MongoDBServiceType, "mongo_service") task, err := NewMongoDBBackupTask(&BackupTaskParams{ - ServiceID: "/service/test", - LocationID: "/location/test", + ServiceID: service.ServiceID, + LocationID: location.ID, Name: "test", Description: "test backup task", DataModel: models.LogicalDataModel, @@ -96,25 +125,25 @@ func TestService(t *testing.T) { cronExpr := "* * * * *" startAt := time.Now().Truncate(time.Second).UTC() - dbTask, err := svc.Add(task, AddParams{ + dbTask, err := scheduler.Add(task, AddParams{ CronExpression: cronExpr, StartAt: startAt, }) require.NoError(t, err) - assert.Len(t, svc.scheduler.Jobs(), 1) + assert.Len(t, scheduler.scheduler.Jobs(), 1) - findJob, err := models.FindScheduledTaskByID(svc.db.Querier, dbTask.ID) + findJob, err := models.FindScheduledTaskByID(scheduler.db.Querier, dbTask.ID) require.NoError(t, err) assert.Equal(t, startAt, dbTask.StartAt) assert.Equal(t, cronExpr, findJob.CronExpression) assert.Truef(t, dbTask.NextRun.After(startAt), "next run %s is before startAt %s", dbTask.NextRun, startAt) - err = svc.Remove(dbTask.ID) + err = scheduler.Remove(dbTask.ID) require.NoError(t, err) - assert.Len(t, svc.scheduler.Jobs(), 0) + assert.Len(t, scheduler.scheduler.Jobs(), 0) - _, err = models.FindScheduledTaskByID(svc.db.Querier, dbTask.ID) + _, err = models.FindScheduledTaskByID(scheduler.db.Querier, dbTask.ID) assert.ErrorIs(t, err, models.ErrNotFound) }) } diff --git a/managed/services/scheduler/task.go b/managed/services/scheduler/task.go index c277623822..0a26b869ec 100644 --- a/managed/services/scheduler/task.go +++ b/managed/services/scheduler/task.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/scheduler/task_test.go b/managed/services/scheduler/task_test.go index a83e80bcb5..c08b65025f 100644 --- a/managed/services/scheduler/task_test.go +++ b/managed/services/scheduler/task_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/server/aws_instance_checker.go b/managed/services/server/aws_instance_checker.go index a233eb4ea3..7b95abbaf1 100644 --- a/managed/services/server/aws_instance_checker.go +++ b/managed/services/server/aws_instance_checker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/server/aws_instance_checker_test.go b/managed/services/server/aws_instance_checker_test.go index a82df34a22..86888b9028 100644 --- a/managed/services/server/aws_instance_checker_test.go +++ b/managed/services/server/aws_instance_checker_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/server/deps.go b/managed/services/server/deps.go index b3cd8cf385..132c54c673 100644 --- a/managed/services/server/deps.go +++ b/managed/services/server/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/server/mock_agents_state_updater_test.go b/managed/services/server/mock_agents_state_updater_test.go index f898983cf7..c9265cea29 100644 --- a/managed/services/server/mock_agents_state_updater_test.go +++ b/managed/services/server/mock_agents_state_updater_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package server diff --git a/managed/services/server/mock_alertmanager_service_test.go b/managed/services/server/mock_alertmanager_service_test.go index dccb8a57ac..2f572efeab 100644 --- a/managed/services/server/mock_alertmanager_service_test.go +++ b/managed/services/server/mock_alertmanager_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package server diff --git a/managed/services/server/mock_checks_service_test.go b/managed/services/server/mock_checks_service_test.go index 495e30987d..74907d7100 100644 --- a/managed/services/server/mock_checks_service_test.go +++ b/managed/services/server/mock_checks_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package server diff --git a/managed/services/server/mock_grafana_client_test.go b/managed/services/server/mock_grafana_client_test.go index 2c817be76d..d3d55f991d 100644 --- a/managed/services/server/mock_grafana_client_test.go +++ b/managed/services/server/mock_grafana_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package server diff --git a/managed/services/server/mock_prometheus_service_test.go b/managed/services/server/mock_prometheus_service_test.go index e4282703be..10105c39a9 100644 --- a/managed/services/server/mock_prometheus_service_test.go +++ b/managed/services/server/mock_prometheus_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package server diff --git a/managed/services/server/mock_supervisord_service_test.go b/managed/services/server/mock_supervisord_service_test.go index 8263ddf2a6..618efe3e39 100644 --- a/managed/services/server/mock_supervisord_service_test.go +++ b/managed/services/server/mock_supervisord_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package server diff --git a/managed/services/server/mock_telemetry_service_test.go b/managed/services/server/mock_telemetry_service_test.go index d68973dd3f..328a321100 100644 --- a/managed/services/server/mock_telemetry_service_test.go +++ b/managed/services/server/mock_telemetry_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package server diff --git a/managed/services/server/mock_templates_service_test.go b/managed/services/server/mock_templates_service_test.go index ae6465fa8a..7228594d53 100644 --- a/managed/services/server/mock_templates_service_test.go +++ b/managed/services/server/mock_templates_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package server diff --git a/managed/services/server/mock_vm_alert_external_rules_test.go b/managed/services/server/mock_vm_alert_external_rules_test.go index 3c08560357..a855ad4006 100644 --- a/managed/services/server/mock_vm_alert_external_rules_test.go +++ b/managed/services/server/mock_vm_alert_external_rules_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package server diff --git a/managed/services/server/server.go b/managed/services/server/server.go index ad9bf98f51..e7e29c2afb 100644 --- a/managed/services/server/server.go +++ b/managed/services/server/server.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -487,6 +487,7 @@ func (s *Server) validateChangeSettingsRequest(ctx context.Context, req *serverp if req.PmmPublicAddress != "" && req.RemovePmmPublicAddress { return status.Error(codes.InvalidArgument, "Both pmm_public_address and remove_pmm_public_address are present.") } + if req.SshKey != "" { if err := s.validateSSHKey(ctx, req.SshKey); err != nil { return err diff --git a/managed/services/server/server_test.go b/managed/services/server/server_test.go index 3d49ce3d2d..f9f6ddbe99 100644 --- a/managed/services/server/server_test.go +++ b/managed/services/server/server_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/supervisord/deps.go b/managed/services/supervisord/deps.go new file mode 100644 index 0000000000..9de477c334 --- /dev/null +++ b/managed/services/supervisord/deps.go @@ -0,0 +1,25 @@ +// Copyright (C) 2023 Percona LLC +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package supervisord + +import "net/url" + +// victoriaMetricsParams is a subset of methods of models.VMParams used by this package. +// We use it instead of real type to avoid dependency cycle. +type victoriaMetricsParams interface { + ExternalVM() bool + URLFor(path string) (*url.URL, error) +} diff --git a/managed/services/supervisord/devcontainer_test.go b/managed/services/supervisord/devcontainer_test.go index e3f0992f0a..6a545e7ec9 100644 --- a/managed/services/supervisord/devcontainer_test.go +++ b/managed/services/supervisord/devcontainer_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -112,7 +112,9 @@ func TestDevContainer(t *testing.T) { t.Run("UpdateConfiguration", func(t *testing.T) { // logrus.SetLevel(logrus.DebugLevel) checker := NewPMMUpdateChecker(logrus.WithField("test", t.Name())) - vmParams := &models.VictoriaMetricsParams{} + vmParams, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, models.VMBaseURL) + require.NoError(t, err) + s := New("/etc/supervisord.d", checker, vmParams, models.PGParams{}, gRPCMessageMaxSize) require.NotEmpty(t, s.supervisorctlPath) diff --git a/managed/services/supervisord/logs.go b/managed/services/supervisord/logs.go index f347b3b986..0445ab97cd 100644 --- a/managed/services/supervisord/logs.go +++ b/managed/services/supervisord/logs.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -37,8 +37,8 @@ import ( "golang.org/x/sys/unix" "gopkg.in/yaml.v3" - "github.com/percona/pmm/managed/utils/logger" pprofUtils "github.com/percona/pmm/managed/utils/pprof" + "github.com/percona/pmm/utils/logger" "github.com/percona/pmm/utils/pdeathsig" ) @@ -59,14 +59,16 @@ type fileContent struct { type Logs struct { pmmVersion string pmmUpdateChecker *PMMUpdateChecker + vmParams victoriaMetricsParams } // NewLogs creates a new Logs service. // The number of last log lines to read is n. -func NewLogs(pmmVersion string, pmmUpdateChecker *PMMUpdateChecker) *Logs { +func NewLogs(pmmVersion string, pmmUpdateChecker *PMMUpdateChecker, vmParams victoriaMetricsParams) *Logs { return &Logs{ pmmVersion: pmmVersion, pmmUpdateChecker: pmmUpdateChecker, + vmParams: vmParams, } } @@ -215,7 +217,7 @@ func (l *Logs) files(ctx context.Context, pprofConfig *PprofConfig) []fileConten }) // add VictoriaMetrics targets - b, err = readURL(ctx, "http://127.0.0.1:9090/prometheus/api/v1/targets") + b, err = l.victoriaMetricsTargets(ctx) files = append(files, fileContent{ Name: "victoriametrics_targets.json", Data: b, @@ -280,6 +282,14 @@ func (l *Logs) files(ctx context.Context, pprofConfig *PprofConfig) []fileConten return files } +func (l *Logs) victoriaMetricsTargets(ctx context.Context) ([]byte, error) { + targetsURL, err := l.vmParams.URLFor("api/v1/targets") + if err != nil { + return nil, err + } + return readURL(ctx, targetsURL.String()) +} + // readLog reads last lines (up to given number of lines and bytes) from given file, // and returns them together with modification time. func readLog(name string, maxLines int, maxBytes int64) ([]byte, time.Time, error) { diff --git a/managed/services/supervisord/logs_test.go b/managed/services/supervisord/logs_test.go index 18742b8cee..ebdf0f78f6 100644 --- a/managed/services/supervisord/logs_test.go +++ b/managed/services/supervisord/logs_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -31,7 +31,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/managed/models" + "github.com/percona/pmm/utils/logger" ) var commonExpectedFiles = []string{ @@ -55,7 +56,6 @@ var commonExpectedFiles = []string{ "postgresql14.log", "qan-api2.ini", "qan-api2.log", - "supervisorctl_status.log", "supervisord.conf", "supervisord.log", "victoriametrics-promscrape.yml", @@ -148,7 +148,9 @@ func TestAddAdminSummary(t *testing.T) { func TestFiles(t *testing.T) { checker := NewPMMUpdateChecker(logrus.WithField("test", t.Name())) - l := NewLogs("2.4.5", checker) + params, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, models.VMBaseURL) + require.NoError(t, err) + l := NewLogs("2.4.5", checker, params) ctx := logger.Set(context.Background(), t.Name()) files := l.files(ctx, nil) @@ -173,6 +175,11 @@ func TestFiles(t *testing.T) { continue } + if f.Name == "supervisorctl_status.log" { + // FIXME: this fails following the transition to EL9 + continue + } + assert.NoError(t, f.Err, "name = %q", f.Name) actual = append(actual, f.Name) @@ -186,7 +193,9 @@ func TestZip(t *testing.T) { t.Skip("FIXME") checker := NewPMMUpdateChecker(logrus.WithField("test", t.Name())) - l := NewLogs("2.4.5", checker) + params, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, models.VMBaseURL) + require.NoError(t, err) + l := NewLogs("2.4.5", checker, params) ctx := logger.Set(context.Background(), t.Name()) var buf bytes.Buffer diff --git a/managed/services/supervisord/maintail.go b/managed/services/supervisord/maintail.go index 1d61e30586..1dd1f62e4c 100644 --- a/managed/services/supervisord/maintail.go +++ b/managed/services/supervisord/maintail.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/supervisord/maintail_test.go b/managed/services/supervisord/maintail_test.go index 94603da72d..2e108a66f6 100644 --- a/managed/services/supervisord/maintail_test.go +++ b/managed/services/supervisord/maintail_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/supervisord/pmm_config.go b/managed/services/supervisord/pmm_config.go index 602b9a5546..fbe7f2b51f 100644 --- a/managed/services/supervisord/pmm_config.go +++ b/managed/services/supervisord/pmm_config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -166,7 +166,6 @@ priority = 14 command = /usr/sbin/pmm-managed --victoriametrics-config=/etc/victoriametrics-promscrape.yml - --victoriametrics-url=http://127.0.0.1:9090/prometheus --supervisord-config-dir=/etc/supervisord.d autorestart = true autostart = true diff --git a/managed/services/supervisord/pmm_update_checker.go b/managed/services/supervisord/pmm_update_checker.go index aa06b04048..fe062da7fe 100644 --- a/managed/services/supervisord/pmm_update_checker.go +++ b/managed/services/supervisord/pmm_update_checker.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/supervisord/pprof_config.go b/managed/services/supervisord/pprof_config.go index f4cc63ed62..52ab238389 100644 --- a/managed/services/supervisord/pprof_config.go +++ b/managed/services/supervisord/pprof_config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/supervisord/supervisord.go b/managed/services/supervisord/supervisord.go index 0484e263b0..34907a8547 100644 --- a/managed/services/supervisord/supervisord.go +++ b/managed/services/supervisord/supervisord.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -76,7 +76,7 @@ type sub struct { eventTypes []eventType } -// values from supervisord configuration +// values from supervisord configuration. const ( pmmUpdatePerformProgram = "pmm-update-perform" pmmUpdatePerformLog = "/srv/logs/pmm-update-perform.log" @@ -394,20 +394,10 @@ func (s *Service) UpdateLog(offset uint32) ([]string, uint32, error) { // reload asks supervisord to reload configuration. func (s *Service) reload(name string) error { - // See https://github.com/Supervisor/supervisor/issues/1264 for explanation - // why we do reread + stop/remove/add. - if _, err := s.supervisorctl("reread"); err != nil { s.l.Warn(err) } - if _, err := s.supervisorctl("stop", name); err != nil { - s.l.Warn(err) - } - if _, err := s.supervisorctl("remove", name); err != nil { - s.l.Warn(err) - } - - _, err := s.supervisorctl("add", name) + _, err := s.supervisorctl("update", name) return err } @@ -433,7 +423,10 @@ func (s *Service) marshalConfig(tmpl *template.Template, settings *models.Settin "DataRetentionDays": int(settings.DataRetention.Hours() / 24), "VMAlertFlags": s.vmParams.VMAlertFlags, "VMDBCacheDisable": !settings.VictoriaMetrics.CacheEnabled, + "VMURL": s.vmParams.URL(), + "ExternalVM": s.vmParams.ExternalVM(), "PerconaTestDbaas": settings.DBaaS.Enabled, + "InterfaceToBind": envvars.GetInterfaceToBind(), "ClickhouseAddr": clickhouseAddr, "ClickhouseDataSourceAddr": clickhouseDataSourceAddr, "ClickhouseDatabase": clickhouseDatabase, @@ -445,6 +438,19 @@ func (s *Service) marshalConfig(tmpl *template.Template, settings *models.Settin s.addPostgresParams(templateParams) + templateParams["PMMServerHost"] = "" + if settings.PMMPublicAddress != "" { + publicURL, err := url.Parse(settings.PMMPublicAddress) + if err != nil { + return nil, errors.Wrap(err, "failed to parse PMM public address.") + } + if publicURL.Host == "" { + if publicURL, err = url.Parse(fmt.Sprintf("https://%s", settings.PMMPublicAddress)); err != nil { + return nil, errors.Wrap(err, "failed to parse PMM public address.") + } + } + templateParams["PMMServerHost"] = publicURL.Host + } if ssoDetails != nil { u, err := url.Parse(ssoDetails.IssuerURL) if err != nil { @@ -601,8 +607,6 @@ func (s *Service) RestartSupervisedService(serviceName string) error { return err } -var interfaceToBind = envvars.GetInterfaceToBind() - //nolint:lll var templates = template.Must(template.New("").Option("missingkey=error").Parse(` {{define "dbaas-controller"}} @@ -639,6 +643,7 @@ redirect_stderr = true {{end}} {{define "victoriametrics"}} +{{- if not .ExternalVM }} [program:victoriametrics] priority = 7 command = @@ -646,7 +651,7 @@ command = --promscrape.config=/etc/victoriametrics-promscrape.yml --retentionPeriod={{ .DataRetentionDays }}d --storageDataPath=/srv/victoriametrics/data - --httpListenAddr=` + interfaceToBind + `:9090 + --httpListenAddr={{ .InterfaceToBind }}:9090 --search.disableCache={{ .VMDBCacheDisable }} --search.maxQueryLen=1MB --search.latencyOffset=5s @@ -671,6 +676,7 @@ stdout_logfile = /srv/logs/victoriametrics.log stdout_logfile_maxbytes = 10MB stdout_logfile_backups = 3 redirect_stderr = true +{{end -}} {{end}} {{define "vmalert"}} @@ -681,13 +687,13 @@ command = --notifier.url="{{ .AlertmanagerURL }}" --notifier.basicAuth.password='{{ .AlertManagerPassword }}' --notifier.basicAuth.username="{{ .AlertManagerUser }}" - --external.url=http://localhost:9090/prometheus - --datasource.url=http://127.0.0.1:9090/prometheus - --remoteRead.url=http://127.0.0.1:9090/prometheus + --external.url={{ .VMURL }} + --datasource.url={{ .VMURL }} + --remoteRead.url={{ .VMURL }} --remoteRead.ignoreRestoreErrors=false - --remoteWrite.url=http://127.0.0.1:9090/prometheus + --remoteWrite.url={{ .VMURL }} --rule=/srv/prometheus/rules/*.yml - --httpListenAddr=` + interfaceToBind + `:8880 + --httpListenAddr={{ .InterfaceToBind }}:8880 {{- range $index, $param := .VMAlertFlags }} {{ $param }} {{- end }} @@ -709,9 +715,9 @@ redirect_stderr = true priority = 9 command = /usr/sbin/vmproxy - --target-url=http://127.0.0.1:9090/ + --target-url={{ .VMURL }} --listen-port=8430 - --listen-address=` + interfaceToBind + ` + --listen-address={{ .InterfaceToBind }} --header-name=X-Proxy-Filter user = pmm autorestart = true @@ -735,7 +741,7 @@ command = --storage.path=/srv/alertmanager/data --data.retention={{ .DataRetentionHours }}h --web.external-url=http://localhost:9093/alertmanager/ - --web.listen-address=` + interfaceToBind + `:9093 + --web.listen-address={{ .InterfaceToBind }}:9093 --cluster.listen-address="" user = pmm autorestart = true @@ -778,17 +784,13 @@ redirect_stderr = true [program:grafana] priority = 3 command = - /usr/sbin/grafana-server + /usr/sbin/grafana server --homepath=/usr/share/grafana --config=/etc/grafana/grafana.ini - cfg:default.paths.data=/srv/grafana - cfg:default.paths.plugins=/srv/grafana/plugins - cfg:default.paths.logs=/srv/logs - cfg:default.log.mode=console - cfg:default.log.console.format=console - cfg:default.server.root_url="https://%%(domain)s/graph" + {{- if .PMMServerHost}} + cfg:default.server.domain="{{ .PMMServerHost }}" + {{- end}} {{- if .PerconaSSODetails}} - cfg:default.server.domain="{{ .PMMServerAddress }}" cfg:default.auth.generic_oauth.enabled=true cfg:default.auth.generic_oauth.name="Percona Account" cfg:default.auth.generic_oauth.client_id="{{ .PerconaSSODetails.GrafanaClientID }}" @@ -798,6 +800,7 @@ command = cfg:default.auth.generic_oauth.api_url="{{ .PerconaSSODetails.IssuerURL }}/userinfo" cfg:default.auth.generic_oauth.role_attribute_path="(contains(portal_admin_orgs[*], '{{ .PerconaSSODetails.OrganizationID }}') || contains(pmm_demo_ids[*], '{{ .PMMServerID }}')) && 'Admin' || 'Viewer'" cfg:default.auth.generic_oauth.use_pkce="true" + cfg:default.auth.oauth_allow_insecure_email_lookup="true" {{- end}} environment = PERCONA_TEST_POSTGRES_ADDR="{{ .PostgresAddr }}", diff --git a/managed/services/supervisord/supervisord_test.go b/managed/services/supervisord/supervisord_test.go index ed6e515ff5..6676406f39 100644 --- a/managed/services/supervisord/supervisord_test.go +++ b/managed/services/supervisord/supervisord_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -36,7 +36,8 @@ func TestConfig(t *testing.T) { pmmUpdateCheck := NewPMMUpdateChecker(logrus.WithField("component", "supervisord/pmm-update-checker_logs")) configDir := filepath.Join("..", "..", "testdata", "supervisord.d") - vmParams := &models.VictoriaMetricsParams{} + vmParams, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, models.VMBaseURL) + require.NoError(t, err) s := New(configDir, pmmUpdateCheck, vmParams, models.PGParams{}, gRPCMessageMaxSize) settings := &models.Settings{ DataRetention: 30 * 24 * time.Hour, @@ -68,7 +69,8 @@ func TestDBaaSController(t *testing.T) { pmmUpdateCheck := NewPMMUpdateChecker(logrus.WithField("component", "supervisord/pmm-update-checker_logs")) configDir := filepath.Join("..", "..", "testdata", "supervisord.d") - vmParams := &models.VictoriaMetricsParams{} + vmParams, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, models.VMBaseURL) + require.NoError(t, err) s := New(configDir, pmmUpdateCheck, vmParams, models.PGParams{}, gRPCMessageMaxSize) var tp *template.Template diff --git a/managed/services/telemetry/config.go b/managed/services/telemetry/config.go index 813d0fa437..40372b297f 100644 --- a/managed/services/telemetry/config.go +++ b/managed/services/telemetry/config.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/telemetry/config_test.go b/managed/services/telemetry/config_test.go index 33868fbf45..5d497688d0 100644 --- a/managed/services/telemetry/config_test.go +++ b/managed/services/telemetry/config_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/telemetry/datasource_grafana_sqlitedb.go b/managed/services/telemetry/datasource_grafana_sqlitedb.go index dfa6606a3b..689a3decfd 100644 --- a/managed/services/telemetry/datasource_grafana_sqlitedb.go +++ b/managed/services/telemetry/datasource_grafana_sqlitedb.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/telemetry/datasource_grafana_sqlitedb_test.go b/managed/services/telemetry/datasource_grafana_sqlitedb_test.go index 8edadf5ec8..4877c9263d 100644 --- a/managed/services/telemetry/datasource_grafana_sqlitedb_test.go +++ b/managed/services/telemetry/datasource_grafana_sqlitedb_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/telemetry/datasource_pmmdb_select.go b/managed/services/telemetry/datasource_pmmdb_select.go index 6e2d03c040..08e6485e36 100644 --- a/managed/services/telemetry/datasource_pmmdb_select.go +++ b/managed/services/telemetry/datasource_pmmdb_select.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -33,7 +33,7 @@ type dsPmmDBSelect struct { db *sql.DB } -// check interfaces +// check interfaces. var ( _ DataSource = (*dsPmmDBSelect)(nil) ) diff --git a/managed/services/telemetry/datasource_qandb_select.go b/managed/services/telemetry/datasource_qandb_select.go index d53a122d86..3f80053282 100644 --- a/managed/services/telemetry/datasource_qandb_select.go +++ b/managed/services/telemetry/datasource_qandb_select.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -31,7 +31,7 @@ type dsQanDBSelect struct { db *sql.DB } -// check interfaces +// check interfaces. var ( _ DataSource = (*dsQanDBSelect)(nil) ) diff --git a/managed/services/telemetry/datasource_victoria_metrics.go b/managed/services/telemetry/datasource_victoria_metrics.go index 7b3365f31c..359032aa5c 100644 --- a/managed/services/telemetry/datasource_victoria_metrics.go +++ b/managed/services/telemetry/datasource_victoria_metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -33,7 +33,7 @@ type dataSourceVictoriaMetrics struct { vm v1.API } -// check interfaces +// check interfaces. var ( _ DataSource = (*dataSourceVictoriaMetrics)(nil) ) diff --git a/managed/services/telemetry/datasources.go b/managed/services/telemetry/datasources.go index 79276d8aac..01f5e75996 100644 --- a/managed/services/telemetry/datasources.go +++ b/managed/services/telemetry/datasources.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -35,7 +35,7 @@ type dataSourceRegistry struct { dataSources map[DataSourceName]DataSource } -// NewDataSourceRegistry makes new data source registry +// NewDataSourceRegistry makes new data source registry. func NewDataSourceRegistry(config ServiceConfig, l *logrus.Entry) (DataSourceLocator, error) { //nolint:ireturn pmmDB, err := NewDsPmmDBSelect(*config.DataSources.PmmDBSelect, l) if err != nil { diff --git a/managed/services/telemetry/deps.go b/managed/services/telemetry/deps.go index 148bd529a7..e2f47d9100 100644 --- a/managed/services/telemetry/deps.go +++ b/managed/services/telemetry/deps.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,12 +29,12 @@ import ( //go:generate ../../../bin/mockery --name=DataSourceLocator --case=snake --inpackage --testonly //go:generate ../../../bin/mockery --name=DataSource --case=snake --inpackage --testonly -// distributionUtilService service to get info about OS on which pmm server is running +// distributionUtilService service to get info about OS on which pmm server is running. type distributionUtilService interface { getDistributionMethodAndOS() (serverpb.DistributionMethod, pmmv1.DistributionMethod, string) } -// sender is interface which defines method for client which sends report with metrics +// sender is interface which defines method for client which sends report with metrics. type sender interface { SendTelemetry(ctx context.Context, report *reporter.ReportRequest) error } diff --git a/managed/services/telemetry/distribution_util.go b/managed/services/telemetry/distribution_util.go index 28213dfd3b..7c27be9d3e 100644 --- a/managed/services/telemetry/distribution_util.go +++ b/managed/services/telemetry/distribution_util.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/telemetry/distribution_util_test.go b/managed/services/telemetry/distribution_util_test.go index 59c62bb5c9..cfd1ac5ae8 100644 --- a/managed/services/telemetry/distribution_util_test.go +++ b/managed/services/telemetry/distribution_util_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/telemetry/mock_data_source_locator_test.go b/managed/services/telemetry/mock_data_source_locator_test.go index 93ec35e84b..29b11a5efc 100644 --- a/managed/services/telemetry/mock_data_source_locator_test.go +++ b/managed/services/telemetry/mock_data_source_locator_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package telemetry diff --git a/managed/services/telemetry/mock_data_source_test.go b/managed/services/telemetry/mock_data_source_test.go index e31e6a6cd2..fb3a5a319c 100644 --- a/managed/services/telemetry/mock_data_source_test.go +++ b/managed/services/telemetry/mock_data_source_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package telemetry diff --git a/managed/services/telemetry/mock_distribution_util_service_test.go b/managed/services/telemetry/mock_distribution_util_service_test.go index 6791db614d..f84650c94d 100644 --- a/managed/services/telemetry/mock_distribution_util_service_test.go +++ b/managed/services/telemetry/mock_distribution_util_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package telemetry diff --git a/managed/services/telemetry/mock_sender_test.go b/managed/services/telemetry/mock_sender_test.go index fe335c60cf..7a81a50153 100644 --- a/managed/services/telemetry/mock_sender_test.go +++ b/managed/services/telemetry/mock_sender_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package telemetry diff --git a/managed/services/telemetry/telemetry.go b/managed/services/telemetry/telemetry.go index 9e9ebdd142..99b491b0e9 100644 --- a/managed/services/telemetry/telemetry.go +++ b/managed/services/telemetry/telemetry.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -63,7 +63,7 @@ type Service struct { dus distributionUtilService } -// check interfaces +// check interfaces. var ( _ DataSourceLocator = (*Service)(nil) ) @@ -169,7 +169,7 @@ func (s *Service) DistributionMethod() serverpb.DistributionMethod { func (s *Service) processSendCh(ctx context.Context) { var reportsBufSync sync.Mutex var reportsBuf []*pmmv1.ServerMetric - var sendCtx context.Context + var sendCtx context.Context //nolint:contextcheck var cancel context.CancelFunc for { @@ -188,8 +188,8 @@ func (s *Service) processSendCh(ctx context.Context) { reportsBuf = []*pmmv1.ServerMetric{} reportsBufSync.Unlock() - go func() { - err := s.send(sendCtx, &reporter.ReportRequest{ + go func(ctx context.Context) { + err := s.send(ctx, &reporter.ReportRequest{ Metrics: reportsToSend, }) if err != nil { @@ -201,7 +201,7 @@ func (s *Service) processSendCh(ctx context.Context) { } s.l.Debug("Telemetry info sent.") - }() + }(sendCtx) } case <-ctx.Done(): if cancel != nil { @@ -412,7 +412,7 @@ func (s *Service) Format(report *pmmv1.ServerMetric) string { return builder.String() } -// GetSummaries returns the list of gathered telemetry +// GetSummaries returns the list of gathered telemetry. func (s *Service) GetSummaries() []string { result := make([]string, 0, len(s.config.telemetry)) for _, c := range s.config.telemetry { diff --git a/managed/services/telemetry/telemetry_test.go b/managed/services/telemetry/telemetry_test.go index 477ff027d4..726e80cbaa 100644 --- a/managed/services/telemetry/telemetry_test.go +++ b/managed/services/telemetry/telemetry_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -19,7 +19,6 @@ import ( "context" "io/fs" "os" - "reflect" "testing" "time" @@ -264,7 +263,7 @@ func initMockTelemetrySender(t *testing.T, expectedReport *reporter.ReportReques var mockTelemetrySender mockSender mockTelemetrySender.Test(t) mockTelemetrySender.On("SendTelemetry", - mock.AnythingOfType(reflect.TypeOf(context.TODO()).Name()), + mock.Anything, mock.MatchedBy(func(report *reporter.ReportRequest) bool { return matchExpectedReport(report, expectedReport) }), diff --git a/managed/services/telemetry/transform.go b/managed/services/telemetry/transform.go index 95339047dd..b9ab4c7ac6 100644 --- a/managed/services/telemetry/transform.go +++ b/managed/services/telemetry/transform.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/telemetry/transform_test.go b/managed/services/telemetry/transform_test.go index 971e80ba4b..6e4e8f2cbc 100644 --- a/managed/services/telemetry/transform_test.go +++ b/managed/services/telemetry/transform_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/types.go b/managed/services/types.go index 49420c2841..4cac2c40ed 100644 --- a/managed/services/types.go +++ b/managed/services/types.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -66,8 +66,6 @@ func (t *Target) Copy() Target { type CheckResult struct { CheckName string AdvisorName string - Silenced bool - AlertID string Interval check.Interval Target Target Result check.Result diff --git a/managed/services/user/user.go b/managed/services/user/user.go index cf986378a6..c0dd0d5365 100644 --- a/managed/services/user/user.go +++ b/managed/services/user/user.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -// Package user provides API for user related tasks +// Package user provides API for user related tasks. package user import ( @@ -55,7 +55,7 @@ func NewUserService(db *reform.DB, client grafanaClient) *Service { return &s } -// GetUser creates a new user +// GetUser creates a new user. func (s *Service) GetUser(ctx context.Context, _ *userpb.UserDetailsRequest) (*userpb.UserDetailsResponse, error) { userID, err := s.c.GetUserID(ctx) if err != nil { diff --git a/managed/services/utils.go b/managed/services/utils.go deleted file mode 100644 index c67ba0518f..0000000000 --- a/managed/services/utils.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package services - -import ( - "github.com/percona-platform/saas/pkg/check" - "github.com/sirupsen/logrus" -) - -// GroupChecksByDB splits provided checks by database and returns three -// slices: for MySQL, for PostgreSQL and for MongoDB. -func GroupChecksByDB( - l *logrus.Entry, - checks map[string]check.Check, -) (map[string]check.Check, map[string]check.Check, map[string]check.Check) { - mySQLChecks := make(map[string]check.Check) - postgreSQLChecks := make(map[string]check.Check) - mongoDBChecks := make(map[string]check.Check) - for _, c := range checks { - switch c.Version { - case 1: - switch c.Type { - case check.MySQLSelect: - fallthrough - case check.MySQLShow: - mySQLChecks[c.Name] = c - - case check.PostgreSQLSelect: - fallthrough - case check.PostgreSQLShow: - postgreSQLChecks[c.Name] = c - - case check.MongoDBGetParameter: - fallthrough - case check.MongoDBBuildInfo: - fallthrough - case check.MongoDBGetCmdLineOpts: - fallthrough - case check.MongoDBReplSetGetStatus: - fallthrough - case check.MongoDBGetDiagnosticData: - mongoDBChecks[c.Name] = c - - default: - l.Warnf("Unknown check type %s, skip it.", c.Type) - } - case 2: - switch c.Family { - case check.MySQL: - mySQLChecks[c.Name] = c - case check.PostgreSQL: - postgreSQLChecks[c.Name] = c - case check.MongoDB: - mongoDBChecks[c.Name] = c - default: - l.Warnf("Unknown check family %s, skip it.", c.Family) - } - } - } - - return mySQLChecks, postgreSQLChecks, mongoDBChecks -} diff --git a/managed/services/utils_test.go b/managed/services/utils_test.go deleted file mode 100644 index a8d1623784..0000000000 --- a/managed/services/utils_test.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (C) 2017 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package services - -import ( - "testing" - - "github.com/percona-platform/saas/pkg/check" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestGroupChecksByDB(t *testing.T) { - t.Parallel() - - checks := map[string]check.Check{ - "MySQLShow": {Name: "MySQLShow", Version: 1, Type: check.MySQLShow}, - "MySQLSelect": {Name: "MySQLSelect", Version: 1, Type: check.MySQLSelect}, - "PostgreSQLShow": {Name: "PostgreSQLShow", Version: 1, Type: check.PostgreSQLShow}, - "PostgreSQLSelect": {Name: "PostgreSQLSelect", Version: 1, Type: check.PostgreSQLSelect}, - "MongoDBGetParameter": {Name: "MongoDBGetParameter", Version: 1, Type: check.MongoDBGetParameter}, - "MongoDBBuildInfo": {Name: "MongoDBBuildInfo", Version: 1, Type: check.MongoDBBuildInfo}, - "MongoDBGetCmdLineOpts": {Name: "MongoDBGetCmdLineOpts", Version: 1, Type: check.MongoDBGetCmdLineOpts}, - "MongoDBReplSetGetStatus": {Name: "MongoDBReplSetGetStatus", Version: 1, Type: check.MongoDBReplSetGetStatus}, - "MongoDBGetDiagnosticData": {Name: "MongoDBGetDiagnosticData", Version: 1, Type: check.MongoDBGetDiagnosticData}, - "unsupported type": {Name: "unsupported type", Version: 1, Type: check.Type("RedisInfo")}, - "missing type": {Name: "missing type", Version: 1}, - "MySQL family V2": {Name: "MySQL family V2", Version: 2, Family: check.MySQL}, - "PostgreSQL family V2": {Name: "PostgreSQL family V2", Version: 2, Family: check.PostgreSQL}, - "MongoDB family V2": {Name: "MongoDB family V2", Version: 2, Family: check.MongoDB}, - "missing family": {Name: "missing family", Version: 2}, - } - - l := logrus.WithField("component", "tests") - mySQLChecks, postgreSQLChecks, mongoDBChecks := GroupChecksByDB(l, checks) - - require.Len(t, mySQLChecks, 3) - require.Len(t, postgreSQLChecks, 3) - require.Len(t, mongoDBChecks, 6) - - // V1 checks - assert.Equal(t, check.MySQLShow, mySQLChecks["MySQLShow"].Type) - assert.Equal(t, check.MySQLSelect, mySQLChecks["MySQLSelect"].Type) - - assert.Equal(t, check.PostgreSQLShow, postgreSQLChecks["PostgreSQLShow"].Type) - assert.Equal(t, check.PostgreSQLSelect, postgreSQLChecks["PostgreSQLSelect"].Type) - - assert.Equal(t, check.MongoDBGetParameter, mongoDBChecks["MongoDBGetParameter"].Type) - assert.Equal(t, check.MongoDBBuildInfo, mongoDBChecks["MongoDBBuildInfo"].Type) - assert.Equal(t, check.MongoDBGetCmdLineOpts, mongoDBChecks["MongoDBGetCmdLineOpts"].Type) - assert.Equal(t, check.MongoDBReplSetGetStatus, mongoDBChecks["MongoDBReplSetGetStatus"].Type) - assert.Equal(t, check.MongoDBGetDiagnosticData, mongoDBChecks["MongoDBGetDiagnosticData"].Type) - - // V2 checks - assert.Equal(t, check.MySQL, mySQLChecks["MySQL family V2"].Family) - assert.Equal(t, check.PostgreSQL, postgreSQLChecks["PostgreSQL family V2"].Family) - assert.Equal(t, check.MongoDB, mongoDBChecks["MongoDB family V2"].Family) -} diff --git a/managed/services/versioncache/mock_versioner_test.go b/managed/services/versioncache/mock_versioner_test.go index b580c766ed..fe21715e30 100644 --- a/managed/services/versioncache/mock_versioner_test.go +++ b/managed/services/versioncache/mock_versioner_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.16. DO NOT EDIT. +// Code generated by mockery v2.33.0. DO NOT EDIT. package versioncache diff --git a/managed/services/versioncache/versioncache.go b/managed/services/versioncache/versioncache.go index aaa4d006b6..e51dfe6506 100644 --- a/managed/services/versioncache/versioncache.go +++ b/managed/services/versioncache/versioncache.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/versioncache/versioncache_test.go b/managed/services/versioncache/versioncache_test.go index d9fb69ce3f..1fadc032f6 100644 --- a/managed/services/versioncache/versioncache_test.go +++ b/managed/services/versioncache/versioncache_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/victoriametrics/prometheus.go b/managed/services/victoriametrics/prometheus.go index 304c20742c..717868763f 100644 --- a/managed/services/victoriametrics/prometheus.go +++ b/managed/services/victoriametrics/prometheus.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/victoriametrics/scrape_configs.go b/managed/services/victoriametrics/scrape_configs.go index 977a7b5dbd..e47df63673 100644 --- a/managed/services/victoriametrics/scrape_configs.go +++ b/managed/services/victoriametrics/scrape_configs.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/victoriametrics/scrape_configs_test.go b/managed/services/victoriametrics/scrape_configs_test.go index 7969431400..29d08272dc 100644 --- a/managed/services/victoriametrics/scrape_configs_test.go +++ b/managed/services/victoriametrics/scrape_configs_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/victoriametrics/victoriametrics.go b/managed/services/victoriametrics/victoriametrics.go index 13a468be87..746e3008d7 100644 --- a/managed/services/victoriametrics/victoriametrics.go +++ b/managed/services/victoriametrics/victoriametrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -46,10 +46,6 @@ const ( updateBatchDelay = time.Second configurationUpdateTimeout = 3 * time.Second - // BasePrometheusConfigPath - basic path with prometheus config, - // that user can mount to container. - BasePrometheusConfigPath = "/srv/prometheus/prometheus.base.yml" - victoriametricsDir = "/srv/victoriametrics" victoriametricsDataDir = "/srv/victoriametrics/data" dirPerm = os.FileMode(0o775) @@ -64,15 +60,15 @@ type Service struct { baseURL *url.URL client *http.Client - baseConfigPath string // for testing + params *models.VictoriaMetricsParams l *logrus.Entry reloadCh chan struct{} } // NewVictoriaMetrics creates new VictoriaMetrics service. -func NewVictoriaMetrics(scrapeConfigPath string, db *reform.DB, baseURL string, params *models.VictoriaMetricsParams) (*Service, error) { - u, err := url.Parse(baseURL) +func NewVictoriaMetrics(scrapeConfigPath string, db *reform.DB, params *models.VictoriaMetricsParams) (*Service, error) { + u, err := url.Parse(params.URL()) if err != nil { return nil, errors.WithStack(err) } @@ -82,7 +78,7 @@ func NewVictoriaMetrics(scrapeConfigPath string, db *reform.DB, baseURL string, db: db, baseURL: u, client: &http.Client{}, // TODO instrument with utils/irt; see vmalert package https://jira.percona.com/browse/PMM-7229 - baseConfigPath: params.BaseConfigPath, + params: params, l: logrus.WithField("component", "victoriametrics"), reloadCh: make(chan struct{}, 1), }, nil @@ -145,6 +141,9 @@ func (svc *Service) RequestConfigurationUpdate() { // updateConfiguration updates VictoriaMetrics configuration. func (svc *Service) updateConfiguration(ctx context.Context) error { + if svc.params.ExternalVM() { + return nil + } start := time.Now() defer func() { if dur := time.Since(start); dur > time.Second { @@ -152,8 +151,7 @@ func (svc *Service) updateConfiguration(ctx context.Context) error { } }() - base := svc.loadBaseConfig() - cfg, err := svc.marshalConfig(base) + cfg, err := svc.buildVMConfig() if err != nil { return err } @@ -161,6 +159,11 @@ func (svc *Service) updateConfiguration(ctx context.Context) error { return svc.configAndReload(ctx, cfg) } +func (svc *Service) buildVMConfig() ([]byte, error) { + base := svc.loadBaseConfig() + return svc.marshalConfig(base) +} + // reload asks VictoriaMetrics to reload configuration. func (svc *Service) reload(ctx context.Context) error { u := *svc.baseURL @@ -189,10 +192,10 @@ func (svc *Service) reload(ctx context.Context) error { // loadBaseConfig returns parsed base configuration file, or empty configuration on error. func (svc *Service) loadBaseConfig() *config.Config { - buf, err := os.ReadFile(svc.baseConfigPath) + buf, err := os.ReadFile(svc.params.BaseConfigPath) if err != nil { if !os.IsNotExist(err) { - svc.l.Errorf("Failed to load base VictoriaMetrics config %s: %s", svc.baseConfigPath, err) + svc.l.Errorf("Failed to load base VictoriaMetrics config %s: %s", svc.params.BaseConfigPath, err) } return &config.Config{} @@ -200,7 +203,7 @@ func (svc *Service) loadBaseConfig() *config.Config { var cfg config.Config if err := yaml.Unmarshal(buf, &cfg); err != nil { - svc.l.Errorf("Failed to parse base VictoriaMetrics config %s: %s.", svc.baseConfigPath, err) + svc.l.Errorf("Failed to parse base VictoriaMetrics config %s: %s.", svc.params.BaseConfigPath, err) return &config.Config{} } @@ -330,7 +333,10 @@ func (svc *Service) populateConfig(cfg *config.Config) error { if cfg.GlobalConfig.ScrapeTimeout == 0 { cfg.GlobalConfig.ScrapeTimeout = ScrapeTimeout(s.LR) } - cfg.ScrapeConfigs = append(cfg.ScrapeConfigs, scrapeConfigForVictoriaMetrics(s.HR)) + cfg.ScrapeConfigs = append(cfg.ScrapeConfigs, scrapeConfigForVictoriaMetrics(svc.l, s.HR, svc.params)) + if svc.params.ExternalVM() { + cfg.ScrapeConfigs = append(cfg.ScrapeConfigs, scrapeConfigForInternalVMAgent(s.HR, svc.baseURL.Host)) + } cfg.ScrapeConfigs = append(cfg.ScrapeConfigs, scrapeConfigForVMAlert(s.HR)) AddInternalServicesToScrape(cfg, s, settings.DBaaS.Enabled) return AddScrapeConfigs(svc.l, cfg, tx.Querier, &s, nil, false) @@ -338,17 +344,41 @@ func (svc *Service) populateConfig(cfg *config.Config) error { } // scrapeConfigForVictoriaMetrics returns scrape config for Victoria Metrics in Prometheus format. -func scrapeConfigForVictoriaMetrics(interval time.Duration) *config.ScrapeConfig { +func scrapeConfigForVictoriaMetrics(l *logrus.Entry, interval time.Duration, vmParams *models.VictoriaMetricsParams) *config.ScrapeConfig { + target, err := vmParams.URLFor("metrics") + if err != nil { + l.Errorf("couldn't parse relative path to victoria metrics: %q", err) + return nil + } + return &config.ScrapeConfig{ JobName: "victoriametrics", ScrapeInterval: config.Duration(interval), ScrapeTimeout: ScrapeTimeout(interval), - MetricsPath: "/prometheus/metrics", + MetricsPath: target.Path, ServiceDiscoveryConfig: config.ServiceDiscoveryConfig{ StaticConfigs: []*config.Group{ { - Targets: []string{"127.0.0.1:9090"}, - Labels: map[string]string{"instance": "pmm-server"}, + Targets: []string{target.Host}, + Labels: map[string]string{"instance": models.PMMServerAgentID}, + }, + }, + }, + } +} + +// scrapeConfigForInternalVMAgent returns scrape config for internal VM Agent in Prometheus format. +func scrapeConfigForInternalVMAgent(interval time.Duration, target string) *config.ScrapeConfig { + return &config.ScrapeConfig{ + JobName: "vmagent", + ScrapeInterval: config.Duration(interval), + ScrapeTimeout: ScrapeTimeout(interval), + MetricsPath: "/metrics", + ServiceDiscoveryConfig: config.ServiceDiscoveryConfig{ + StaticConfigs: []*config.Group{ + { + Targets: []string{target}, + Labels: map[string]string{"instance": models.PMMServerAgentID}, }, }, }, @@ -375,6 +405,9 @@ func scrapeConfigForVMAlert(interval time.Duration) *config.ScrapeConfig { // BuildScrapeConfigForVMAgent builds scrape configuration for given pmm-agent. func (svc *Service) BuildScrapeConfigForVMAgent(pmmAgentID string) ([]byte, error) { + if pmmAgentID == models.PMMServerAgentID { + return svc.buildVMConfig() + } var cfg config.Config e := svc.db.InTransaction(func(tx *reform.TX) error { settings, err := models.GetSettings(tx) @@ -393,6 +426,10 @@ func (svc *Service) BuildScrapeConfigForVMAgent(pmmAgentID string) ([]byte, erro // IsReady verifies that VictoriaMetrics works. func (svc *Service) IsReady(ctx context.Context) error { + if svc.params.ExternalVM() { + svc.l.Debugf("External VM is used, VM healthcheck is skipped") + return nil + } u := *svc.baseURL u.Path = path.Join(u.Path, "health") req, err := http.NewRequestWithContext(ctx, http.MethodGet, u.String(), nil) diff --git a/managed/services/victoriametrics/victoriametrics_test.go b/managed/services/victoriametrics/victoriametrics_test.go index 6eb19fcd9c..d6a7db56cb 100644 --- a/managed/services/victoriametrics/victoriametrics_test.go +++ b/managed/services/victoriametrics/victoriametrics_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -43,8 +43,9 @@ func setup(t *testing.T) (*reform.DB, *Service, []byte) { sqlDB := testdb.Open(t, models.SkipFixtures, nil) db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - vmParams := &models.VictoriaMetricsParams{BaseConfigPath: "/srv/prometheus/prometheus.base.yml"} - svc, err := NewVictoriaMetrics(configPath, db, "http://127.0.0.1:9090/prometheus/", vmParams) + vmParams, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, models.VMBaseURL) + check.NoError(err) + svc, err := NewVictoriaMetrics(configPath, db, vmParams) check.NoError(err) original, err := os.ReadFile(configPath) @@ -336,6 +337,7 @@ scrape_configs: _service_label: bam agent_id: /agent_id/cfec996c-4fe6-41d9-83cb-e1a3b1fe10a8 agent_type: mongodb_exporter + cluster: test-mongodb-noversion instance: /agent_id/cfec996c-4fe6-41d9-83cb-e1a3b1fe10a8 node_id: /node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d node_name: test-generic-node @@ -366,6 +368,7 @@ scrape_configs: _service_label: bam agent_id: /agent_id/ecd8995a-d479-4b4d-bfb7-865bac4ac2fb agent_type: mongodb_exporter + cluster: test-mongodb instance: /agent_id/ecd8995a-d479-4b4d-bfb7-865bac4ac2fb node_id: /node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d node_name: test-generic-node @@ -396,6 +399,7 @@ scrape_configs: _service_label: bam agent_id: /agent_id/ecd8995a-d479-4b4d-bfb7-865bac4ac2fb agent_type: mongodb_exporter + cluster: test-mongodb instance: /agent_id/ecd8995a-d479-4b4d-bfb7-865bac4ac2fb node_id: /node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d node_name: test-generic-node @@ -428,6 +432,7 @@ scrape_configs: _service_label: bar agent_id: /agent_id/75bb30d3-ef4a-4147-97a8-621a996611dd agent_type: mysqld_exporter + cluster: test-mysql instance: /agent_id/75bb30d3-ef4a-4147-97a8-621a996611dd node_id: /node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d node_name: test-generic-node @@ -465,6 +470,7 @@ scrape_configs: _service_label: bar agent_id: /agent_id/75bb30d3-ef4a-4147-97a8-621a996611dd agent_type: mysqld_exporter + cluster: test-mysql instance: /agent_id/75bb30d3-ef4a-4147-97a8-621a996611dd node_id: /node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d node_name: test-generic-node @@ -508,6 +514,7 @@ scrape_configs: _service_label: bar agent_id: /agent_id/75bb30d3-ef4a-4147-97a8-621a996611dd agent_type: mysqld_exporter + cluster: test-mysql instance: /agent_id/75bb30d3-ef4a-4147-97a8-621a996611dd node_id: /node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d node_name: test-generic-node @@ -540,6 +547,7 @@ scrape_configs: _service_label: bar agent_id: /agent_id/f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a agent_type: mysqld_exporter + cluster: test-remote-mysql instance: /agent_id/f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a node_id: /node_id/4e2e07dc-40a1-18ca-aea9-d943260a9653 node_name: test-remote-node @@ -577,6 +585,7 @@ scrape_configs: _service_label: bar agent_id: /agent_id/f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a agent_type: mysqld_exporter + cluster: test-remote-mysql instance: /agent_id/f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a node_id: /node_id/4e2e07dc-40a1-18ca-aea9-d943260a9653 node_name: test-remote-node @@ -620,6 +629,7 @@ scrape_configs: _service_label: bar agent_id: /agent_id/f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a agent_type: mysqld_exporter + cluster: test-remote-mysql instance: /agent_id/f9ab9f7b-5e53-4952-a2e7-ff25fb90fe6a node_id: /node_id/4e2e07dc-40a1-18ca-aea9-d943260a9653 node_name: test-remote-node @@ -652,6 +662,7 @@ scrape_configs: _service_label: bar agent_id: /agent_id/29e14468-d479-4b4d-bfb7-4ac2fb865bac agent_type: postgres_exporter + cluster: test-postgresql instance: /agent_id/29e14468-d479-4b4d-bfb7-4ac2fb865bac node_id: /node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d node_name: test-generic-node @@ -681,6 +692,7 @@ scrape_configs: _service_label: bar agent_id: /agent_id/29e14468-d479-4b4d-bfb7-4ac2fb865bac agent_type: postgres_exporter + cluster: test-postgresql instance: /agent_id/29e14468-d479-4b4d-bfb7-4ac2fb865bac node_id: /node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d node_name: test-generic-node @@ -710,6 +722,7 @@ scrape_configs: _service_label: bar agent_id: /agent_id/29e14468-d479-4b4d-bfb7-4ac2fb865bac agent_type: postgres_exporter + cluster: test-postgresql instance: /agent_id/29e14468-d479-4b4d-bfb7-4ac2fb865bac node_id: /node_id/cc663f36-18ca-40a1-aea9-c6310bb4738d node_name: test-generic-node @@ -802,7 +815,7 @@ func TestBaseConfig(t *testing.T) { db, svc, original := setup(t) defer teardown(t, db, svc, original) - svc.baseConfigPath = "../../testdata/victoriametrics/promscrape.base.yml" + svc.params.BaseConfigPath = "../../testdata/victoriametrics/promscrape.base.yml" expected := strings.TrimSpace(` # Managed by pmm-managed. DO NOT EDIT. diff --git a/managed/services/vmalert/external_rules.go b/managed/services/vmalert/external_rules.go index e87030895e..b60ff6d8e2 100644 --- a/managed/services/vmalert/external_rules.go +++ b/managed/services/vmalert/external_rules.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/vmalert/init_test.go b/managed/services/vmalert/init_test.go index bf9cffa913..d147f53360 100644 --- a/managed/services/vmalert/init_test.go +++ b/managed/services/vmalert/init_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -15,7 +15,7 @@ package vmalert -import "github.com/percona/pmm/managed/utils/logger" +import "github.com/percona/pmm/utils/logger" //nolint:gochecknoinits func init() { diff --git a/managed/services/vmalert/vmalert.go b/managed/services/vmalert/vmalert.go index bc8c0f74b8..f5c86c03e0 100644 --- a/managed/services/vmalert/vmalert.go +++ b/managed/services/vmalert/vmalert.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/services/vmalert/vmalert_test.go b/managed/services/vmalert/vmalert_test.go index 47221fa94d..3d3da6afe9 100644 --- a/managed/services/vmalert/vmalert_test.go +++ b/managed/services/vmalert/vmalert_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/testdata/supervisord.d/grafana.ini b/managed/testdata/supervisord.d/grafana.ini index b3e4213506..c6a0788699 100644 --- a/managed/testdata/supervisord.d/grafana.ini +++ b/managed/testdata/supervisord.d/grafana.ini @@ -3,15 +3,9 @@ [program:grafana] priority = 3 command = - /usr/sbin/grafana-server + /usr/sbin/grafana server --homepath=/usr/share/grafana --config=/etc/grafana/grafana.ini - cfg:default.paths.data=/srv/grafana - cfg:default.paths.plugins=/srv/grafana/plugins - cfg:default.paths.logs=/srv/logs - cfg:default.log.mode=console - cfg:default.log.console.format=console - cfg:default.server.root_url="https://%%(domain)s/graph" environment = PERCONA_TEST_POSTGRES_ADDR="", PERCONA_TEST_POSTGRES_DBNAME="", diff --git a/managed/testdata/supervisord.d/pmm-db_disabled.ini b/managed/testdata/supervisord.d/pmm-db_disabled.ini index 210d822422..b45251ab1f 100644 --- a/managed/testdata/supervisord.d/pmm-db_disabled.ini +++ b/managed/testdata/supervisord.d/pmm-db_disabled.ini @@ -61,7 +61,6 @@ priority = 14 command = /usr/sbin/pmm-managed --victoriametrics-config=/etc/victoriametrics-promscrape.yml - --victoriametrics-url=http://127.0.0.1:9090/prometheus --supervisord-config-dir=/etc/supervisord.d autorestart = true autostart = true diff --git a/managed/testdata/supervisord.d/pmm-db_enabled.ini b/managed/testdata/supervisord.d/pmm-db_enabled.ini index df0fd59059..4d4ad4afd9 100644 --- a/managed/testdata/supervisord.d/pmm-db_enabled.ini +++ b/managed/testdata/supervisord.d/pmm-db_enabled.ini @@ -85,7 +85,6 @@ priority = 14 command = /usr/sbin/pmm-managed --victoriametrics-config=/etc/victoriametrics-promscrape.yml - --victoriametrics-url=http://127.0.0.1:9090/prometheus --supervisord-config-dir=/etc/supervisord.d autorestart = true autostart = true diff --git a/managed/testdata/supervisord.d/vmalert.ini b/managed/testdata/supervisord.d/vmalert.ini index be3746ef3c..0d645ed111 100644 --- a/managed/testdata/supervisord.d/vmalert.ini +++ b/managed/testdata/supervisord.d/vmalert.ini @@ -7,11 +7,11 @@ command = --notifier.url="http://127.0.0.1:9093/alertmanager,https://external-alertmanager:6443/alerts" --notifier.basicAuth.password=',"passw!,ord"' --notifier.basicAuth.username=",external-user" - --external.url=http://localhost:9090/prometheus - --datasource.url=http://127.0.0.1:9090/prometheus - --remoteRead.url=http://127.0.0.1:9090/prometheus + --external.url=http://127.0.0.1:9090/prometheus/ + --datasource.url=http://127.0.0.1:9090/prometheus/ + --remoteRead.url=http://127.0.0.1:9090/prometheus/ --remoteRead.ignoreRestoreErrors=false - --remoteWrite.url=http://127.0.0.1:9090/prometheus + --remoteWrite.url=http://127.0.0.1:9090/prometheus/ --rule=/srv/prometheus/rules/*.yml --httpListenAddr=127.0.0.1:8880 user = pmm diff --git a/managed/testdata/supervisord.d/vmproxy.ini b/managed/testdata/supervisord.d/vmproxy.ini index 72acc05eaf..5654b85bc4 100644 --- a/managed/testdata/supervisord.d/vmproxy.ini +++ b/managed/testdata/supervisord.d/vmproxy.ini @@ -4,7 +4,7 @@ priority = 9 command = /usr/sbin/vmproxy - --target-url=http://127.0.0.1:9090/ + --target-url=http://127.0.0.1:9090/prometheus/ --listen-port=8430 --listen-address=127.0.0.1 --header-name=X-Proxy-Filter diff --git a/managed/utils/clean/clean.go b/managed/utils/clean/clean.go index 8ca7e69aa6..2a319e165e 100644 --- a/managed/utils/clean/clean.go +++ b/managed/utils/clean/clean.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/clean/clean_test.go b/managed/utils/clean/clean_test.go index 8991b20850..95e2d6881e 100644 --- a/managed/utils/clean/clean_test.go +++ b/managed/utils/clean/clean_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/collectors/collectors.go b/managed/utils/collectors/collectors.go index f08905b150..66e464ff40 100644 --- a/managed/utils/collectors/collectors.go +++ b/managed/utils/collectors/collectors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/depstests/depstests.go b/managed/utils/depstests/depstests.go index dd08cf3750..f7b17754f1 100644 --- a/managed/utils/depstests/depstests.go +++ b/managed/utils/depstests/depstests.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/depstests/protobuf_test.go b/managed/utils/depstests/protobuf_test.go index 7d1ecce53c..472c9fc4e3 100644 --- a/managed/utils/depstests/protobuf_test.go +++ b/managed/utils/depstests/protobuf_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/dir/dir.go b/managed/utils/dir/dir.go index bd5f7ceb59..7714b9025c 100644 --- a/managed/utils/dir/dir.go +++ b/managed/utils/dir/dir.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/dir/dir_test.go b/managed/utils/dir/dir_test.go index e23f8cea3e..8c05ccafb7 100644 --- a/managed/utils/dir/dir_test.go +++ b/managed/utils/dir/dir_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/envvars/parser.go b/managed/utils/envvars/parser.go index 33deb8679f..3e93bde76b 100644 --- a/managed/utils/envvars/parser.go +++ b/managed/utils/envvars/parser.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -42,6 +42,7 @@ const ( envEnableAccessControl = "ENABLE_RBAC" envPlatformAPITimeout = "PERCONA_PLATFORM_API_TIMEOUT" defaultPlatformAPITimeout = 30 * time.Second + ENVvmAgentPrefix = "VMAGENT_" ) // InvalidDurationError invalid duration error. @@ -156,6 +157,12 @@ func ParseEnvVars(envs []string) (envSettings *models.ChangeSettingsParams, errs case "PMM_PUBLIC_ADDRESS": envSettings.PMMPublicAddress = v + case "PMM_VM_URL": + _, err = url.Parse(v) + if err != nil { + err = fmt.Errorf("invalid value %q for environment variable %q", v, k) + } + case "NO_PROXY", "HTTP_PROXY", "HTTPS_PROXY": continue @@ -203,6 +210,11 @@ func ParseEnvVars(envs []string) (envSettings *models.ChangeSettingsParams, errs continue } + // skip VM Agents environment variables + if strings.HasPrefix(k, ENVvmAgentPrefix) { + continue + } + // skip supervisord environment variables if strings.HasPrefix(k, "SUPERVISOR_") { continue diff --git a/managed/utils/envvars/parser_test.go b/managed/utils/envvars/parser_test.go index 6bb5d91a83..2d823ea055 100644 --- a/managed/utils/envvars/parser_test.go +++ b/managed/utils/envvars/parser_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/interceptors/grpc_extension.go b/managed/utils/interceptors/grpc_extension.go index 83455c85e5..19046adefc 100644 --- a/managed/utils/interceptors/grpc_extension.go +++ b/managed/utils/interceptors/grpc_extension.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -32,7 +32,7 @@ const ( externalCallerOrigin = callerOrigin("external") ) -// GRPCMetricsExtension for extra labels in /debug/metrics +// GRPCMetricsExtension for extra labels in /debug/metrics. type GRPCMetricsExtension struct { grpc_prometheus.DefaultExtension } diff --git a/managed/utils/interceptors/interceptors.go b/managed/utils/interceptors/interceptors.go index a1c466dcbd..039de49143 100644 --- a/managed/utils/interceptors/interceptors.go +++ b/managed/utils/interceptors/interceptors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -32,7 +32,7 @@ import ( "google.golang.org/grpc/status" "github.com/percona/pmm/api/agentpb" - "github.com/percona/pmm/managed/utils/logger" + "github.com/percona/pmm/utils/logger" ) func logRequest(l *logrus.Entry, prefix string, f func() error) (err error) { @@ -142,7 +142,7 @@ func Stream(interceptor grpc.StreamServerInterceptor) func(srv interface{}, ss g } } -// check interfaces +// check interfaces. var ( _ grpc.UnaryServerInterceptor = Unary(nil) _ grpc.StreamServerInterceptor = Stream(nil) diff --git a/managed/utils/interceptors/middlewares.go b/managed/utils/interceptors/middlewares.go index 6fa1a82837..fdd9e0d581 100644 --- a/managed/utils/interceptors/middlewares.go +++ b/managed/utils/interceptors/middlewares.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/interceptors/service.go b/managed/utils/interceptors/service.go index cf47ebd6de..86c5040e41 100644 --- a/managed/utils/interceptors/service.go +++ b/managed/utils/interceptors/service.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/irt/logger.go b/managed/utils/irt/logger.go index cbaa896b91..5a28fe31b0 100644 --- a/managed/utils/irt/logger.go +++ b/managed/utils/irt/logger.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/irt/metrics.go b/managed/utils/irt/metrics.go index 19c9876ee0..57a72ebc03 100644 --- a/managed/utils/irt/metrics.go +++ b/managed/utils/irt/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -75,7 +75,7 @@ func (m *metrics) Collect(ch chan<- prom.Metric) { m.duration.Collect(ch) } -// check interfaces +// check interfaces. var ( _ prom.Collector = (*metrics)(nil) ) diff --git a/managed/utils/platform/client.go b/managed/utils/platform/client.go index e6367d910d..c199e501e0 100644 --- a/managed/utils/platform/client.go +++ b/managed/utils/platform/client.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/pprof/pprof.go b/managed/utils/pprof/pprof.go index 007a8b39f3..71c5687c76 100644 --- a/managed/utils/pprof/pprof.go +++ b/managed/utils/pprof/pprof.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/pprof/pprof_test.go b/managed/utils/pprof/pprof_test.go index f80204a99a..1dcc59a4ba 100644 --- a/managed/utils/pprof/pprof_test.go +++ b/managed/utils/pprof/pprof_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/signatures/signatures.go b/managed/utils/signatures/signatures.go index d5e4f9e02a..8d6d905d29 100644 --- a/managed/utils/signatures/signatures.go +++ b/managed/utils/signatures/signatures.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/signatures/signatures_test.go b/managed/utils/signatures/signatures_test.go index af86cf0fd8..9e8935421e 100644 --- a/managed/utils/signatures/signatures_test.go +++ b/managed/utils/signatures/signatures_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/stringset/stringset.go b/managed/utils/stringset/stringset.go index 548f07ad4f..b59b3c02af 100644 --- a/managed/utils/stringset/stringset.go +++ b/managed/utils/stringset/stringset.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/testdb/db.go b/managed/utils/testdb/db.go index 1a2354ff9f..d5707e367a 100644 --- a/managed/utils/testdb/db.go +++ b/managed/utils/testdb/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/tests/asserts.go b/managed/utils/tests/asserts.go index 6371f8dc46..cb52d9296a 100644 --- a/managed/utils/tests/asserts.go +++ b/managed/utils/tests/asserts.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/tests/aws.go b/managed/utils/tests/aws.go index 8537fa1a72..ed003a2350 100644 --- a/managed/utils/tests/aws.go +++ b/managed/utils/tests/aws.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/tests/credentials.go b/managed/utils/tests/credentials.go index cac0241de7..8d5852ec73 100644 --- a/managed/utils/tests/credentials.go +++ b/managed/utils/tests/credentials.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/tests/fuzz.go b/managed/utils/tests/fuzz.go index 36dd4f4583..918e7c5bd9 100644 --- a/managed/utils/tests/fuzz.go +++ b/managed/utils/tests/fuzz.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/tests/id.go b/managed/utils/tests/id.go index b02ab45804..d49ccc706e 100644 --- a/managed/utils/tests/id.go +++ b/managed/utils/tests/id.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -52,7 +52,7 @@ func SetTestIDReader(t *testing.T) { t.Cleanup(func() { uuid.SetRand(nil) }) } -// check interfaces +// check interfaces. var ( _ io.Reader = (*IDReader)(nil) ) diff --git a/managed/utils/validators/alerting_rules.go b/managed/utils/validators/alerting_rules.go index 81fb8aa66f..d00de9a17f 100644 --- a/managed/utils/validators/alerting_rules.go +++ b/managed/utils/validators/alerting_rules.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/validators/alerting_rules_test.go b/managed/utils/validators/alerting_rules_test.go index 859dde22d7..ed40d7daff 100644 --- a/managed/utils/validators/alerting_rules_test.go +++ b/managed/utils/validators/alerting_rules_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/managed/utils/validators/validators.go b/managed/utils/validators/validators.go index 7257cf917e..8a4fd3d983 100644 --- a/managed/utils/validators/validators.go +++ b/managed/utils/validators/validators.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/db.go b/qan-api2/db.go index de3ed9d776..8c87408258 100644 --- a/qan-api2/db.go +++ b/qan-api2/db.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/db_test.go b/qan-api2/db_test.go index 1eb145ea93..fc06a5fd7d 100644 --- a/qan-api2/db_test.go +++ b/qan-api2/db_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/exporters/slow_log.go b/qan-api2/exporters/slow_log.go index e13c81e03f..db3d6cd0cc 100644 --- a/qan-api2/exporters/slow_log.go +++ b/qan-api2/exporters/slow_log.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/main.go b/qan-api2/main.go index 9d94f52758..c155e85c1e 100644 --- a/qan-api2/main.go +++ b/qan-api2/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -27,8 +27,6 @@ import ( _ "net/http/pprof" //nolint:gosec "os" "os/signal" - "path/filepath" - "runtime" "strings" "sync" "time" @@ -56,7 +54,7 @@ import ( aservice "github.com/percona/pmm/qan-api2/services/analytics" rservice "github.com/percona/pmm/qan-api2/services/receiver" "github.com/percona/pmm/qan-api2/utils/interceptors" - "github.com/percona/pmm/qan-api2/utils/logger" + "github.com/percona/pmm/utils/logger" "github.com/percona/pmm/utils/sqlmetrics" "github.com/percona/pmm/version" ) @@ -278,25 +276,7 @@ func main() { log.Printf("%s.", version.ShortInfo()) - logrus.SetFormatter(&logrus.TextFormatter{ - // Enable multiline-friendly formatter in both development (with terminal) and production (without terminal): - // https://github.com/sirupsen/logrus/blob/839c75faf7f98a33d445d181f3018b5c3409a45e/text_formatter.go#L176-L178 - ForceColors: true, - FullTimestamp: true, - TimestampFormat: "2006-01-02T15:04:05.000-07:00", - - CallerPrettyfier: func(f *runtime.Frame) (string, string) { - _, function := filepath.Split(f.Function) - - // keep a single directory name as a compromise between brevity and unambiguity - var dir string - dir, file := filepath.Split(f.File) - dir = filepath.Base(dir) - file = fmt.Sprintf("%s/%s:%d", dir, file, f.Line) - - return function, file - }, - }) + logger.SetupGlobalLogger() if *debugF { logrus.SetLevel(logrus.DebugLevel) diff --git a/qan-api2/maincover_test.go b/qan-api2/maincover_test.go index 1828a08ed0..4f5accd141 100644 --- a/qan-api2/maincover_test.go +++ b/qan-api2/maincover_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/models/base.go b/qan-api2/models/base.go index 4f0368d8aa..45a3493b98 100644 --- a/qan-api2/models/base.go +++ b/qan-api2/models/base.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/models/data_ingestion.go b/qan-api2/models/data_ingestion.go index 126052c9b4..d6eda35ba5 100644 --- a/qan-api2/models/data_ingestion.go +++ b/qan-api2/models/data_ingestion.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -509,7 +509,7 @@ type MetricsBucketExtended struct { *qanpb.MetricsBucket } -// MetricsBucket implements models to store metrics bucket +// MetricsBucket implements models to store metrics bucket. type MetricsBucket struct { db *sqlx.DB l *logrus.Entry @@ -747,7 +747,7 @@ func mapToArrsIntInt(m map[uint64]uint64) ([]uint64, []uint64) { return keys, values } -// check interfaces +// check interfaces. var ( _ prometheus.Collector = (*MetricsBucket)(nil) ) diff --git a/qan-api2/models/metrics.go b/qan-api2/models/metrics.go index 099465cc04..70dac41689 100644 --- a/qan-api2/models/metrics.go +++ b/qan-api2/models/metrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -23,6 +23,7 @@ import ( "fmt" "log" "sort" + "strings" "text/template" "time" @@ -977,7 +978,53 @@ func (m *Metrics) QueryExists(ctx context.Context, serviceID, query string) (boo return false, nil } -const queryByQueryIDTmpl = `SELECT explain_fingerprint, fingerprint, placeholders_count FROM metrics +const schemaByQueryIDTmpl = `SELECT schema FROM metrics +WHERE service_id = :service_id AND queryid = :query_id LIMIT 1;` + +// SchemaByQueryID returns schema for given queryID and serviceID. +func (m *Metrics) SchemaByQueryID(ctx context.Context, serviceID, queryID string) (*qanpb.SchemaByQueryIDReply, error) { + arg := map[string]interface{}{ + "service_id": serviceID, + "query_id": queryID, + } + + var queryBuffer bytes.Buffer + queryBuffer.WriteString(schemaByQueryIDTmpl) + + query, args, err := sqlx.Named(queryBuffer.String(), arg) + if err != nil { + return nil, errors.Wrap(err, cannotPrepare) + } + query, args, err = sqlx.In(query, args...) + if err != nil { + return nil, errors.Wrap(err, cannotPopulate) + } + query = m.db.Rebind(query) + + queryCtx, cancel := context.WithTimeout(ctx, queryTimeout) + defer cancel() + + rows, err := m.db.QueryxContext(queryCtx, query, args...) + if err != nil { + return nil, errors.Wrap(err, cannotExecute) + } + defer rows.Close() //nolint:errcheck + + res := &qanpb.SchemaByQueryIDReply{} + for rows.Next() { + err = rows.Scan(&res.Schema) + + if err != nil { + return res, errors.Wrap(err, "failed to scan query") + } + + return res, nil //nolint:staticcheck + } + + return res, nil +} + +const queryByQueryIDTmpl = `SELECT explain_fingerprint, fingerprint, example, placeholders_count FROM metrics WHERE service_id = :service_id AND queryid = :query_id LIMIT 1; ` @@ -1011,17 +1058,25 @@ func (m *Metrics) ExplainFingerprintByQueryID(ctx context.Context, serviceID, qu } defer rows.Close() //nolint:errcheck - var fingerprint string + var fingerprint, example string for rows.Next() { err = rows.Scan( &res.ExplainFingerprint, &fingerprint, + &example, &res.PlaceholdersCount) if err != nil { return res, errors.Wrap(err, "failed to scan query") } + if example != "" { + res.ExplainFingerprint = example + res.PlaceholdersCount = 0 + + return res, nil + } + if res.ExplainFingerprint == "" { res.ExplainFingerprint = fingerprint } @@ -1033,18 +1088,16 @@ func (m *Metrics) ExplainFingerprintByQueryID(ctx context.Context, serviceID, qu } const selectedQueryMetadataTmpl = ` -SELECT any(service_name), - any(database), - any(schema), - any(username), - any(replication_set), - any(cluster), - any(service_type), - any(service_id), - any(environment), - any(node_id), - any(node_name), - any(node_type) +SELECT DISTINCT service_name, + database, + schema, + username, + replication_set, + cluster, + service_type, + environment, + node_name, + node_type FROM metrics WHERE period_start >= :period_start_from AND period_start <= :period_start_to {{ if not .Totals }} AND {{ .Group }} = '{{ .DimensionVal }}' @@ -1058,10 +1111,7 @@ WHERE period_start >= :period_start_from AND period_start <= :period_start_to AND ({{range $key, $vals := .Labels }}{{ $i = inc $i}} {{ if gt $i 1}} OR {{ end }} has(['{{ StringsJoin $vals "', '" }}'], labels.value[indexOf(labels.key, '{{ $key }}')]) {{ end }}) -{{ end }} -{{ if not .Totals }} GROUP BY {{ .Group }} {{ end }} -WITH TOTALS; ` // GetSelectedQueryMetadata returns metadata for given query ID. @@ -1120,26 +1170,57 @@ func (m *Metrics) GetSelectedQueryMetadata(ctx context.Context, periodStartFromS } defer rows.Close() + metadata := make(map[string]map[string]struct{}) + columnNames, err := rows.Columns() + if err != nil { + return nil, errors.Wrap(err, "failed to get column names") + } + for _, name := range columnNames { + metadata[name] = make(map[string]struct{}) + } + for rows.Next() { - err = rows.Scan( - &res.ServiceName, - &res.Database, - &res.Schema, - &res.Username, - &res.ReplicationSet, - &res.Cluster, - &res.ServiceType, - &res.ServiceId, - &res.Environment, - &res.NodeId, - &res.NodeName, - &res.NodeType) + row := make([]any, len(columnNames)) + for i := range columnNames { + row[i] = new(string) + } + + err = rows.Scan(row...) if err != nil { - return res, errors.Wrap(err, "failed to scan query") - } else { - return res, nil + if errors.Is(err, sql.ErrNoRows) { + return nil, errors.Wrap(err, "query_id doesnt exists") + } + return nil, errors.Wrap(err, "failed to scan query") + } + + for k, v := range row { + if value, ok := v.(*string); ok { + metadata[columnNames[k]][*value] = struct{}{} + } } } - return res, errors.New("query_id doesnt exists") + res.ServiceName = prepareMetadataProperty(metadata["service_name"]) + res.Database = prepareMetadataProperty(metadata["database"]) + res.Schema = prepareMetadataProperty(metadata["schema"]) + res.Username = prepareMetadataProperty(metadata["username"]) + res.ReplicationSet = prepareMetadataProperty(metadata["replication_set"]) + res.Cluster = prepareMetadataProperty(metadata["cluster"]) + res.ServiceType = prepareMetadataProperty(metadata["service_type"]) + res.Environment = prepareMetadataProperty(metadata["environment"]) + res.NodeName = prepareMetadataProperty(metadata["node_name"]) + res.NodeType = prepareMetadataProperty(metadata["node_type"]) + + return res, nil +} + +func prepareMetadataProperty(metadata map[string]struct{}) string { + res := []string{} + for k := range metadata { + res = append(res, k) + } + + sort.Strings(res) + + return strings.Join(res, ", ") } diff --git a/qan-api2/models/reporter.go b/qan-api2/models/reporter.go index 4ceebcd10f..4a5e463626 100644 --- a/qan-api2/models/reporter.go +++ b/qan-api2/models/reporter.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/services/analytics/base.go b/qan-api2/services/analytics/base.go index b9e9bd54e0..5d91cf5014 100644 --- a/qan-api2/services/analytics/base.go +++ b/qan-api2/services/analytics/base.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/services/analytics/filters.go b/qan-api2/services/analytics/filters.go index da6cdc9bfe..97d46ba1de 100644 --- a/qan-api2/services/analytics/filters.go +++ b/qan-api2/services/analytics/filters.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/services/analytics/filters_test.go b/qan-api2/services/analytics/filters_test.go index c7afc95c5a..31b4fb81f4 100644 --- a/qan-api2/services/analytics/filters_test.go +++ b/qan-api2/services/analytics/filters_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -24,7 +24,7 @@ import ( "time" _ "github.com/ClickHouse/clickhouse-go/151" // register database/sql driver - // TODO replace with 'google.golang.org/protobuf/encoding/protojson' since this one is deprecated + // TODO replace with 'google.golang.org/protobuf/encoding/protojson' since this one is deprecated. "github.com/golang/protobuf/ptypes/timestamp" "github.com/jmoiron/sqlx" "github.com/stretchr/testify/assert" diff --git a/qan-api2/services/analytics/metrics_names.go b/qan-api2/services/analytics/metrics_names.go index 5d5074e0a3..4f913d80dd 100644 --- a/qan-api2/services/analytics/metrics_names.go +++ b/qan-api2/services/analytics/metrics_names.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/services/analytics/metrics_names_test.go b/qan-api2/services/analytics/metrics_names_test.go index b9ca476b6f..c7e8edc667 100644 --- a/qan-api2/services/analytics/metrics_names_test.go +++ b/qan-api2/services/analytics/metrics_names_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/services/analytics/object_details.go b/qan-api2/services/analytics/object_details.go index 79ffa56ea2..f3bdc191fb 100644 --- a/qan-api2/services/analytics/object_details.go +++ b/qan-api2/services/analytics/object_details.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -377,3 +377,16 @@ func (s *Service) ExplainFingerprintByQueryID(ctx context.Context, in *qanpb.Exp return res, nil } + +// SchemaByQueryID returns schema for given queryID and serviceID. +func (s *Service) SchemaByQueryID(ctx context.Context, in *qanpb.SchemaByQueryIDRequest) (*qanpb.SchemaByQueryIDReply, error) { + res, err := s.mm.SchemaByQueryID( + ctx, + in.ServiceId, + in.QueryId) + if err != nil { + return nil, fmt.Errorf("error in checking query:%w", err) + } + + return res, nil +} diff --git a/qan-api2/services/analytics/object_details_test.go b/qan-api2/services/analytics/object_details_test.go index 6a0173949c..05793dd581 100644 --- a/qan-api2/services/analytics/object_details_test.go +++ b/qan-api2/services/analytics/object_details_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -21,7 +21,7 @@ import ( "testing" "time" - // TODO replace with 'google.golang.org/protobuf/encoding/protojson' since this one is deprecated + // TODO replace with 'google.golang.org/protobuf/encoding/protojson' since this one is deprecated. "github.com/golang/protobuf/jsonpb" //nolint:staticcheck "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/assert" diff --git a/qan-api2/services/analytics/profile.go b/qan-api2/services/analytics/profile.go index de0e498254..d2cb850cda 100644 --- a/qan-api2/services/analytics/profile.go +++ b/qan-api2/services/analytics/profile.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/services/analytics/profile_test.go b/qan-api2/services/analytics/profile_test.go index 429a7c1211..895a7f4dfd 100644 --- a/qan-api2/services/analytics/profile_test.go +++ b/qan-api2/services/analytics/profile_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -23,9 +23,9 @@ import ( "testing" "time" - // TODO replace with 'google.golang.org/protobuf/encoding/protojson' since this one is deprecated + // TODO replace with 'google.golang.org/protobuf/encoding/protojson' since this one is deprecated. "github.com/golang/protobuf/jsonpb" //nolint:staticcheck - // TODO replace with 'google.golang.org/protobuf/proto' since this one is deprecated + // TODO replace with 'google.golang.org/protobuf/proto' since this one is deprecated. "github.com/golang/protobuf/proto" //nolint:staticcheck "github.com/golang/protobuf/ptypes/timestamp" "github.com/jmoiron/sqlx" diff --git a/qan-api2/services/receiver/receiver.go b/qan-api2/services/receiver/receiver.go index 4d963dd2b7..127f4c0fba 100644 --- a/qan-api2/services/receiver/receiver.go +++ b/qan-api2/services/receiver/receiver.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/qan-api2/test_data/GetMetrics_group_by_queryid.json b/qan-api2/test_data/GetMetrics_group_by_queryid.json index d4e86c01e2..c383b330df 100644 --- a/qan-api2/test_data/GetMetrics_group_by_queryid.json +++ b/qan-api2/test_data/GetMetrics_group_by_queryid.json @@ -3435,15 +3435,13 @@ }, "fingerprint": "select @@global.slow_query_log_file", "metadata": { - "serviceName": "server0", - "schema": "schema29", - "username": "user8", + "serviceName": "server0, server1, server2, server3, server4, server5, server6, server7, server8, server9", + "schema": "schema0, schema1, schema10, schema13, schema14, schema20, schema21, schema23, schema27, schema28, schema29, schema3, schema30, schema31, schema33, schema35, schema37, schema40, schema42, schema44, schema46, schema47, schema48, schema51, schema52, schema53, schema56, schema58, schema59, schema60, schema61, schema65, schema68, schema69, schema70, schema72, schema74, schema75, schema76, schema77, schema80, schema81, schema82, schema84, schema88, schema89, schema94, schema96, schema97, schema99", + "username": "user1, user10, user14, user16, user24, user26, user27, user28, user30, user31, user32, user33, user34, user38, user40, user41, user44, user45, user46, user49, user55, user56, user6, user60, user61, user64, user67, user69, user70, user74, user76, user79, user8, user82, user84, user85, user86, user87, user89, user90, user91, user92, user95, user96, user97, user98, user99", "replicationSet": "replication_set1", "cluster": "cluster1", "serviceType": "service_type1", - "serviceId": "service_id1", "environment": "environment1", - "nodeId": "node_id1", "nodeName": "node_name1", "nodeType": "node_type1" } diff --git a/qan-api2/test_data/GetMetrics_sparklines_90_points.json b/qan-api2/test_data/GetMetrics_sparklines_90_points.json index 4b69df0d83..91cedf727d 100644 --- a/qan-api2/test_data/GetMetrics_sparklines_90_points.json +++ b/qan-api2/test_data/GetMetrics_sparklines_90_points.json @@ -1437,15 +1437,13 @@ }, "fingerprint": "select @@global.slow_query_log_file", "metadata": { - "serviceName": "server2", - "schema": "schema81", - "username": "user38", + "serviceName": "server2, server3, server4, server5, server6, server7, server8, server9", + "schema": "schema10, schema13, schema3, schema33, schema35, schema40, schema44, schema52, schema59, schema61, schema72, schema81, schema96", + "username": "user1, user26, user27, user28, user31, user38, user64, user82, user95, user96, user97, user98", "replicationSet": "replication_set1", "cluster": "cluster1", "serviceType": "service_type1", - "serviceId": "service_id1", "environment": "environment1", - "nodeId": "node_id1", "nodeName": "node_name1", "nodeType": "node_type1" } diff --git a/qan-api2/test_data/GetMetrics_total.json b/qan-api2/test_data/GetMetrics_total.json index 32978b0f56..d144f24dd5 100644 --- a/qan-api2/test_data/GetMetrics_total.json +++ b/qan-api2/test_data/GetMetrics_total.json @@ -6698,15 +6698,13 @@ } }, "metadata": { - "serviceName": "server0", - "schema": "schema12", - "username": "user19", + "serviceName": "server0, server1, server2, server3, server4, server5, server6, server7, server8, server9", + "schema": "schema0, schema1, schema10, schema11, schema12, schema13, schema14, schema15, schema16, schema17, schema18, schema19, schema2, schema20, schema21, schema22, schema23, schema24, schema25, schema26, schema27, schema28, schema29, schema3, schema30, schema31, schema32, schema33, schema34, schema35, schema36, schema37, schema38, schema39, schema4, schema40, schema41, schema42, schema43, schema44, schema45, schema46, schema47, schema48, schema49, schema5, schema50, schema51, schema52, schema53, schema54, schema55, schema56, schema57, schema58, schema59, schema6, schema60, schema61, schema62, schema63, schema64, schema65, schema66, schema67, schema68, schema69, schema7, schema70, schema71, schema72, schema73, schema74, schema75, schema76, schema77, schema78, schema79, schema8, schema80, schema81, schema82, schema83, schema84, schema85, schema86, schema87, schema88, schema89, schema9, schema90, schema91, schema92, schema93, schema94, schema95, schema96, schema97, schema98, schema99", + "username": "user0, user1, user10, user11, user12, user13, user14, user15, user16, user17, user18, user19, user2, user20, user21, user22, user23, user24, user25, user26, user27, user28, user29, user3, user30, user31, user32, user33, user34, user35, user36, user37, user38, user39, user4, user40, user41, user42, user43, user44, user45, user46, user47, user48, user49, user5, user50, user51, user52, user53, user54, user55, user56, user57, user58, user59, user6, user60, user61, user62, user63, user64, user65, user66, user67, user68, user69, user7, user70, user71, user72, user73, user74, user75, user76, user77, user78, user79, user8, user80, user81, user82, user83, user84, user85, user86, user87, user88, user89, user9, user90, user91, user92, user93, user94, user95, user96, user97, user98, user99", "replicationSet": "replication_set1", "cluster": "cluster1", "serviceType": "service_type1", - "serviceId": "service_id1", "environment": "environment1", - "nodeId": "node_id1", "nodeName": "node_name1", "nodeType": "node_type1" } diff --git a/qan-api2/utils/interceptors/interceptors.go b/qan-api2/utils/interceptors/interceptors.go index c5aca053fb..fa2cda3033 100644 --- a/qan-api2/utils/interceptors/interceptors.go +++ b/qan-api2/utils/interceptors/interceptors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -124,7 +124,7 @@ func Stream(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, return err } -// check interfaces +// check interfaces. var ( _ grpc.UnaryServerInterceptor = Unary _ grpc.StreamServerInterceptor = Stream diff --git a/qan-api2/utils/logger/grpc.go b/qan-api2/utils/logger/grpc.go index d658750634..7fa6342b83 100644 --- a/qan-api2/utils/logger/grpc.go +++ b/qan-api2/utils/logger/grpc.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -38,7 +38,7 @@ func (v *GRPC) Info(args ...interface{}) { v.Trace(args...) } func (v *GRPC) Infoln(args ...interface{}) { v.Traceln(args...) } func (v *GRPC) Infof(format string, args ...interface{}) { v.Tracef(format, args...) } -// check interfaces +// check interfaces. var ( _ grpclog.LoggerV2 = (*GRPC)(nil) ) diff --git a/qan-api2/utils/logger/logger.go b/qan-api2/utils/logger/logger.go index d51b3cc4f6..5bc5b12f8e 100644 --- a/qan-api2/utils/logger/logger.go +++ b/qan-api2/utils/logger/logger.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -23,7 +23,7 @@ import ( "github.com/sirupsen/logrus" ) -// key is unexported to prevent collisions - it is different from any other type in other packages +// key is unexported to prevent collisions - it is different from any other type in other packages. var key = struct{}{} // Get returns logrus entry for given context. Set must be called before this method is called. diff --git a/tools/go.mod b/tools/go.mod index 8219ee2346..a249cc15de 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,28 +1,28 @@ module github.com/percona/pmm/tools -go 1.20 +go 1.21 replace github.com/go-openapi/spec => github.com/Percona-Lab/spec v0.20.5-percona require ( github.com/BurntSushi/go-sumtype v0.0.0-20190304192233-fcb4a6205bdc github.com/Percona-Lab/swagger-order v0.0.0-20191002141859-166b3973d026 - github.com/apache/skywalking-eyes v0.4.0 - github.com/bufbuild/buf v1.23.0 - github.com/daixiang0/gci v0.10.1 - github.com/envoyproxy/protoc-gen-validate v1.0.1 + github.com/apache/skywalking-eyes v0.5.0 + github.com/bufbuild/buf v1.26.1 + github.com/daixiang0/gci v0.11.0 + github.com/envoyproxy/protoc-gen-validate v1.0.2 github.com/go-delve/delve v1.21.0 github.com/go-openapi/runtime v0.25.0 github.com/go-openapi/spec v0.20.4 github.com/go-swagger/go-swagger v0.29.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 github.com/jstemmer/go-junit-report v1.0.0 - github.com/quasilyte/go-consistent v0.0.0-20200404105227-766526bf1e96 - github.com/reviewdog/reviewdog v0.14.1 + github.com/quasilyte/go-consistent v0.6.0 + github.com/reviewdog/reviewdog v0.15.0 github.com/vburenin/ifacemaker v1.2.1 - github.com/vektra/mockery/v2 v2.30.16 - golang.org/x/perf v0.0.0-20211012211434-03971e389cd3 - golang.org/x/tools v0.10.0 + github.com/vektra/mockery/v2 v2.33.0 + golang.org/x/perf v0.0.0-20230717203022-1ba3a21238c9 + golang.org/x/tools v0.13.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 google.golang.org/protobuf v1.31.0 gopkg.in/reform.v1 v1.5.1 @@ -30,41 +30,49 @@ require ( ) require ( - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.1 // indirect + cloud.google.com/go v0.110.7 // indirect + cloud.google.com/go/compute v1.23.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/datastore v1.11.0 // indirect + cloud.google.com/go/datastore v1.14.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.1.1 // indirect - github.com/Masterminds/sprig/v3 v3.2.2 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect + github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794 // indirect + github.com/acomagu/bufpipe v1.0.4 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/bmatcuk/doublestar/v2 v2.0.4 // indirect - github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 // indirect - github.com/bufbuild/connect-go v1.8.0 // indirect - github.com/bufbuild/connect-opentelemetry-go v0.3.0 // indirect - github.com/bufbuild/protocompile v0.5.1 // indirect + github.com/bradleyfalzon/ghinstallation/v2 v2.6.0 // indirect + github.com/bufbuild/connect-go v1.9.0 // indirect + github.com/bufbuild/connect-opentelemetry-go v0.4.0 // indirect + github.com/bufbuild/protocompile v0.6.0 // indirect github.com/chigopher/pathlib v0.15.0 // indirect github.com/cilium/ebpf v0.7.0 // indirect + github.com/cloudflare/circl v1.3.3 // indirect github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect github.com/cosiner/argv v0.1.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/denisenkom/go-mssqldb v0.9.0 // indirect github.com/derekparker/trie v0.0.0-20221213183930-4c74548207f4 // indirect - github.com/docker/cli v24.0.2+incompatible // indirect + github.com/docker/cli v24.0.4+incompatible // indirect github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker v24.0.2+incompatible // indirect - github.com/docker/docker-credential-helpers v0.7.0 // indirect + github.com/docker/docker v24.0.4+incompatible // indirect + github.com/docker/docker-credential-helpers v0.8.0 // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect + github.com/emirpasic/gods v1.18.1 // indirect github.com/felixge/fgprof v0.9.3 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-chi/chi/v5 v5.0.8 // indirect + github.com/go-chi/chi/v5 v5.0.10 // indirect github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d // indirect + github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-git/go-billy/v5 v5.4.1 // indirect + github.com/go-git/go-git/v5 v5.8.0 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/analysis v0.21.3 // indirect @@ -86,7 +94,7 @@ require ( github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gofrs/uuid/v5 v5.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.1.0 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect github.com/golang/glog v1.1.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -95,33 +103,36 @@ require ( github.com/google/go-containerregistry v0.15.2 // indirect github.com/google/go-dap v0.9.1 // indirect github.com/google/go-github/v33 v33.0.0 // indirect - github.com/google/go-github/v39 v39.2.0 // indirect - github.com/google/go-github/v41 v41.0.0 // indirect + github.com/google/go-github/v53 v53.2.0 // indirect + github.com/google/go-github/v55 v55.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/licensecheck v0.3.1 // indirect - github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect + github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 // indirect + github.com/google/s2a-go v0.1.4 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.7.1 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect + github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-retryablehttp v0.7.0 // indirect + github.com/hashicorp/go-retryablehttp v0.7.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/haya14busa/go-actions-toolkit v0.0.0-20200105081403-ca0307860f01 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect - github.com/huandu/xstrings v1.3.1 // indirect + github.com/huandu/xstrings v1.4.0 // indirect github.com/iancoleman/orderedmap v0.2.0 // indirect github.com/iancoleman/strcase v0.2.0 // indirect - github.com/imdario/mergo v0.3.12 // indirect + github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgx v3.6.2+incompatible // indirect + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 // indirect github.com/jessevdk/go-flags v1.5.0 // indirect github.com/jinzhu/copier v0.3.5 // indirect github.com/josharian/intern v1.0.0 // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kisielk/gotool v1.0.0 // indirect - github.com/klauspost/compress v1.16.6 // indirect + github.com/klauspost/compress v1.16.7 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -133,31 +144,34 @@ require ( github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-shellwords v1.0.12 // indirect - github.com/mattn/go-sqlite3 v1.14.5 // indirect - github.com/mitchellh/copystructure v1.0.0 // indirect + github.com/mattn/go-sqlite3 v1.14.6 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mitchellh/reflectwalk v1.0.1 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/term v0.5.0 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc3 // indirect + github.com/opencontainers/image-spec v1.1.0-rc4 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.7.0 // indirect github.com/reva2/bitbucket-insights-api v1.0.0 // indirect - github.com/reviewdog/errorformat v0.0.0-20220309155058-b075c45b6d9a // indirect + github.com/reviewdog/errorformat v0.0.0-20230810075619-82e5d4ad20d2 // indirect github.com/reviewdog/go-bitbucket v0.0.0-20201024094602-708c3f6a7de0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/rs/cors v1.9.0 // indirect github.com/rs/zerolog v1.29.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/shopspring/decimal v1.2.0 // indirect + github.com/sergi/go-diff v1.3.1 // indirect + github.com/shopspring/decimal v1.3.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect + github.com/skeema/knownhosts v1.2.0 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/cobra v1.7.0 // indirect @@ -165,11 +179,12 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.15.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect - github.com/tetratelabs/wazero v1.2.1 // indirect + github.com/tetratelabs/wazero v1.3.1 // indirect github.com/toqueteos/webbrowser v1.2.0 // indirect github.com/vbatts/tar-split v0.11.3 // indirect - github.com/vvakame/sdlog v0.0.0-20200409072131-7c0d359efddc // indirect - github.com/xanzy/go-gitlab v0.63.0 // indirect + github.com/vvakame/sdlog v1.2.0 // indirect + github.com/xanzy/go-gitlab v0.91.1 // indirect + github.com/xanzy/ssh-agent v0.3.3 // indirect go.mongodb.org/mongo-driver v1.9.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/otel v1.16.0 // indirect @@ -181,26 +196,27 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4 // indirect - golang.org/x/build v0.0.0-20200616162219-07bebbe343e9 // indirect - golang.org/x/crypto v0.10.0 // indirect + golang.org/x/build v0.0.0-20230905185615-7f65e2bc812a // indirect + golang.org/x/crypto v0.13.0 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/mod v0.11.0 // indirect - golang.org/x/net v0.11.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect + golang.org/x/mod v0.12.0 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/oauth2 v0.12.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/term v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect - golang.org/x/time v0.1.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/term v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect + golang.org/x/time v0.3.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.114.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/grpc v1.55.0 // indirect + google.golang.org/api v0.128.0 // indirect + google.golang.org/appengine v1.6.8-0.20221117013220-504804fb50de // indirect + google.golang.org/genproto v0.0.0-20230821184602-ccc8af3d0e93 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.58.0 // indirect gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index 4cffd9135b..ea9d3bd983 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -18,24 +18,24 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o= +cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= -cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= +cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/datastore v1.11.0 h1:iF6I/HaLs3Ado8uRKMvZRvF/ZLkWaWE9i8AiHzbC774= -cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= +cloud.google.com/go/datastore v1.14.0 h1:Mq0ApTRdLW3/dyiw+DkjTk0+iGIUvkbzaC8sfPwWTH4= +cloud.google.com/go/datastore v1.14.0/go.mod h1:GAeStMBIt9bPS7jMJA85kgkpsMkvseWWXiaHya9Jes8= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -47,6 +47,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= 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/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= @@ -59,21 +60,29 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20190129172621-c8b1d7a94ddf/go.mod h1:aJ4qN3TfrelA6NZ6AXsXRfmEVaYin3EDbSPJrKS8OXo= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= -github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Percona-Lab/spec v0.20.5-percona h1:ViCJVq52QIZxpP8/Nv4/nIed+WnqUirNjPtXvHhset4= github.com/Percona-Lab/spec v0.20.5-percona/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/Percona-Lab/swagger-order v0.0.0-20191002141859-166b3973d026 h1:jvuxsQEuFpoSVw9HCP4kSF52BXYzTvB7CA3eryQXaRc= github.com/Percona-Lab/swagger-order v0.0.0-20191002141859-166b3973d026/go.mod h1:rTCUGM0dF3N6kw5DdoxLDWe7FL49OxY13Y0Ev1jS/BQ= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 h1:KLq8BE0KwCL+mmXnjLWEAOYO+2l2AE4YMmqG1ZpZHBs= +github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= github.com/aclements/go-gg v0.0.0-20170118225347-6dbb4e4fefb0/go.mod h1:55qNq4vcpkIuHowELi5C8e+1yUHtoLoOUR9QU5j7Tes= -github.com/aclements/go-moremath v0.0.0-20161014184102-0ff62e0875ff/go.mod h1:idZL3yvz4kzx1dsBOAC+oYv6L92P1oFEhUXUB1A/lwQ= +github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794 h1:xlwdaKcTNVW4PtpQb8aKA4Pjy0CdJHEqvFbAnvR5m2g= +github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794/go.mod h1:7e+I0LQFUI9AXWxOfsQROs9xPhoJtbsyWcjJqDd4KPY= +github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= +github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -81,38 +90,46 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/apache/skywalking-eyes v0.4.0 h1:O13kdRU6FCEZevfD01mdhTgCZLLfPZIQ0GXZrLl7FpQ= -github.com/apache/skywalking-eyes v0.4.0/go.mod h1:WblDbBgOLsLN0FJEBa9xj6PhuUA/J6spKYVTG4/F8Ls= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/skywalking-eyes v0.5.0 h1:X41jAhmnJazHuR5mOGt1nZA7mFaAluf9mvB1JBzr5xI= +github.com/apache/skywalking-eyes v0.5.0/go.mod h1:rwVEbfh8GovISedSOc7nHGrcnkQ7sfTc31iYU5hSpEE= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.30.15/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= +github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bmatcuk/doublestar/v2 v2.0.4 h1:6I6oUiT/sU27eE2OFcWqBhL1SwjyvQuOssxT4a1yidI= github.com/bmatcuk/doublestar/v2 v2.0.4/go.mod h1:QMmcs3H2AUQICWhfzLXz+IYln8lRQmTZRptLie8RgRw= -github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 h1:tXKVfhE7FcSkhkv0UwkLvPDeZ4kz6OXd0PKPlFqf81M= -github.com/bradleyfalzon/ghinstallation/v2 v2.0.4/go.mod h1:B40qPqJxWE0jDZgOR1JmaMy+4AY1eBP+IByOvqyAKp0= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/bradleyfalzon/ghinstallation/v2 v2.6.0 h1:IRY7Xy588KylkoycsUhFpW7cdGpy5Y5BPsz4IfuJtGk= +github.com/bradleyfalzon/ghinstallation/v2 v2.6.0/go.mod h1:oQ3etOwN3TRH4EwgW5/7MxSVMGlMlzG/O8TU7eYdoSk= github.com/brianvoe/gofakeit v3.18.0+incompatible h1:wDOmHc9DLG4nRjUVVaxA+CEglKOW72Y5+4WNxUIkjM8= github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7WPaDzUjz+CZFqG+rPkOjGOc= -github.com/bufbuild/buf v1.23.0 h1:QD6xCygtCVhN6qsQ4TtE2xGRK86xGkjI9lNHJ5jaj+M= -github.com/bufbuild/buf v1.23.0/go.mod h1:ERFRzJiIjAOzUSJ3vz1zoI7XfxlBnCwZEyL+NJm4pko= -github.com/bufbuild/connect-go v1.8.0 h1:srluNkFkZBfSfg9Qb6DrO+5nMaxix//h2ctrHZhMGKc= -github.com/bufbuild/connect-go v1.8.0/go.mod h1:GmMJYR6orFqD0Y6ZgX8pwQ8j9baizDrIQMm1/a6LnHk= -github.com/bufbuild/connect-opentelemetry-go v0.3.0 h1:AuZi3asTDKmjGtd2aqpyP4p5QvBFG/YEaHopViLatnk= -github.com/bufbuild/connect-opentelemetry-go v0.3.0/go.mod h1:r1ppyTtu1EWeRodk4Q/JbyQhIWtO7eR3GoRDzjeEcNU= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= -github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= +github.com/bufbuild/buf v1.26.1 h1:+GdU4z2paCmDclnjLv7MqnVi3AGviImlIKhG0MHH9FA= +github.com/bufbuild/buf v1.26.1/go.mod h1:UMPncXMWgrmIM+0QpwTEwjNr2SA0z2YIVZZsmNflvB4= +github.com/bufbuild/connect-go v1.9.0 h1:JIgAeNuFpo+SUPfU19Yt5TcWlznsN5Bv10/gI/6Pjoc= +github.com/bufbuild/connect-go v1.9.0/go.mod h1:CAIePUgkDR5pAFaylSMtNK45ANQjp9JvpluG20rhpV8= +github.com/bufbuild/connect-opentelemetry-go v0.4.0 h1:6JAn10SNqlQ/URhvRNGrIlczKw1wEXknBUUtmWqOiak= +github.com/bufbuild/connect-opentelemetry-go v0.4.0/go.mod h1:nwPXYoDOoc2DGyKE/6pT1Q9MPSi2Et2e6BieMD0l6WU= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 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/chigopher/pathlib v0.15.0 h1:1pg96WL3iC1/YyWV4UJSl3E0GBf4B+h5amBtsbAAieY= github.com/chigopher/pathlib v0.15.0/go.mod h1:3+YPPV21mU9vyw8Mjp+F33CyCfE6iOzinpiqBcccv7I= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -121,9 +138,16 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/cilium/ebpf v0.7.0 h1:1k/q3ATgxSXRdrmPfH8d7YK0GfqVsEKZAX9dQZvs56k= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= @@ -131,20 +155,19 @@ github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNA github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosiner/argv v0.1.0 h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg= github.com/cosiner/argv v0.1.0/go.mod h1:EusR6TucWKX+zFgtdUsKT2Cvg45K5rtpCcWz4hK06d8= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= -github.com/daixiang0/gci v0.10.1 h1:eheNA3ljF6SxnPD/vE4lCBusVHmV3Rs3dkKvFrJ7MR0= -github.com/daixiang0/gci v0.10.1/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/daixiang0/gci v0.11.0 h1:XeQbFKkCRxvVyn06EOuNY6LPGBLVuB/W130c8FrnX6A= +github.com/daixiang0/gci v0.11.0/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= 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= @@ -154,51 +177,75 @@ github.com/derekparker/trie v0.0.0-20221213183930-4c74548207f4 h1:atN94qKNhLpy+9 github.com/derekparker/trie v0.0.0-20221213183930-4c74548207f4/go.mod h1:C7Es+DLenIpPc9J6IYw4jrK0h7S9bKj4DNl8+KxGEXU= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/docker/cli v24.0.2+incompatible h1:QdqR7znue1mtkXIJ+ruQMGQhpw2JzMJLRXp6zpzF6tM= -github.com/docker/cli v24.0.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v24.0.4+incompatible h1:Y3bYF9ekNTm2VFz5U/0BlMdJy73D+Y1iAAZ8l63Ydzw= +github.com/docker/cli v24.0.4+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.2+incompatible h1:eATx+oLz9WdNVkQrr0qjQ8HvRJ4bOOxfzEo8R+dA3cg= -github.com/docker/docker v24.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= -github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= +github.com/docker/docker v24.0.4+incompatible h1:s/LVDftw9hjblvqIeTiGYXBCD95nOEEl7qRsRrIOuQI= +github.com/docker/docker v24.0.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8= +github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 h1:RIB4cRk+lBqKK3Oy0r2gRX4ui7tuhiZq2SuTtTCi0/0= +github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= 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= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.1 h1:kt9FtLiooDc0vbwTLhdg3dyNX1K9Qwa1EK9LcD4jVUQ= -github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= -github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= +github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= +github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= +github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-delve/delve v1.21.0 h1:npcc8TZhdVxaMSJon+zqcE3bXM/ck8SSOOWw/id13jI= github.com/go-delve/delve v1.21.0/go.mod h1:U+OAdfhewudkHsVs/AwhfpSBu7t/NgIXH3+my4T5q78= github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d h1:pxjSLshkZJGLVm0wv20f/H0oTWiq/egkoJQ2ja6LEvo= github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d/go.mod h1:biJCRbqp51wS+I92HMqn5H8/A0PAhxn2vyOT+JqhiGI= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= +github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= +github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= +github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f h1:Pz0DHeFij3XFhoBRGUDPzSJ+w2UcK5/0JvF8DRI58r8= +github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo= +github.com/go-git/go-git/v5 v5.8.0 h1:Rc543s6Tyq+YcyPwZRvU4jzZGM8rB/wWu94TnTIYALQ= +github.com/go-git/go-git/v5 v5.8.0/go.mod h1:coJHKEOk5kUClpsNlXrUvPrDxY3w3gjHvhcZd8Fodw8= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -234,6 +281,7 @@ github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrK github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/validate v0.21.0 h1:+Wqk39yKOhfpLqNLEC0/eViCkzM5FVXVqrvt526+wcI= github.com/go-openapi/validate v0.21.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= +github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -243,20 +291,18 @@ github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP github.com/go-swagger/go-swagger v0.29.0 h1:z3YoZtLvS1Y8TE/PCat1VypcZxM0IgKLt0NvZxQyNl8= github.com/go-swagger/go-swagger v0.29.0/go.mod h1:Z4GJzI+bHKKkGB2Ji1rawpi3/ldXX8CkzGIa9HAC5EE= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013 h1:l9rI6sNaZgNC0LnF3MiE+qTmyBA/tZAg1rtyrGbUMK0= +github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.mod h1:b65mBPzqzZWxOZGxSWrqs4GInLIn+u99Q9q7p+GKni0= github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= github.com/go-toolsmith/astequal v1.0.1 h1:JbSszi42Jiqu36Gnf363HWS9MTEAz67vTQLponh3Moc= github.com/go-toolsmith/astequal v1.0.1/go.mod h1:4oGA3EZXTVItV/ipGiOx7NWkY5veFfcsOJVS2YxltLw= -github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU= github.com/go-toolsmith/astinfo v1.0.0 h1:rNuhpyhsnsze/Pe1l/GUHwxo1rmN7Dyb6oAnFcrXh+w= github.com/go-toolsmith/astinfo v1.0.0/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU= -github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc= github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5 h1:eD9POs68PHkwrx7hAB78z1cb6PfGq/jyWn3wJywsH1o= github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5/go.mod h1:3NAwwmD4uY/yggRxoEjk/S00MIV3A+H7rrE3i87eYxM= github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4= github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= github.com/go-toolsmith/typep v1.0.2 h1:8xdsa1+FSIH/RhEkgnD1j2CJOy5mNllW1Q9tRiYwvlk= github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= @@ -285,6 +331,7 @@ github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/V github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -294,11 +341,11 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= @@ -352,20 +399,19 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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.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.15.2 h1:MMkSh+tjSdnmJZO7ljvEqV1DjfekB6VUEAZgy3a+TQE= github.com/google/go-containerregistry v0.15.2/go.mod h1:wWK+LnOv4jXMM23IT/F1wdYftGWGr47Is8CG+pmHK1Q= github.com/google/go-dap v0.9.1 h1:d8dETjgHMR9/xs+Xza+NrZmB7jxIS5OtM2uRsyJVA/c= github.com/google/go-dap v0.9.1/go.mod h1:HAeyoSd2WIfTfg+0GRXcFrb+RnojAtGNh+k+XTIxJDE= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-github/v33 v33.0.0 h1:qAf9yP0qc54ufQxzwv+u9H0tiVOnPJxo0lI/JXqw3ZM= github.com/google/go-github/v33 v33.0.0/go.mod h1:GMdDnVZY/2TsWgp/lkYnpSAh6TrzhANBBwm6k6TTEXg= -github.com/google/go-github/v39 v39.2.0 h1:rNNM311XtPOz5rDdsJXAp2o8F67X9FnROXTvto3aSnQ= -github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= -github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= -github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= +github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI= +github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= +github.com/google/go-github/v55 v55.0.0 h1:4pp/1tNMB9X/LuAhs5i0KQAE40NmiR/y6prLNb9x9cg= +github.com/google/go-github/v55 v55.0.0/go.mod h1:JLahOTA1DnXzhxEymmFF5PP2tSS9JVNj68mSZNDwskA= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= @@ -385,32 +431,35 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= -github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 h1:hR7/MlvK23p6+lIw9SN1TigNLn9ZnF3W4SYRKq2gAHs= -github.com/google/pprof v0.0.0-20230602150820-91b7bce49751/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= +github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 h1:n6vlPhxsA+BW/XsS5+uqi7GyzaLa5MH7qlSLBZtRdiA= +github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/safehtml v0.0.2/go.mod h1:L4KWwDsUJdECRAEpZoBn3O64bQaywRscowZjJAzjHnU= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= +github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.7.1 h1:gF4c0zjUP2H/s/hEGyLA3I0fA2ZWjzYiONAD6cvPr8A= -github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= 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/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -419,11 +468,12 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= -github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= +github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= @@ -446,8 +496,9 @@ github.com/haya14busa/go-checkstyle v0.0.0-20170303121022-5e9d09f51fa1/go.mod h1 github.com/haya14busa/go-sarif v0.0.0-20210102043135-e2c5fed2fa3d/go.mod h1:1Hkn3JseGMB/hv1ywzkapVQDWV3bFgp6POZobZmR/5g= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= +github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= @@ -456,8 +507,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -465,15 +516,16 @@ github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 h1:vr3AYkKovP8uR8AvSGGU github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 h1:2uT3aivO7NVpUPGcQX7RbHijHMyWix/yCnIrCWc+5co= github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= -github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= -github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -485,15 +537,19 @@ github.com/jstemmer/go-junit-report v1.0.0 h1:8X1gzZpR+nVQLAht+L/foqOeX2l9DTZoaI github.com/jstemmer/go-junit-report v1.0.0/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +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/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= -github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -506,11 +562,11 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -526,6 +582,8 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -541,13 +599,15 @@ github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= -github.com/mattn/go-sqlite3 v1.14.5 h1:1IdxlwTNazvbKJQSxoJ5/9ECbEeaTTyeU7sEAZ5KKTQ= github.com/mattn/go-sqlite3 v1.14.5/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= +github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= +github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -561,8 +621,8 @@ github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -576,8 +636,8 @@ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc3 h1:fzg1mXZFj8YdPeNkRXMg+zb88BFV0Ys52cJydRwBkb8= -github.com/opencontainers/image-spec v1.1.0-rc3/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYBTS5Y4x/Cgeo1E0= +github.com/opencontainers/image-spec v1.1.0-rc4/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -585,6 +645,11 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -608,19 +673,20 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/quasilyte/go-consistent v0.0.0-20200404105227-766526bf1e96 h1:6VBkISnfYpPtRvpE9wsVoxX+i0cDQFBPQPYzw259xWY= -github.com/quasilyte/go-consistent v0.0.0-20200404105227-766526bf1e96/go.mod h1:h5ob45vcE3sydtmo0lUDUmG3Y0HXudxMId1w+5G99VI= +github.com/quasilyte/go-consistent v0.6.0 h1:tY8DYfgM+7ADpOyr5X47i8hV/XbMNoucqnqZWVjI+rU= +github.com/quasilyte/go-consistent v0.6.0/go.mod h1:dKYK1JZl3150J1+Jh4cDYPCIu2MqybUBi0YVW2b2E6c= github.com/reva2/bitbucket-insights-api v1.0.0 h1:lpQ/Q7OmnG04w/EM77piOwZBxP41PeTlbytXxVrnplA= github.com/reva2/bitbucket-insights-api v1.0.0/go.mod h1:pLs+ki3MKUntrPryxaGIvpRLiEtBhwfJ/uvxQIMfqHU= -github.com/reviewdog/errorformat v0.0.0-20220309155058-b075c45b6d9a h1:HIL+jTKsWmNT5WoTNwHQ0jUNJpFOmgeHLOsHMZInrF8= -github.com/reviewdog/errorformat v0.0.0-20220309155058-b075c45b6d9a/go.mod h1:AqhrP0G7F9YRROF10JQwdd4cNO8bdm6bY6KzcOc3Cp8= +github.com/reviewdog/errorformat v0.0.0-20230810075619-82e5d4ad20d2 h1:oP5DZdUlH2M1Luf2NdNhJ6TM/NiPn6wZy1QI5ybYsro= +github.com/reviewdog/errorformat v0.0.0-20230810075619-82e5d4ad20d2/go.mod h1:AqhrP0G7F9YRROF10JQwdd4cNO8bdm6bY6KzcOc3Cp8= github.com/reviewdog/go-bitbucket v0.0.0-20201024094602-708c3f6a7de0 h1:XZ60Bp2UqwaJ6fDQExoFVrgs4nIzwBCy9ct6GCj9hH8= github.com/reviewdog/go-bitbucket v0.0.0-20201024094602-708c3f6a7de0/go.mod h1:5JbWAMFyq9hbISZawRyIe7QTcLaptvCIvmZnYo+1VvA= -github.com/reviewdog/reviewdog v0.14.1 h1:+B2340ddsSC+tbSSTxb5oC24YPMLzQAlt4kVAmNS/3o= -github.com/reviewdog/reviewdog v0.14.1/go.mod h1:408Nr2GPWc7Qozz0X1RZ/3b7EVQIPJ6XF6BssRJ8ZKY= +github.com/reviewdog/reviewdog v0.15.0 h1:uj61ifLBGGshd7HfezG8Vllpc4b7Y47zHLZFxfxZOi0= +github.com/reviewdog/reviewdog v0.15.0/go.mod h1:ea/9hMRfJKPzfaSBs46KNFdN+2MExaKBohJZwweS8AQ= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -635,20 +701,27 @@ github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6us github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= +github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -662,7 +735,6 @@ github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -689,12 +761,12 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/tetratelabs/wazero v1.2.1 h1:J4X2hrGzJvt+wqltuvcSjHQ7ujQxA9gb6PeMs4qlUWs= -github.com/tetratelabs/wazero v1.2.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= +github.com/tetratelabs/wazero v1.3.1 h1:rnb9FgOEQRLLR8tgoD1mfjNjMhFeWRUk+a4b4j/GpUM= +github.com/tetratelabs/wazero v1.3.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -705,12 +777,14 @@ github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RV github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY= github.com/vburenin/ifacemaker v1.2.1 h1:3Vq8B/bfBgjWTkv+jDg4dVL1KHt3k1K4lO7XRxYA2sk= github.com/vburenin/ifacemaker v1.2.1/go.mod h1:5WqrzX2aD7/hi+okBjcaEQJMg4lDGrpuEX3B8L4Wgrs= -github.com/vektra/mockery/v2 v2.30.16 h1:XbUaK84eY7Hl/y6JeT7hVaA59Jgo4owlNWWgfL/gCQU= -github.com/vektra/mockery/v2 v2.30.16/go.mod h1:9lREs4VEeQiUS3rizYQx1saxHu2JiIhThP0q9+fDegM= -github.com/vvakame/sdlog v0.0.0-20200409072131-7c0d359efddc h1:El7LEavRpa49dYFE9ezO8aQxQn5E7u7eQkFsaXsoQAY= -github.com/vvakame/sdlog v0.0.0-20200409072131-7c0d359efddc/go.mod h1:MmhrKtbECoUJTctfak+MnOFoJ9XQqYZ7chcwV9O7v3I= -github.com/xanzy/go-gitlab v0.63.0 h1:a9fXpKWykUS6dowapFej/2Wjf4aOAEFC1q2ZIcz4IpI= -github.com/xanzy/go-gitlab v0.63.0/go.mod h1:F0QEXwmqiBUxCgJm8fE9S+1veX4XC9Z4cfaAbqwk4YM= +github.com/vektra/mockery/v2 v2.33.0 h1:C3W/EoEiBCdb8olVat+hcnqI8rebH4xmZzTP7FPoLSs= +github.com/vektra/mockery/v2 v2.33.0/go.mod h1:9lREs4VEeQiUS3rizYQx1saxHu2JiIhThP0q9+fDegM= +github.com/vvakame/sdlog v1.2.0 h1:gwZRXZ0EmhJQJN/Do/+PTQigcmFiSqZ07aDjxqGOLT8= +github.com/vvakame/sdlog v1.2.0/go.mod h1:gFYv2g/iR3pJSxkJz0YnkNmhNbXT5R3PzWsfZKGQADY= +github.com/xanzy/go-gitlab v0.91.1 h1:gnV57IPGYywWer32oXKBcdmc8dVxeKl3AauV8Bu17rw= +github.com/xanzy/go-gitlab v0.91.1/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= 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= @@ -720,7 +794,6 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= @@ -742,25 +815,27 @@ go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxx go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= go.opentelemetry.io/otel/sdk/metric v0.39.0 h1:Kun8i1eYf48kHH83RucG93ffz0zGV1sh46FAScOTuDI= +go.opentelemetry.io/otel/sdk/metric v0.39.0/go.mod h1:piDIRgjcK7u0HCL5pCA4e74qpK/jk3NiUoAHATVAmiI= go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20220816155156-cfacd8902214 h1:MqijAN3S61c7KWasOk+zIqIjHQPN6WUra/X3+YAkQxQ= go.starlark.net v0.0.0-20220816155156-cfacd8902214/go.mod h1:VZcBMdr3cT3PnBoWunTabuSEXwVAH+ZJ5zxfs3AdASk= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4 h1:QlVATYS7JBoZMVaf+cNjb90WD/beKVHnIxFKT4QaHVI= golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= -golang.org/x/build v0.0.0-20200616162219-07bebbe343e9 h1:SgmspiKqqI4Du0T87bPBEezUSzVOKhKDgconpLrfyuc= -golang.org/x/build v0.0.0-20200616162219-07bebbe343e9/go.mod h1:ia5pRNoJUuxRhXkmwkySu4YBTbXHSKig2ie6daQXihg= +golang.org/x/build v0.0.0-20230905185615-7f65e2bc812a h1:0XvhCUgBoH8lCN4oOJ/fshXfKKlqPYIXUC2KAJgWZI0= +golang.org/x/build v0.0.0-20230905185615-7f65e2bc812a/go.mod h1:LblaorLo4w94wk4xZvKeLSaFLku6WbfOih5CoMhhvVc= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -770,28 +845,43 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -815,10 +905,10 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -856,13 +946,15 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220517181318-183a9ca12b87/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20170207211851-4464e7848382/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -873,12 +965,11 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= -golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= -golang.org/x/perf v0.0.0-20211012211434-03971e389cd3 h1:TxpziJvKtFH7T75kH/tX3QELShnXGyWX1iVgw8hU9EY= -golang.org/x/perf v0.0.0-20211012211434-03971e389cd3/go.mod h1:KRSrLY7jerMEa0Ih7gBheQ3FYDiSx6liMnniX1o3j2g= +golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= +golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/perf v0.0.0-20230717203022-1ba3a21238c9 h1:HPASJO/sBgVQqFwIsL7A5o5GfTRe30dOhyX94F+4as0= +golang.org/x/perf v0.0.0-20230717203022-1ba3a21238c9/go.mod h1:UBKtEnL8aqnd+0JHqZ+2qoMDwtuy6cYhhKNoHLBiTQc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -890,8 +981,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -935,7 +1026,9 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -946,23 +1039,29 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/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-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/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-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220906165534-d0df966e6959/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.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-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -972,17 +1071,23 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= -golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1001,6 +1106,7 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1020,9 +1126,7 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200406213809-066fd1390ee0/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -1039,17 +1143,23 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= -golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= 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-20220517211312-f3a8303e98df/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= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +gonum.org/v1/plot v0.10.0/go.mod h1:JWIHJ7U20drSQb/aDpTetJzfC1KlAPldJLpkSy88dvQ= google.golang.org/api v0.0.0-20170206182103-3d017632ea10/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1070,16 +1180,17 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.114.0 h1:1xQPji6cO2E2vLiI+C/XiFAnsn1WV3mjaEwGLhi3grE= -google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= +google.golang.org/api v0.128.0 h1:RjPESny5CnQRn9V6siglged+DZCgfu9l6mO9dkX9VOg= +google.golang.org/api v0.128.0/go.mod h1:Y611qgqaE92On/7g65MQgxYul3c0rEB894kniWLY750= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8-0.20221117013220-504804fb50de h1:MvEeYmzkzk0Rsw+ceqy28aIJN7Mum+4aYqBwCMqYNug= +google.golang.org/appengine v1.6.8-0.20221117013220-504804fb50de/go.mod h1:BbwiCY3WCmCUKOJTrX5NwgQzew1c32w3kxa6Sxvs0cQ= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1103,6 +1214,7 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -1116,12 +1228,12 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e h1:Ao9GzfUMPH3zjVfzXG5rlWlk+Q8MXWKwWpwVQE1MXfw= -google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto v0.0.0-20230821184602-ccc8af3d0e93 h1:zv6ieVm8jNcN33At1+APsRISkRgynuWUxUhv6G123jY= +google.golang.org/genproto v0.0.0-20230821184602-ccc8af3d0e93/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= +google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q= +google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v0.0.0-20170208002647-2a6bf6142e96/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1136,11 +1248,14 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= +google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1162,20 +1277,24 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/reform.v1 v1.5.1 h1:7vhDFW1n1xAPC6oDSvIvVvpRkaRpXlxgJ4QB4s3aDdo= gopkg.in/reform.v1 v1.5.1/go.mod h1:AIv0CbDRJ0ljQwptGeaIXfpDRo02uJwTq92aMFELEeU= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1185,11 +1304,10 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99/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= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= 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/tools/tools.go b/tools/tools.go index bbe45acd65..bac23abc14 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/.devcontainer/install-dev-tools.sh b/update/.devcontainer/install-dev-tools.sh index 861f1aeed9..366832539d 100755 --- a/update/.devcontainer/install-dev-tools.sh +++ b/update/.devcontainer/install-dev-tools.sh @@ -8,7 +8,7 @@ set -o errexit set -o xtrace # download (in the background) the same verison as used by PMM build process -curl -sS https://dl.google.com/go/go1.20.5.linux-amd64.tar.gz -o /tmp/golang.tar.gz & +curl -sS https://dl.google.com/go/go1.21.1.linux-amd64.tar.gz -o /tmp/golang.tar.gz & # to install man pages sed -i '/nodocs/d' /etc/yum.conf diff --git a/update/ansible/playbook/tasks/files/change-admin-password b/update/ansible/playbook/tasks/files/change-admin-password index 60f2484470..1a8b9f8819 100644 --- a/update/ansible/playbook/tasks/files/change-admin-password +++ b/update/ansible/playbook/tasks/files/change-admin-password @@ -2,4 +2,4 @@ # # Change password for default admin user in PMM -grafana-cli --config=/etc/grafana/grafana.ini --homepath /usr/share/grafana --configOverrides cfg:default.paths.data=/srv/grafana admin reset-admin-password $1 +grafana cli --config=/etc/grafana/grafana.ini --homepath /usr/share/grafana admin reset-admin-password $1 diff --git a/update/ansible/playbook/tasks/files/datasources.yml b/update/ansible/playbook/tasks/files/datasources.yml index 79ba5ebcd0..b11fa2d0c8 100644 --- a/update/ansible/playbook/tasks/files/datasources.yml +++ b/update/ansible/playbook/tasks/files/datasources.yml @@ -8,7 +8,7 @@ datasources: orgId: 1 type: prometheus access: proxy - url: http://127.0.0.1:8430/prometheus/ + url: http://127.0.0.1:8430/ isDefault: true jsonData: httpMethod: POST diff --git a/update/ansible/playbook/tasks/files/maintenance.html b/update/ansible/playbook/tasks/files/maintenance.html new file mode 100644 index 0000000000..8056396816 --- /dev/null +++ b/update/ansible/playbook/tasks/files/maintenance.html @@ -0,0 +1,14 @@ + + + + + + + + Maintenance Mode + + +

PMM is being upgraded

+

Please wait until the upgrade process is finished.

+ + \ No newline at end of file diff --git a/update/ansible/playbook/tasks/init.yml b/update/ansible/playbook/tasks/init.yml index 828b8055c6..5c27f29b2d 100644 --- a/update/ansible/playbook/tasks/init.yml +++ b/update/ansible/playbook/tasks/init.yml @@ -4,6 +4,6 @@ become: true gather_facts: true tasks: - - name: Run initializaion role + - name: Run initialization role include_role: name: initialization diff --git a/update/ansible/playbook/tasks/roles/clickhouse/tasks/main.yml b/update/ansible/playbook/tasks/roles/clickhouse/tasks/main.yml index 2fb89b954b..ab927c62b5 100644 --- a/update/ansible/playbook/tasks/roles/clickhouse/tasks/main.yml +++ b/update/ansible/playbook/tasks/roles/clickhouse/tasks/main.yml @@ -1,6 +1,8 @@ --- - name: Stop and remove clickhouse before update | EL7 - when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' + when: + - ansible_distribution == 'CentOS' + - ansible_distribution_major_version == '7' command: supervisorctl {{ item }} clickhouse changed_when: True loop: @@ -13,7 +15,10 @@ register: supervisord_socket - name: Stop and remove clickhouse before update | EL9 - when: supervisord_socket.stat.exists and (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9' + when: + - supervisord_socket.stat.exists + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' command: /usr/local/bin/supervisorctl {{ item }} clickhouse become: true loop: @@ -61,7 +66,7 @@ name: clickhouse file: clickhouse description: "Clickhouse repo" - baseurl: "https://repo.clickhouse.com/rpm/stable/x86_64/" + baseurl: "https://packages.clickhouse.com/rpm/stable/" enabled: no gpgcheck: 1 gpgkey: "https://repo.clickhouse.com/CLICKHOUSE-KEY.GPG" @@ -74,7 +79,7 @@ name: clickhouse file: clickhouse description: "Clickhouse repo" - baseurl: "https://repo.clickhouse.com/rpm/stable/x86_64/" + baseurl: "https://packages.clickhouse.com/rpm/stable/" enabled: no gpgcheck: 0 diff --git a/update/ansible/playbook/tasks/roles/dashboards_upgrade/tasks/main.yml b/update/ansible/playbook/tasks/roles/dashboards_upgrade/tasks/main.yml index 022621b028..7c5080cfa9 100644 --- a/update/ansible/playbook/tasks/roles/dashboards_upgrade/tasks/main.yml +++ b/update/ansible/playbook/tasks/roles/dashboards_upgrade/tasks/main.yml @@ -50,6 +50,14 @@ src: /usr/share/percona-dashboards/panels/ dest: /srv/grafana/plugins/ +- name: Set permissions for the plugin directory + file: + path: "/srv/grafana/plugins" + state: directory + owner: grafana + group: grafana + mode: "0775" + - name: Check that the SQLite grafana database exists stat: path: /srv/grafana/grafana.db diff --git a/update/ansible/playbook/tasks/roles/grafana/files/grafana.ini b/update/ansible/playbook/tasks/roles/grafana/files/grafana.ini index 73a6ed90e7..10318273f2 100644 --- a/update/ansible/playbook/tasks/roles/grafana/files/grafana.ini +++ b/update/ansible/playbook/tasks/roles/grafana/files/grafana.ini @@ -1,14 +1,42 @@ ##################### Grafana Configuration ##################### # Only changed settings. You can find default settings in /usr/share/grafana/conf/defaults.ini +#################################### Database #################################### +[database] +# You can configure the database connection by specifying type, host, name, user and password +# as separate properties or as on string using the url properties. + +# Either "mysql", "postgres" or "sqlite3", it's your choice +type = postgres +host = localhost +user = grafana +# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" +password = grafana + [paths] # Directory where grafana will automatically scan and look for plugins plugins = /srv/grafana/plugins +# Directory where grafana can store logs +logs = /srv/logs +# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used) +data = /srv/grafana + +#################################### Logging ########################## +[log] +# Either "console", "file", "syslog". Default is console and file +mode = console + +# For "console" mode only +[log.console] +# log line format, valid options are text, console and json +format = console #################################### Server #################################### [server] # enable gzip enable_gzip = true +# The full public facing url +root_url = https://%(domain)s/graph #################################### Snapshots ########################### [snapshots] diff --git a/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml b/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml index cce395aa28..e212ed109d 100644 --- a/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml +++ b/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml @@ -5,7 +5,7 @@ state: directory owner: grafana group: grafana - mode: '0775' + mode: "0775" loop: - /srv/grafana - /srv/grafana/plugins @@ -13,7 +13,7 @@ - name: Set Grafana folder for plugins on /srv partition for all users lineinfile: path: /etc/bashrc - line: 'export GF_PLUGIN_DIR=/srv/grafana/plugins' + line: "export GF_PLUGIN_DIR=/srv/grafana/plugins" - name: Copy new version of grafana.ini copy: @@ -21,7 +21,43 @@ dest: /etc/grafana/grafana.ini owner: grafana group: grafana - mode: '0444' + mode: "0444" + +- name: Check that the SQLite grafana database exists + stat: + path: /srv/grafana/grafana.db + register: sqlite_grafana + +- name: Temporary change database to SQLite + block: + - name: Remove database options (SQLite is default) + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: type + state: absent + + - name: Remove database host + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: host + state: absent + + - name: Remove database user + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: user + state: absent + + - name: Remove database password + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: password + state: absent + when: sqlite_grafana.stat.exists - name: Create provisioning directory file: @@ -46,5 +82,5 @@ - dashboards - name: Upgrade grafana database (Get the latest schema) - command: grafana-cli --homepath=/usr/share/grafana admin data-migration encrypt-datasource-passwords + command: grafana cli --homepath=/usr/share/grafana admin data-migration encrypt-datasource-passwords changed_when: True diff --git a/update/ansible/playbook/tasks/roles/initialization/tasks/main.yml b/update/ansible/playbook/tasks/roles/initialization/tasks/main.yml index 7957b96ee6..2476b13d68 100644 --- a/update/ansible/playbook/tasks/roles/initialization/tasks/main.yml +++ b/update/ansible/playbook/tasks/roles/initialization/tasks/main.yml @@ -1,21 +1,9 @@ --- # This role contains tasks executed during initialization of PMM Server - -# PMM-10858 - In certain environments, including AWS EC2, some of the -# EPEL repository mirrors do not respond within the time limit defined -# by pmm-update which is currently set to 30 seconds. This was causing -# supervisord to kill pmm-update-checker -- name: Update repository settings - when: - - ansible_distribution == "CentOS" - - ansible_distribution_major_version == "7" - command: yum-config-manager --setopt=epel.timeout=1 --save - changed_when: True - -- name: Clean yum metadata - command: yum clean metadata - become: true - changed_when: True +- name: Determine type of upgrade + set_fact: + ui_upgrade: False + when: ui_upgrade is undefined - name: Get current version slurp: @@ -46,6 +34,32 @@ debug: msg: "Current version: {{ pmm_current_version }} Image Version: {{ pmm_image_version }}" + +# We use current_version_file['failed'] because we don't want to run this on creating container +# and we use pmm_current_version is version(pmm_image_version, '>=') to run it only if upgrade is required +- name: Enable maintenance mode only for docker upgrade + copy: + src: maintenance.html + dest: /usr/share/pmm-server/maintenance/ + mode: 0644 + when: not ui_upgrade and current_version_file['failed'] == false and not pmm_current_version is version(pmm_image_version, '>=') + +# PMM-10858 - In certain environments, including AWS EC2, some of the +# EPEL repository mirrors do not respond within the time limit defined +# by pmm-update which is currently set to 30 seconds. This was causing +# supervisord to kill pmm-update-checker +- name: Update repository settings + when: + - ansible_distribution == "CentOS" + - ansible_distribution_major_version == "7" + command: yum-config-manager --setopt=epel.timeout=1 --save + changed_when: True + +- name: Clean yum metadata + command: yum clean metadata + become: true + changed_when: True + - name: Check if we need an update or not include_role: name: dashboards_upgrade @@ -65,3 +79,100 @@ include_role: name: postgres when: is_postgres_11.stat.exists + +- name: Create grafana database in postgres + postgresql_db: + name: grafana + state: present + +- name: Create grafana user in postgres + postgresql_user: + db: grafana + name: grafana + password: grafana + priv: 'ALL' + expires: infinity + state: present + when: not ansible_check_mode + +- name: Create working directory for Alertmanager + file: path=/srv/alertmanager/data state=directory owner=pmm group=pmm + +- name: Create working directory for VictoriaMetrics + file: path=/srv/victoriametrics/data state=directory owner=pmm group=pmm + +- name: Create empty configuration file for VictoriaMetrics + file: path=/etc/victoriametrics-promscrape.yml state=touch owner=pmm group=pmm + +- name: Run SQLite -> Postgres only for docker upgrade + block: + - name: Check that the SQLite grafana database exists + stat: + path: /srv/grafana/grafana.db + register: is_database_sqlite + + - name: Temporary change database to SQLite + block: + - name: Remove database options (SQLite is default) + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: type + state: absent + + - name: Remove database host + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: host + state: absent + + - name: Remove database user + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: user + state: absent + + - name: Remove database password + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: password + state: absent + + - name: Upgrade grafana database (Get the latest schema) + command: grafana cli --homepath=/usr/share/grafana admin data-migration encrypt-datasource-passwords + changed_when: True + + - name: Start grafana again + supervisorctl: + name: grafana + state: restarted + + - name: Wait for grafana + pause: seconds=10 + + - name: Migrate Grafana database from SQLite to Postgresql + include_role: + name: sqlite-to-postgres + tags: + - skip_ansible_lint # '503 Tasks that run when changed should likely be handlers'. + when: is_database_sqlite.stat.exists + + - name: Wait for PMM to be ready + ansible.builtin.uri: + url: "http://127.0.0.1:7772/v1/readyz" + status_code: 200 + method: GET + retries: 120 + delay: 1 + + - name: Disable maintenance mode + file: + state: absent + path: /usr/share/pmm-server/maintenance/maintenance.html + # We use current_version_file['failed'] because we don't want to run this on creating container + when: not ui_upgrade and current_version_file['failed'] == false and not pmm_current_version is version(pmm_image_version, '>=') + + diff --git a/update/ansible/playbook/tasks/roles/nginx/files/conf.d/pmm.conf b/update/ansible/playbook/tasks/roles/nginx/files/conf.d/pmm.conf index 4b136d2ce3..dfdbfe8f11 100644 --- a/update/ansible/playbook/tasks/roles/nginx/files/conf.d/pmm.conf +++ b/update/ansible/playbook/tasks/roles/nginx/files/conf.d/pmm.conf @@ -43,6 +43,29 @@ ssl_trusted_certificate /srv/nginx/ca-certs.pem; ssl_dhparam /srv/nginx/dhparam.pem; + # this block checks for maintenance.html file and, if it exists, it redirects all requests to the maintenance page + # there are two exceptions for it /v1/Updates/Status and /auth_request endpoints + set $maintenance_mode 0; + + if (-f /usr/share/pmm-server/maintenance/maintenance.html) { + set $maintenance_mode 1; + } + + if ($request_uri ~* "^/v1/Updates/Status|^/auth_request") { + set $maintenance_mode 0; + } + + if ($maintenance_mode = 1) { + return 503; + } + + error_page 503 @maintenance; + + location @maintenance { + root /usr/share/pmm-server/maintenance; + rewrite ^(.*)$ /maintenance.html break; + } + # Enable passing of the remote user's IP address to all # proxied services using the X-Forwarded-For header diff --git a/update/ansible/playbook/tasks/roles/sqlite-to-postgres/tasks/main.yml b/update/ansible/playbook/tasks/roles/sqlite-to-postgres/tasks/main.yml new file mode 100644 index 0000000000..490ce26c7f --- /dev/null +++ b/update/ansible/playbook/tasks/roles/sqlite-to-postgres/tasks/main.yml @@ -0,0 +1,132 @@ +--- +- name: Wait for grafana to update DB and be ready + ansible.builtin.uri: + url: "http://127.0.0.1:3000/api/health" + status_code: 200 + method: GET + register: healthcheck + until: healthcheck is not failed + retries: 120 + delay: 1 + +- name: Create Grafana backup dir + file: + path: "/srv/backup/grafana" + state: directory + owner: grafana + group: grafana + mode: '0700' + +- name: Stop grafana before upgrade + supervisorctl: + name: 'grafana' + state: stopped + +- name: Create backup for SQLite Grafana database + copy: + src: /srv/grafana/grafana.db + dest: "/srv/backup/grafana/grafana.db" + owner: grafana + group: grafana + mode: '0700' + +- name: Remove all ` symbols in grafana dashboard description + command: sqlite3 /srv/grafana/grafana.db -cmd ".timeout 60000" "UPDATE dashboard SET data = REPLACE(data, '`', '');" + changed_when: True + +- name: Disable provisioning before change database + ini_file: + dest: /etc/grafana/grafana.ini + section: paths + option: provisioning + value: conf/provisioning_disable + +- name: Switch to postgres + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: type + value: postgres + +- name: Set database host + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: host + value: localhost + +- name: Set database user + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: user + value: grafana + +- name: Set database password + ini_file: + dest: /etc/grafana/grafana.ini + section: database + option: password + value: grafana + +- name: Start grafana again + supervisorctl: + name: grafana + state: restarted + ignore_errors: yes + +- name: Check if initial data were created + postgresql_query: + db: grafana + query: SELECT 1 FROM org WHERE id=1 + retries: 3 + delay: 3 + register: psql_result + until: psql_result.rowcount == 1 + when: not ansible_check_mode + +- name: Wait for grafana database initialization + pause: + seconds: 10 + +- name: Stop grafana before upgrade + supervisorctl: + name: grafana + state: stopped + +- name: Remove default admin user + postgresql_query: + db: grafana + query: DELETE FROM public.user WHERE login='admin' + when: not ansible_check_mode + +- name: Run grafana migrator + command: grafana-db-migrator --change-char-to-text /srv/grafana/grafana.db "postgres://grafana:grafana@localhost:5432/grafana?sslmode=disable" + register: migrator_output + changed_when: "'All done' in migrator_output.stdout" + +- name: Enable provisioning after change database + ini_file: + dest: /etc/grafana/grafana.ini + section: paths + option: provisioning + value: conf/provisioning + +- name: Start grafana again + supervisorctl: + name: grafana + state: restarted + +- name: Wait for grafana initialization + pause: + seconds: 5 + +- name: Fix database/folder relationship + command: grafana-db-migrator --fix-folders-id /srv/grafana/grafana.db "postgres://grafana:grafana@localhost:5432/grafana?sslmode=disable" + register: migrator_output + changed_when: "'All done' in migrator_output.stdout" + +- name: Remove SQLite Grafana database + file: + path: /srv/grafana/grafana.db + state: absent diff --git a/update/ansible/playbook/tasks/update.yml b/update/ansible/playbook/tasks/update.yml index 48432dd482..61ae3a43a2 100644 --- a/update/ansible/playbook/tasks/update.yml +++ b/update/ansible/playbook/tasks/update.yml @@ -20,6 +20,7 @@ - pmm2-client - pmm-dump - vmproxy + - grafana-db-migrator pre_tasks: - name: detect /srv/pmm-distribution stat: @@ -38,12 +39,24 @@ is_docker: True when: is_docker is undefined tasks: - # we need install this package here because it contain VERSION file + - name: Enable maintenance mode + copy: + src: maintenance.html + dest: /usr/share/pmm-server/maintenance/ + mode: 0644 + - name: Remove percona-dashboard without architecture yum: name: percona-dashboards.*noarch state: absent + # see https://jira.percona.com/browse/PMM-8492 for details about a issue + - name: Delete experimental repo file in 2.16 version + file: + path: "/etc/yum.repos.d/percona-original-experimental.repo" + state: absent + register: experimental_repo_existed + - name: Update percona-dashboards package yum: name: @@ -51,6 +64,34 @@ - percona-grafana state: latest + - name: Cleanup yum metadata + command: yum clean metadata + register: yum_clean_result + changed_when: "'Cleaning repos' in yum_clean_result.stdout" + when: experimental_repo_existed.changed + tags: + - skip_ansible_lint # '503 Tasks that run when changed should likely be handlers'. + # The handler looks bad in this case + + # TODO: join with the command above + - name: Cleanup yum metadata + command: yum clean metadata + become: true + tags: + - skip_ansible_lint + + # Split download and update to produce a bit more of progress output. + - name: Download pmm2 packages + yum: + name: "{{ pmm_packages }}" + state: latest + download_only: yes + + - name: Update pmm2 packages + yum: + name: "{{ pmm_packages }}" + state: latest + - name: Create supervisord dir file: path: /etc/supervisord.d/ @@ -61,27 +102,12 @@ src: pmm.ini dest: /etc/supervisord.d/pmm.ini + # restart pmm-managed-init and pmm-managed first as they may update supervisord configuration on start - name: Generate new supervisor config command: pmm-managed-init register: managed_init_result changed_when: True - - name: Update postgresql version_1 - command: sed -i 's:-D /srv/postgres$:-D /srv/postgres14:' /etc/supervisord.d/pmm.ini - changed_when: true - - - name: Update postgresql version_2 - command: sed -i 's:/usr/pgsql/bin/postgres:/usr/pgsql-14/bin/postgres:' /etc/supervisord.d/pmm.ini - changed_when: true - - - name: Update postgresql version_3 - command: sed -i 's:/srv/logs/postgresql.log:/srv/logs/postgresql14.log:' /etc/supervisord.d/pmm.ini - changed_when: true - - - name: Update postgresql version_4 - command: sed -i 's:/usr/pgsql-11/bin/postgres:/usr/pgsql-14/bin/postgres:' /etc/supervisord.d/pmm.ini - changed_when: true - - name: Disable pmm-update-perform-init ini_file: path: /etc/supervisord.d/pmm.ini @@ -149,9 +175,16 @@ when: is_docker and not is_supervisor_running.stat.exists and (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9' shell: /usr/local/bin/supervisord -c /etc/supervisord.conf & + - name: Wait until postgres port is present before continuing + wait_for: + host: localhost + port: 5432 + - name: Run initialization playbook include_role: name: initialization + vars: + ui_upgrade: True - name: Enable crond service when: not is_docker @@ -187,48 +220,6 @@ - name: Check reread results debug: var=reread_result.stdout_lines - # see https://jira.percona.com/browse/PMM-8492 for details about a issue - - name: Delete experimental repo file in 2.16 version - file: - path: "/etc/yum.repos.d/percona-original-experimental.repo" - state: absent - register: experimental_repo_existed - - - name: Cleanup yum metadata - command: yum clean metadata - register: yum_clean_result - changed_when: "'Cleaning repos' in yum_clean_result.stdout" - when: experimental_repo_existed.changed - tags: - - skip_ansible_lint # '503 Tasks that run when changed should likely be handlers'. - # The handler looks bad in this case - - # TODO: join with the command above - - name: Cleanup yum metadata - command: yum clean metadata - become: true - tags: - - skip_ansible_lint - - # Split download and update to produce a bit more of progress output. - - name: Download pmm2 packages - yum: - name: "{{ pmm_packages }}" - state: latest - download_only: yes - - - name: Update pmm2 packages - yum: - name: "{{ pmm_packages }}" - state: latest - - - # restart pmm-managed-init and pmm-managed first as they may update supervisord configuration on start - - name: Generate new supervisor config - command: pmm-managed-init - register: managed_init_result - changed_when: True - - name: Restart pmm-managed EL7 when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' command: supervisorctl {{ item }} pmm-managed @@ -246,9 +237,12 @@ # give pmm-managed time to update supervisord configuration, # and give update UI time to catch up after pmm-managed restart - name: Wait for pmm-managed - pause: seconds=5 + pause: seconds=10 - - name: Update system packages + - name: Update system packages EL7 + when: + - ansible_distribution == "CentOS" + - ansible_distribution_major_version == "7" yum: name: "*" state: latest @@ -256,7 +250,10 @@ exclude: - nginx* - - name: Updating only select packages + - name: Updating only select packages EL7 + when: + - ansible_distribution == "CentOS" + - ansible_distribution_major_version == "7" yum: name: "{{ item }}" state: latest @@ -267,6 +264,38 @@ - sshpass - vi + - name: Remove ansible RPM if installed | EL9 + when: + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' + yum: + name: ansible + state: absent + ignore_errors: yes + + - name: Install ansible-core RPM | EL9 + when: + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' + yum: + name: + - ansible-core + - ansible-collection-community-general + - ansible-collection-community-postgresql + - ansible-collection-ansible-posix + state: present + + - name: Update system packages EL9 + when: + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' + - not ansible_check_mode + yum: + name: "*" + state: latest + exclude: + - nginx* + - name: Install nginx include_role: name: nginx @@ -284,17 +313,6 @@ enabled: no when: not is_docker - - name: Remove old or redundant packages - yum: - state: absent - name: - - percona-qan-app # https://jira.percona.com/browse/PMM-6766 - - mariadb-libs # https://jira.percona.com/browse/PMM-5215 - - logrotate # https://jira.percona.com/browse/PMM-7627 - - pmm-server # https://jira.percona.com/browse/PMM-11239 - - screen - - yum-cron - # https://jira.percona.com/browse/PMM-9298 - name: Copy rezise-xfs file for lvm copy: @@ -317,19 +335,6 @@ regexp: "set -o errexit" replace: "" - # TODO: Create /srv/alertmanager/data and /srv/victoriametrics/data in pmm-managed - # to support Docker-way (swap image) updates. - # https://jira.percona.com/browse/PMM-7024 - - - name: Create working directory for Alertmanager - file: path=/srv/alertmanager/data state=directory owner=pmm group=pmm - - - name: Create working directory for VictoriaMetrics - file: path=/srv/victoriametrics/data state=directory owner=pmm group=pmm - - - name: Create empty configuration file for VictoriaMetrics - file: path=/etc/victoriametrics-promscrape.yml state=touch owner=pmm group=pmm - - name: Reread supervisord configuration again EL7 when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' command: supervisorctl reread @@ -381,12 +386,46 @@ - /etc/yum/yum-cron-hourly.conf - /etc/yum/yum-cron.conf - - name: Enable pmm-update-perform-init after build - ini_file: - path: /etc/supervisord.d/pmm.ini - section: program:pmm-update-perform-init - option: autostart - value: "true" + - name: Check that the SQLite grafana database exists + stat: + path: /srv/grafana/grafana.db + register: is_database_sqlite + + - name: Migrate Grafana database from SQLite to Postgresql + include_role: + name: sqlite-to-postgres + when: is_database_sqlite.stat.exists + tags: + - skip_ansible_lint # '503 Tasks that run when changed should likely be handlers'. + + - name: Fix grafana fields type + postgresql_query: + db: grafana + query: "{{ item }}" + loop: + - ALTER TABLE tag ALTER COLUMN key TYPE text; + - ALTER TABLE tag ALTER COLUMN value TYPE text; + - ALTER TABLE api_key ALTER COLUMN key TYPE text; + - ALTER TABLE api_key ALTER COLUMN name TYPE text; + when: not ansible_check_mode + + # we need to put this step as one of the last steps, because it removes pmm.ini and /etc/alertmanager.yml + - name: Remove old or redundant packages + yum: + state: absent + name: + - percona-qan-app # https://jira.percona.com/browse/PMM-6766 + - mariadb-libs # https://jira.percona.com/browse/PMM-5215 + - logrotate # https://jira.percona.com/browse/PMM-7627 + - pmm-server # https://jira.percona.com/browse/PMM-11239 + - screen + - yum-cron + + # Regenerating pmm.ini and enabling pmm-update-perform-init + - name: Generate new supervisor config + command: pmm-managed-init + register: managed_init_result + changed_when: True - name: Reread pmm-update-perform-init supervisor config EL7 when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' @@ -400,6 +439,21 @@ register: reread_init__result changed_when: "'No config updates to processes' not in reread_init__result.stdout" + # restarting pmm-managed to regenerate /etc/alertmanager.yml + - name: Restart pmm-managed EL7 + when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' + command: supervisorctl {{ item }} pmm-managed + become: true + changed_when: true + with_items: ["stop", "remove", "add"] + + - name: Restart pmm-managed EL9 + when: (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9' + command: /usr/local/bin/supervisorctl {{ item }} pmm-managed + become: true + changed_when: true + with_items: ["stop", "remove", "add"] + - name: Update/restart other services EL7 when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' command: supervisorctl update @@ -415,6 +469,16 @@ - name: Print other services's logs debug: var=update_result.stdout_lines + - name: Wait for PMM to be ready + ansible.builtin.uri: + url: "http://127.0.0.1:7772/v1/readyz" + status_code: 200 + method: GET + register: healthcheck + until: healthcheck is not failed + retries: 120 + delay: 1 + # SIGUSR2 is sent to supervisord by pmm-managed right before the update for logging to work correctly. # We use that fact to show what was restarted during the update. - name: Get supervisord logs EL7 @@ -432,7 +496,14 @@ - name: Print supervisord logs debug: var=maintail_result.stdout_lines + - name: Disable maintenance mode + file: + state: absent + path: /usr/share/pmm-server/maintenance/maintenance.html + - name: Cleanup yum cache file: state: absent path: /var/cache/yum + + diff --git a/update/docker-compose.yml b/update/docker-compose.yml index 5be6dd1cbf..2bf87f6d11 100644 --- a/update/docker-compose.yml +++ b/update/docker-compose.yml @@ -6,7 +6,7 @@ services: environment: # for tests - PMM_SERVER_IMAGE=${PMM_SERVER_IMAGE:-percona/pmm-server:2} - - GO_VERSION=${GO_VERSION:-1.20.x} + - GO_VERSION=${GO_VERSION:-1.21.x} - PATH=/root/go/bin:$PATH - REVIEWDOG_GITHUB_API_TOKEN=${REVIEWDOG_GITHUB_API_TOKEN} volumes: diff --git a/update/main.go b/update/main.go index 01c71fa3ad..e1f87f921c 100644 --- a/update/main.go +++ b/update/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/main_test.go b/update/main_test.go index 5731973001..98a41a6c14 100644 --- a/update/main_test.go +++ b/update/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/maincover_test.go b/update/maincover_test.go index 921c29afbf..aa26b16d85 100644 --- a/update/maincover_test.go +++ b/update/maincover_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/pkg/ansible/ansible.go b/update/pkg/ansible/ansible.go index 00889e47bb..08c1d05547 100644 --- a/update/pkg/ansible/ansible.go +++ b/update/pkg/ansible/ansible.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/pkg/ansible/ansible_test.go b/update/pkg/ansible/ansible_test.go index a98f8d41c4..6f4e34eb20 100644 --- a/update/pkg/ansible/ansible_test.go +++ b/update/pkg/ansible/ansible_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/pkg/run/run.go b/update/pkg/run/run.go index b370d24963..399a903273 100644 --- a/update/pkg/run/run.go +++ b/update/pkg/run/run.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/pkg/run/run_test.go b/update/pkg/run/run_test.go index 1f73d825a8..8557880ab8 100644 --- a/update/pkg/run/run_test.go +++ b/update/pkg/run/run_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/pkg/yum/info.go b/update/pkg/yum/info.go index f705d2922e..95728e928d 100644 --- a/update/pkg/yum/info.go +++ b/update/pkg/yum/info.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/pkg/yum/info_test.go b/update/pkg/yum/info_test.go index d8cc827c80..1604e92d1d 100644 --- a/update/pkg/yum/info_test.go +++ b/update/pkg/yum/info_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/pkg/yum/yum.go b/update/pkg/yum/yum.go index f9b906f86d..008ad208b1 100644 --- a/update/pkg/yum/yum.go +++ b/update/pkg/yum/yum.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/update/pkg/yum/yum_test.go b/update/pkg/yum/yum_test.go index 5b3e70131a..d2ad230000 100644 --- a/update/pkg/yum/yum_test.go +++ b/update/pkg/yum/yum_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/utils/depstests/depstests.go b/utils/depstests/depstests.go index 67fa07dda4..f7b17754f1 100644 --- a/utils/depstests/depstests.go +++ b/utils/depstests/depstests.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/utils/depstests/protobuf_test.go b/utils/depstests/protobuf_test.go index 788c5ecbcc..941aa6f7f8 100644 --- a/utils/depstests/protobuf_test.go +++ b/utils/depstests/protobuf_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/utils/errors/errors.go b/utils/errors/errors.go index 1924f38d88..1499d84778 100644 --- a/utils/errors/errors.go +++ b/utils/errors/errors.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -15,7 +15,7 @@ // Package errors contains a custom HTTP error handler that adds an extra `Error` field to error payloads. // This helps us maintain compatibility with older PMM clients while keeping the benefits of grpc-gateway v2. -// Our requirement is fairly minimal, but copy a lot of code from grpc-gateway to account for unexported fields and methods +// Our requirement is fairly minimal, but copy a lot of code from grpc-gateway to account for unexported fields and methods. package errors import ( @@ -37,7 +37,7 @@ import ( // PMMHTTPErrorHandler is a custom implementation of DefaultHTTPErrorHandler // (https://github.com/grpc-ecosystem/grpc-gateway/blob/aec6aa29864109e41408491319a859f190ec4040/runtime/errors.go#L93) -// It injects an extra `Error` field in error responses to support old PMM clients +// It injects an extra `Error` field in error responses to support old PMM clients. func PMMHTTPErrorHandler(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error) { // return Internal when Marshal failed const fallback = `{"code": 13, "message": "failed to marshal error message"}` diff --git a/managed/utils/logger/global.go b/utils/logger/global.go similarity index 88% rename from managed/utils/logger/global.go rename to utils/logger/global.go index 2d9a50c7c2..9368bb145c 100644 --- a/managed/utils/logger/global.go +++ b/utils/logger/global.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -24,11 +24,9 @@ import ( ) // SetupGlobalLogger configures logrus.StandardLogger() to enable multiline-friendly formatter -// in both development (with terminal) and production (without terminal). +// in both development (with terminal) and production (without terminal) with default prettyfier. func SetupGlobalLogger() { logrus.SetFormatter(&logrus.TextFormatter{ - // https://github.com/sirupsen/logrus/blob/839c75faf7f98a33d445d181f3018b5c3409a45e/text_formatter.go#L176-L178 - ForceColors: true, FullTimestamp: true, TimestampFormat: "2006-01-02T15:04:05.000-07:00", diff --git a/managed/utils/logger/grpc.go b/utils/logger/grpc.go similarity index 96% rename from managed/utils/logger/grpc.go rename to utils/logger/grpc.go index 15c761c217..fcc4f2219e 100644 --- a/managed/utils/logger/grpc.go +++ b/utils/logger/grpc.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -38,7 +38,7 @@ func (v *GRPC) Info(args ...interface{}) { v.Trace(args...) } func (v *GRPC) Infoln(args ...interface{}) { v.Traceln(args...) } func (v *GRPC) Infof(format string, args ...interface{}) { v.Tracef(format, args...) } -// check interfaces +// check interfaces. var ( _ grpclog.LoggerV2 = (*GRPC)(nil) ) diff --git a/managed/utils/logger/logger.go b/utils/logger/logger.go similarity index 96% rename from managed/utils/logger/logger.go rename to utils/logger/logger.go index b47b60f28e..89a0211ad1 100644 --- a/managed/utils/logger/logger.go +++ b/utils/logger/logger.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -23,7 +23,7 @@ import ( "github.com/sirupsen/logrus" ) -// key is unexported to prevent collisions - it is different from any other type in other packages +// key is unexported to prevent collisions - it is different from any other type in other packages. type key struct{} // Get returns logrus entry for given context. Set must be called before this method is called. diff --git a/utils/nodeinfo/nodeinfo.go b/utils/nodeinfo/nodeinfo.go index 5e0ac2539d..f8f928bf89 100644 --- a/utils/nodeinfo/nodeinfo.go +++ b/utils/nodeinfo/nodeinfo.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -68,7 +68,7 @@ func readMachineID() string { return "" } -// TODO remove that completely once we have "zero port" feature +// TODO remove that completely once we have "zero port" feature. func readPublicAddress() string { var res string diff --git a/utils/nodeinfo/nodeinfo_test.go b/utils/nodeinfo/nodeinfo_test.go index 159b824116..ea97b4b761 100644 --- a/utils/nodeinfo/nodeinfo_test.go +++ b/utils/nodeinfo/nodeinfo_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/utils/pdeathsig/pdeathsig.go b/utils/pdeathsig/pdeathsig.go index 28d33fbbbf..cf31b6ee32 100644 --- a/utils/pdeathsig/pdeathsig.go +++ b/utils/pdeathsig/pdeathsig.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/utils/pdeathsig/pdeathsig_linux.go b/utils/pdeathsig/pdeathsig_linux.go index 1738028d05..87ecf654a1 100644 --- a/utils/pdeathsig/pdeathsig_linux.go +++ b/utils/pdeathsig/pdeathsig_linux.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/utils/sqlmetrics/reform.go b/utils/sqlmetrics/reform.go index 843ffced74..c7d8577140 100644 --- a/utils/sqlmetrics/reform.go +++ b/utils/sqlmetrics/reform.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/utils/sqlmetrics/sqlmetrics.go b/utils/sqlmetrics/sqlmetrics.go index 9404cb91c4..00a582ef4d 100644 --- a/utils/sqlmetrics/sqlmetrics.go +++ b/utils/sqlmetrics/sqlmetrics.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -137,7 +137,7 @@ func (c *Collector) Collect(ch chan<- prom.Metric) { float64(stats.MaxLifetimeClosed)) } -// check interfaces +// check interfaces. var ( _ prom.Collector = (*Collector)(nil) ) diff --git a/utils/sqlrows/sqlrows.go b/utils/sqlrows/sqlrows.go index 7255f427c0..35f72a55e0 100644 --- a/utils/sqlrows/sqlrows.go +++ b/utils/sqlrows/sqlrows.go @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -// Package sqlrows provides helper methods for *sql.Rows +// Package sqlrows provides helper methods for *sql.Rows. package sqlrows import "database/sql" diff --git a/utils/tlsconfig/tlsconfig.go b/utils/tlsconfig/tlsconfig.go index 29e101e3b1..e527cc6371 100644 --- a/utils/tlsconfig/tlsconfig.go +++ b/utils/tlsconfig/tlsconfig.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/version/parsed.go b/version/parsed.go index c312272d52..dce3d6887d 100644 --- a/version/parsed.go +++ b/version/parsed.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/version/parsed_test.go b/version/parsed_test.go index c049811b19..cba04bd74a 100644 --- a/version/parsed_test.go +++ b/version/parsed_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/version/release.go b/version/release.go index 1560e45a5d..e35ce12602 100644 --- a/version/release.go +++ b/version/release.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -71,7 +71,7 @@ func Time() (time.Time, error) { return time.Unix(sec, 0).UTC(), nil } -// timestampFormatted returns timestamp in format "YYYY-MM-DD HH:mm:ss (UTC)" +// timestampFormatted returns timestamp in format "YYYY-MM-DD HH:mm:ss (UTC)". func timestampFormatted() string { timestamp := Timestamp if t, err := Time(); err == nil { diff --git a/version/release_test.go b/version/release_test.go index 019668c407..46db728e84 100644 --- a/version/release_test.go +++ b/version/release_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/version/update.go b/version/update.go index 165b712cf3..5441043343 100644 --- a/version/update.go +++ b/version/update.go @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/vmproxy/Makefile b/vmproxy/Makefile index 458aea2543..de22f04d71 100644 --- a/vmproxy/Makefile +++ b/vmproxy/Makefile @@ -16,7 +16,7 @@ ifeq ($(GOBIN),) endif LD_FLAGS = -ldflags " \ - -X 'github.com/percona/pmm/version.ProjectName=pmm-admin' \ + -X 'github.com/percona/pmm/version.ProjectName=vmproxy' \ -X 'github.com/percona/pmm/version.Version=$(PMM_RELEASE_VERSION)' \ -X 'github.com/percona/pmm/version.PMMVersion=$(PMM_RELEASE_VERSION)' \ -X 'github.com/percona/pmm/version.Timestamp=$(PMM_RELEASE_TIMESTAMP)' \ diff --git a/vmproxy/main.go b/vmproxy/main.go index a955dbf4a4..f52ed527f4 100644 --- a/vmproxy/main.go +++ b/vmproxy/main.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/vmproxy/main_test.go b/vmproxy/main_test.go index c4d72f4287..8b003d232b 100644 --- a/vmproxy/main_test.go +++ b/vmproxy/main_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/vmproxy/proxy/proxy.go b/vmproxy/proxy/proxy.go index 8fcb9e6683..dbc1aa0730 100644 --- a/vmproxy/proxy/proxy.go +++ b/vmproxy/proxy/proxy.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -// Package proxy provides http reverse proxy functionality +// Package proxy provides http reverse proxy functionality. package proxy import ( @@ -24,13 +24,14 @@ import ( "net/http" "net/http/httputil" "net/url" + "strings" "time" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) -// Config defines options for starting proxy +// Config defines options for starting proxy. type Config struct { // Name of the header to check for filters. Case insensitive. HeaderName string @@ -84,6 +85,12 @@ func director(target *url.URL, headerName string) func(*http.Request) { req.URL.Scheme = target.Scheme req.URL.Host = target.Host + rp, err := target.Parse(strings.TrimPrefix(req.URL.Path, "/")) + if err != nil { + logrus.Error(err) + } + req.URL.Path = rp.Path + // Replace extra filters if present if filters := req.Header.Get(headerName); filters != "" { q := req.URL.Query() diff --git a/vmproxy/proxy/proxy_test.go b/vmproxy/proxy/proxy_test.go index 6a5008ea8c..daa35dbd5b 100644 --- a/vmproxy/proxy/proxy_test.go +++ b/vmproxy/proxy/proxy_test.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Percona LLC +// Copyright (C) 2023 Percona LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by