From acfd641b41053e5e04643877264c8bba23e832a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 10:39:12 +0000 Subject: [PATCH 01/14] Bump @typescript-eslint/parser from 6.6.0 to 6.7.0 in /cli-tests (#2476) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.6.0 to 6.7.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiří Čtvrtka <62988319+JiriCtvrtka@users.noreply.github.com> --- cli-tests/package-lock.json | 90 +++++++++++++++++++++++++++++++++---- cli-tests/package.json | 2 +- 2 files changed, 83 insertions(+), 9 deletions(-) diff --git a/cli-tests/package-lock.json b/cli-tests/package-lock.json index 0be0a4df2c..f8e409f1e8 100644 --- a/cli-tests/package-lock.json +++ b/cli-tests/package-lock.json @@ -21,7 +21,7 @@ "@types/promise-retry": "^1.1.3", "@types/shelljs": "^0.8.12", "@typescript-eslint/eslint-plugin": "^6.6.0", - "@typescript-eslint/parser": "^6.6.0", + "@typescript-eslint/parser": "^6.7.0", "eslint": "8.48", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", @@ -296,15 +296,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.6.0.tgz", - "integrity": "sha512-setq5aJgUwtzGrhW177/i+DMLqBaJbdwGj2CPIVFFLE0NCliy5ujIdLHd2D1ysmlmsjdL2GWW+hR85neEfc12w==", + "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": "6.6.0", - "@typescript-eslint/types": "6.6.0", - "@typescript-eslint/typescript-estree": "6.6.0", - "@typescript-eslint/visitor-keys": "6.6.0", + "@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": { @@ -323,6 +323,80 @@ } } }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "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": "6.7.0", + "@typescript-eslint/visitor-keys": "6.7.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "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": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "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": "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.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "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": "6.7.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/scope-manager": { "version": "6.6.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.6.0.tgz", diff --git a/cli-tests/package.json b/cli-tests/package.json index a3742996ab..82cab31f55 100644 --- a/cli-tests/package.json +++ b/cli-tests/package.json @@ -25,7 +25,7 @@ "@types/promise-retry": "^1.1.3", "@types/shelljs": "^0.8.12", "@typescript-eslint/eslint-plugin": "^6.6.0", - "@typescript-eslint/parser": "^6.6.0", + "@typescript-eslint/parser": "^6.7.0", "eslint": "8.48", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", From 9b9ac7c03a09ae61e6dd985d79ce0db4b850e89f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 13:06:26 +0200 Subject: [PATCH 02/14] Bump @typescript-eslint/eslint-plugin from 6.6.0 to 6.7.0 in /cli-tests (#2475) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.6.0 to 6.7.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- cli-tests/package-lock.json | 138 +++++++++--------------------------- cli-tests/package.json | 2 +- 2 files changed, 33 insertions(+), 107 deletions(-) diff --git a/cli-tests/package-lock.json b/cli-tests/package-lock.json index f8e409f1e8..be0d701056 100644 --- a/cli-tests/package-lock.json +++ b/cli-tests/package-lock.json @@ -20,7 +20,7 @@ "devDependencies": { "@types/promise-retry": "^1.1.3", "@types/shelljs": "^0.8.12", - "@typescript-eslint/eslint-plugin": "^6.6.0", + "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", "eslint": "8.48", "eslint-config-airbnb-base": "^15.0.0", @@ -261,16 +261,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.6.0.tgz", - "integrity": "sha512-CW9YDGTQnNYMIo5lMeuiIG08p4E0cXrXTbcZ2saT/ETE7dWUrNxlijsQeU04qAAKkILiLzdQz+cGFxCJjaZUmA==", + "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.5.1", - "@typescript-eslint/scope-manager": "6.6.0", - "@typescript-eslint/type-utils": "6.6.0", - "@typescript-eslint/utils": "6.6.0", - "@typescript-eslint/visitor-keys": "6.6.0", + "@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", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -323,7 +323,7 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "node_modules/@typescript-eslint/scope-manager": { "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==", @@ -340,88 +340,14 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "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": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "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": "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.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "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": "6.7.0", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.6.0.tgz", - "integrity": "sha512-pT08u5W/GT4KjPUmEtc2kSYvrH8x89cVzkA0Sy2aaOUIw6YxOIjA8ilwLr/1fLjOedX1QAuBpG9XggWqIIfERw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.6.0", - "@typescript-eslint/visitor-keys": "6.6.0" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.6.0.tgz", - "integrity": "sha512-8m16fwAcEnQc69IpeDyokNO+D5spo0w1jepWWY2Q6y5ZKNuj5EhVQXjtVAeDDqvW6Yg7dhclbsz6rTtOvcwpHg==", + "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": "6.6.0", - "@typescript-eslint/utils": "6.6.0", + "@typescript-eslint/typescript-estree": "6.7.0", + "@typescript-eslint/utils": "6.7.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -442,9 +368,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.6.0.tgz", - "integrity": "sha512-CB6QpJQ6BAHlJXdwUmiaXDBmTqIE2bzGTDLADgvqtHWuhfNP3rAOK7kAgRMAET5rDRr9Utt+qAzRBdu3AhR3sg==", + "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": "^16.0.0 || >=18.0.0" @@ -455,13 +381,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.6.0.tgz", - "integrity": "sha512-hMcTQ6Al8MP2E6JKBAaSxSVw5bDhdmbCEhGW/V8QXkb9oNsFkA4SBuOMYVPxD3jbtQ4R/vSODBsr76R6fP3tbA==", + "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": "6.6.0", - "@typescript-eslint/visitor-keys": "6.6.0", + "@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", @@ -482,17 +408,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.6.0.tgz", - "integrity": "sha512-mPHFoNa2bPIWWglWYdR0QfY9GN0CfvvXX1Sv6DlSTive3jlMTUy+an67//Gysc+0Me9pjitrq0LJp0nGtLgftw==", + "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.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.6.0", - "@typescript-eslint/types": "6.6.0", - "@typescript-eslint/typescript-estree": "6.6.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": { @@ -507,12 +433,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.6.0.tgz", - "integrity": "sha512-L61uJT26cMOfFQ+lMZKoJNbAEckLe539VhTxiGHrWl5XSKQgA0RTBZJW2HFPy5T0ZvPVSD93QsrTKDkfNwJGyQ==", + "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": "6.6.0", + "@typescript-eslint/types": "6.7.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { diff --git a/cli-tests/package.json b/cli-tests/package.json index 82cab31f55..58c7a12ff2 100644 --- a/cli-tests/package.json +++ b/cli-tests/package.json @@ -24,7 +24,7 @@ "devDependencies": { "@types/promise-retry": "^1.1.3", "@types/shelljs": "^0.8.12", - "@typescript-eslint/eslint-plugin": "^6.6.0", + "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", "eslint": "8.48", "eslint-config-airbnb-base": "^15.0.0", From ada8d7794a8fbd399640ae1c141058acd69fd091 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:23:49 +0200 Subject: [PATCH 03/14] Bump docker/login-action from 2 to 3 (#2480) Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/devcontainer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index bcba69877d..8904dc1d41 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -39,14 +39,14 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Login to ghcr.io registry - uses: docker/login-action@v2 + 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@v2 + uses: docker/login-action@v3 with: registry: docker.io username: ${{ secrets.DOCKERHUB_USERNAME }} From 75ad62f82efdf0e6c140d298f55f2b623d49c8f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 08:44:15 +0000 Subject: [PATCH 04/14] Bump docker/setup-buildx-action from 2 to 3 (#2479) Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/devcontainer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 8904dc1d41..46be7cb6ee 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -36,7 +36,7 @@ jobs: ref: ${{ github.event.inputs.branch }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to ghcr.io registry uses: docker/login-action@v3 From 3c58ed956b5ae6b19a621d7d4cd12087051abd62 Mon Sep 17 00:00:00 2001 From: Alex Tymchuk Date: Wed, 13 Sep 2023 13:43:34 +0300 Subject: [PATCH 05/14] PMM-11670 Set the cluster label if empty (#2459) * PMM-11670 make sure cluster label is not empty * PMM-11670 fix tests in managed/models * PMM-11670 fix inventory tests * PMM-11670 fix tests in managed/qan * PMM-11670 fix tests in managed/services/victoriametrics * PMM-11670 fix API tests * PMM-11670 update API tests * PMM-11670 remove the deprecated parameter * PMM-11670 beautify the debug print --------- Co-authored-by: Matej Kubinec --- .github/workflows/managed.yml | 7 ++-- api-tests/inventory/nodes_test.go | 1 + api-tests/inventory/services_test.go | 12 +++++++ api-tests/management/external_test.go | 2 ++ api-tests/management/haproxy_test.go | 2 ++ api-tests/management/mongodb_test.go | 7 ++++ api-tests/management/mysql_test.go | 6 ++++ api-tests/management/postgresql_test.go | 7 ++++ api-tests/management/proxysql_test.go | 16 +++++---- managed/models/database.go | 3 ++ managed/models/service_helpers_test.go | 33 ++++++++++++------- managed/models/service_model.go | 6 ++++ managed/services/inventory/services_test.go | 10 ++++++ managed/services/qan/client_test.go | 4 +++ .../victoriametrics/victoriametrics_test.go | 12 +++++++ 15 files changed, 104 insertions(+), 24 deletions(-) diff --git a/.github/workflows/managed.yml b/.github/workflows/managed.yml index 807377494b..ab1c5b8dcf 100644 --- a/.github/workflows/managed.yml +++ b/.github/workflows/managed.yml @@ -107,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 --short --output json diff --git a/api-tests/inventory/nodes_test.go b/api-tests/inventory/nodes_test.go index e3adc01ac9..f2f9c52d86 100644 --- a/api-tests/inventory/nodes_test.go +++ b/api-tests/inventory/nodes_test.go @@ -401,6 +401,7 @@ func TestRemoveNode(t *testing.T) { Address: "localhost", Port: 3306, ServiceName: serviceName, + Cluster: serviceName, }, }, }, listAgentsOK.Payload) diff --git a/api-tests/inventory/services_test.go b/api-tests/inventory/services_test.go index 21c83853bf..33e032428e 100644 --- a/api-tests/inventory/services_test.go +++ b/api-tests/inventory/services_test.go @@ -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/external_test.go b/api-tests/management/external_test.go index 78dce3c34b..f87fa9ec58 100644 --- a/api-tests/management/external_test.go +++ b/api-tests/management/external_test.go @@ -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..e805be8de8 100644 --- a/api-tests/management/haproxy_test.go +++ b/api-tests/management/haproxy_test.go @@ -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/mongodb_test.go b/api-tests/management/mongodb_test.go index b65f317a03..98d137f939 100644 --- a/api-tests/management/mongodb_test.go +++ b/api-tests/management/mongodb_test.go @@ -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..0b93e7f90d 100644 --- a/api-tests/management/mysql_test.go +++ b/api-tests/management/mysql_test.go @@ -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/postgresql_test.go b/api-tests/management/postgresql_test.go index 4f21927b49..23bd00629c 100644 --- a/api-tests/management/postgresql_test.go +++ b/api-tests/management/postgresql_test.go @@ -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..d3b823e54e 100644 --- a/api-tests/management/proxysql_test.go +++ b/api-tests/management/proxysql_test.go @@ -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/managed/models/database.go b/managed/models/database.go index 4897a7d3cb..f1291d50b0 100644 --- a/managed/models/database.go +++ b/managed/models/database.go @@ -915,6 +915,9 @@ var databaseSchema = [][]string{ `ALTER TABLE agents ALTER COLUMN comments_parsing_disabled DROP DEFAULT`, }, + 85: { + `UPDATE services SET cluster = service_name WHERE cluster = ''`, + }, } // ^^^ Avoid default values in schema definition. ^^^ diff --git a/managed/models/service_helpers_test.go b/managed/models/service_helpers_test.go index 07e4773a45..95e38b02fa 100644 --- a/managed/models/service_helpers_test.go +++ b/managed/models/service_helpers_test.go @@ -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) { diff --git a/managed/models/service_model.go b/managed/models/service_model.go index 721e59ed64..c022296c1f 100644 --- a/managed/models/service_model.go +++ b/managed/models/service_model.go @@ -74,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 } @@ -83,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 } diff --git a/managed/services/inventory/services_test.go b/managed/services/inventory/services_test.go index ad5549a00c..c908cbb333 100644 --- a/managed/services/inventory/services_test.go +++ b/managed/services/inventory/services_test.go @@ -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/qan/client_test.go b/managed/services/qan/client_test.go index e48d5c7503..dc4bc1887e 100644 --- a/managed/services/qan/client_test.go +++ b/managed/services/qan/client_test.go @@ -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/victoriametrics/victoriametrics_test.go b/managed/services/victoriametrics/victoriametrics_test.go index 6eb19fcd9c..995cedf740 100644 --- a/managed/services/victoriametrics/victoriametrics_test.go +++ b/managed/services/victoriametrics/victoriametrics_test.go @@ -336,6 +336,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 +367,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 +398,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 +431,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 +469,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 +513,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 +546,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 +584,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 +628,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 +661,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 +691,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 +721,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 From df3b1aa2b14d378d6fe500b27979158b6b38e8c3 Mon Sep 17 00:00:00 2001 From: Alex Tymchuk Date: Wed, 13 Sep 2023 14:44:05 +0300 Subject: [PATCH 06/14] PMM-12376 single inventory add endpoint (#2422) * PMM-12376 add a single NodeAdd endpoint * PMM-12376 add a couple tests for AddNode * PMM-12376 add more tests * PMM-12376 remove debug lines * PMM-12376 format the code * PMM-12376 address linter errors * PMM-12376 pass context to transactions * PMM-12376 add more tests * PMM-12376 clean up the tests * PMM-12376 improve the tests * PMM-12376 re-generate the specs * PMM-12376 add AddNode to grpc server * PMM-12376 update the APi documentation * PMM-12376 update the documentation * PMM-12376 prefer oneof vs optional * PMM-12376 update the docs * PMM-12376 add API tests * PMM-12376 fix formatting * PMM-12376 fix API nodes_test * PMM-12376 fix API tests * PMM-12376 reindex message props in nodes.proto Co-authored-by: Artem Gavrilov * PMM-12376 use NotEmpty for checking an array Co-authored-by: Artem Gavrilov * PMM-12376 move back the api-tests/server tests * PMM-12376 running make gen * PMM-12376 replace NotZerof with NotEmptyf * PMM-12376 fix the TestContainerNode/Basic API test --------- Co-authored-by: Artem Gavrilov --- api-tests/helpers.go | 15 + api-tests/inventory/nodes_test.go | 354 ++++- .../json/client/nodes/add_node_parameters.go | 144 ++ .../json/client/nodes/add_node_responses.go | 1363 +++++++++++++++++ .../nodes/add_remote_rds_node_responses.go | 4 - .../json/client/nodes/get_node_responses.go | 4 - .../json/client/nodes/list_nodes_responses.go | 4 - .../json/client/nodes/nodes_client.go | 65 +- api/inventorypb/json/inventorypb.json | 568 ++++++- api/inventorypb/nodes.pb.go | 1050 ++++++++----- api/inventorypb/nodes.pb.gw.go | 81 + api/inventorypb/nodes.pb.validate.go | 620 ++++++++ api/inventorypb/nodes.proto | 92 +- api/inventorypb/nodes_grpc.pb.go | 79 +- .../json/client/rds/add_rds_responses.go | 4 - api/managementpb/json/managementpb.json | 2 +- api/swagger/swagger-dev.json | 570 ++++++- api/swagger/swagger.json | 570 ++++++- docs/api/addnode.md | 69 + docs/api/adhoc-backup.md | 9 +- docs/api/authentication.md | 14 +- docs/api/listlocations.md | 14 +- docs/api/listnodes.md | 31 +- docs/api/listservices.md | 26 +- docs/process/tech_stack.md | 4 +- .../services/inventory/grpc/nodes_server.go | 4 + managed/services/inventory/nodes.go | 72 +- managed/services/inventory/nodes_test.go | 277 +++- 28 files changed, 5537 insertions(+), 572 deletions(-) create mode 100644 api/inventorypb/json/client/nodes/add_node_parameters.go create mode 100644 api/inventorypb/json/client/nodes/add_node_responses.go create mode 100644 docs/api/addnode.md diff --git a/api-tests/helpers.go b/api-tests/helpers.go index 1b280fd192..d5559ea0cd 100644 --- a/api-tests/helpers.go +++ b/api-tests/helpers.go @@ -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() diff --git a/api-tests/inventory/nodes_test.go b/api-tests/inventory/nodes_test.go index f2f9c52d86..0907f2a8ea 100644 --- a/api-tests/inventory/nodes_test.go +++ b/api-tests/inventory/nodes_test.go @@ -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,7 +683,7 @@ 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, @@ -409,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, @@ -420,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, }) @@ -440,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, @@ -467,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/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/inventorypb.json b/api/inventorypb/json/inventorypb.json index 73ab50ba4d..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": [ { 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/managementpb/json/client/rds/add_rds_responses.go b/api/managementpb/json/client/rds/add_rds_responses.go index 0c5c17da70..739b758db0 100644 --- a/api/managementpb/json/client/rds/add_rds_responses.go +++ b/api/managementpb/json/client/rds/add_rds_responses.go @@ -1219,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/managementpb.json b/api/managementpb/json/managementpb.json index b5c9de7585..57b8c1da00 100644 --- a/api/managementpb/json/managementpb.json +++ b/api/managementpb/json/managementpb.json @@ -5407,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" diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index 8801f4cba5..af4af60aaa 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -13307,14 +13307,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", @@ -13480,12 +14014,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", @@ -13641,12 +14176,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", @@ -13782,12 +14318,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", @@ -13923,12 +14460,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", @@ -14015,7 +14553,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" @@ -14288,7 +14826,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" @@ -14626,7 +15164,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" @@ -14724,11 +15262,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": [ { @@ -28232,7 +28770,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" diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index f1e0ccb21b..13fd52ea88 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -10463,14 +10463,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", @@ -10636,12 +11170,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", @@ -10797,12 +11332,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", @@ -10938,12 +11474,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", @@ -11079,12 +11616,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", @@ -11171,7 +11709,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" @@ -11444,7 +11982,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" @@ -11782,7 +12320,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" @@ -11880,11 +12418,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": [ { @@ -19401,7 +19939,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" 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/managed/services/inventory/grpc/nodes_server.go b/managed/services/inventory/grpc/nodes_server.go index ba08800ad8..12fafcce8d 100644 --- a/managed/services/inventory/grpc/nodes_server.go +++ b/managed/services/inventory/grpc/nodes_server.go @@ -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/nodes.go b/managed/services/inventory/nodes.go index 10516dfd2d..66bbd95c54 100644 --- a/managed/services/inventory/nodes.go +++ b/managed/services/inventory/nodes.go @@ -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..7dd7a874b0 100644 --- a/managed/services/inventory/nodes_test.go +++ b/managed/services/inventory/nodes_test.go @@ -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) + }) +} From d6be5fd533b1776f67f8ebc7ba19e457a851c193 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Wed, 13 Sep 2023 14:22:00 +0200 Subject: [PATCH 07/14] PMM-12448 Fix bug (#2437) --- managed/services/preconditions.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/managed/services/preconditions.go b/managed/services/preconditions.go index 41e06cf179..d6b09579d4 100644 --- a/managed/services/preconditions.go +++ b/managed/services/preconditions.go @@ -117,7 +117,9 @@ func CheckArtifactOverlapping(q *reform.Querier, serviceID, locationID, folder s } for _, artifact := range artifacts { - if artifact.ServiceID != serviceID { + // 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 From bc05808c9e7e0847233484f9262a428c09f54e90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:54:35 +0000 Subject: [PATCH 08/14] Bump docker/build-push-action from 4 to 5 (#2481) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v4...v5) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/devcontainer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 46be7cb6ee..71ad2974ba 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -53,7 +53,7 @@ jobs: password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Build and push to registries - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: file: ./devcontainer.Dockerfile push: true From 101265c532243f3667f35ff2fd5f74d3ff462716 Mon Sep 17 00:00:00 2001 From: Alex Tymchuk Date: Wed, 13 Sep 2023 23:15:40 +0300 Subject: [PATCH 09/14] PMM-12457 add node_name to agent metrics (#2474) * PMM-12457 add node_name to agent metrics * PMM-12457 update the template to use node_name * PMM-12457 fix punctuation --- managed/data/iatemplates/agent_down.yml | 5 ++--- .../services/inventory/inventory_metrics.go | 18 +++++++++++++++--- .../inventory/inventory_metrics_test.go | 8 ++++---- 3 files changed, 21 insertions(+), 10 deletions(-) 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/services/inventory/inventory_metrics.go b/managed/services/inventory/inventory_metrics.go index afda82c0b6..d390b95b73 100644 --- a/managed/services/inventory/inventory_metrics.go +++ b/managed/services/inventory/inventory_metrics.go @@ -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 = ` From 1cb518a244480bd94a0ce2ed0782a1be49fe6d47 Mon Sep 17 00:00:00 2001 From: Alex Tymchuk Date: Fri, 15 Sep 2023 10:35:08 +0300 Subject: [PATCH 10/14] PMM-12488 update VictoriaMetrics to v1.93.4 (#2483) --- build/packages/rpm/server/SPECS/pmm-dump.spec | 1 + build/packages/rpm/server/SPECS/victoriametrics.spec | 11 +++++++---- build/scripts/vars | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) 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 7b13cd2f3e..ec55d239d1 100644 --- a/build/packages/rpm/server/SPECS/victoriametrics.spec +++ b/build/packages/rpm/server/SPECS/victoriametrics.spec @@ -9,11 +9,11 @@ %global repo VictoriaMetrics %global provider github.com/VictoriaMetrics/%{repo} -%global commit pmm-6401-v1.93.1 +%global commit pmm-6401-v1.93.4 Name: percona-victoriametrics -Version: 1.93.1 -Release: 2%{?dist} +Version: 1.93.4 +Release: 1%{?dist} Summary: VictoriaMetrics monitoring solution and time series database License: Apache-2.0 URL: https://%{provider} @@ -43,13 +43,16 @@ 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 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 diff --git a/build/scripts/vars b/build/scripts/vars index f1597dd14a..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/releases/tag/pmm-6401-v1.93.1 -vmagent_commit_hash=ca20478a69233179b1891755937b5c7d58791fc2 +# https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/pmm-6401-v1.93.4 +vmagent_commit_hash=58ecb9066574f38f1d1c91ace467316e7f175b09 From 576142adcd752462868575a238bd97804b22449a Mon Sep 17 00:00:00 2001 From: Talha Bin Rizwan Date: Fri, 15 Sep 2023 16:35:08 +0500 Subject: [PATCH 11/14] PMM-9769 update all components (#2478) * PMM-9769 Use ansible-core instead of ansible package. * PMM-9769 Update all components. --- build/ansible/roles/ami-ovf/tasks/main.yml | 31 +++++++++++++- build/ansible/roles/cloud-node/tasks/main.yml | 23 ++++++++-- .../ansible/roles/pmm2-images/tasks/main.yml | 15 ++++++- build/docker/server/Dockerfile.el9 | 21 ++++------ build/packer/pmm2.el9.json | 3 +- update/ansible/playbook/tasks/update.yml | 42 ++++++++++++++++++- 6 files changed, 111 insertions(+), 24 deletions(-) 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 edcbe3104d..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 EL7 + when: + - ansible_distribution == 'CentOS' + - ansible_distribution_major_version == '7' + - ansible_os_family == 'RedHat' + service: + name: firewalld + state: started + enabled: yes -- name: Firewalld | Start - when: ansible_os_family == 'RedHat' +- 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 diff --git a/build/ansible/roles/pmm2-images/tasks/main.yml b/build/ansible/roles/pmm2-images/tasks/main.yml index f7812a6328..6fed510de7 100644 --- a/build/ansible/roles/pmm2-images/tasks/main.yml +++ b/build/ansible/roles/pmm2-images/tasks/main.yml @@ -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 diff --git a/build/docker/server/Dockerfile.el9 b/build/docker/server/Dockerfile.el9 index 925e4e6c08..4fb9001f98 100644 --- a/build/docker/server/Dockerfile.el9 +++ b/build/docker/server/Dockerfile.el9 @@ -18,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 diff --git a/build/packer/pmm2.el9.json b/build/packer/pmm2.el9.json index 51488569db..baa0ef18f2 100644 --- a/build/packer/pmm2.el9.json +++ b/build/packer/pmm2.el9.json @@ -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/update/ansible/playbook/tasks/update.yml b/update/ansible/playbook/tasks/update.yml index db484e0cae..ad747de74a 100644 --- a/update/ansible/playbook/tasks/update.yml +++ b/update/ansible/playbook/tasks/update.yml @@ -239,7 +239,10 @@ - name: Wait for pmm-managed 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 @@ -247,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 @@ -258,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 From 7d74fbe0c0130f1f93bb7de8514180be831d5ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C4=8Ctvrtka?= <62988319+JiriCtvrtka@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:58:53 +0200 Subject: [PATCH 12/14] PMM-11603 pmm-agent reload. (#2410) * PMM-11603 Temp, not done. * PMM-11603 Another refactor. * PMM-11603 Close reload channel. * PMM-11603 Fix logger, refactor. * PMM-11603 Print done only once even with reloads. * Update agent/agentlocal/agent_local.go Co-authored-by: Alex Tymchuk * PMM-11603 Recursion to for. * PMM-11603 Changes, refactor. * PMM-11603 Small improvements. * PMM-11603 Formatting. * PMM-11603 2nd level loop for client. * PMM-11603 Fix nil pointer problem. * PMM-11603 Another places without check for nil coming from channel. * PMM-11603 Some required changes. * PMM11603 Separate switch into func. * PMM-11603 Remove chan value nil check. * PMM-11603 Suggested changes. * PMM-11603 Logger refactor. * PMM-11603 Lint. --------- Co-authored-by: Alex Tymchuk --- agent/agentlocal/agent_local.go | 6 +- agent/client/client.go | 12 +++ agent/commands/run.go | 134 ++++++++++++++++++-------------- agent/config/logger.go | 2 - 4 files changed, 93 insertions(+), 61 deletions(-) diff --git a/agent/agentlocal/agent_local.go b/agent/agentlocal/agent_local.go index 60a6e3325f..e0809b2494 100644 --- a/agent/agentlocal/agent_local.go +++ b/agent/agentlocal/agent_local.go @@ -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() diff --git a/agent/client/client.go b/agent/client/client.go index c2106072d0..a7906b6ef1 100644 --- a/agent/client/client.go +++ b/agent/client/client.go @@ -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) diff --git a/agent/commands/run.go b/agent/commands/run.go index 22878c350b..cc384a75a9 100644 --- a/agent/commands/run.go +++ b/agent/commands/run.go @@ -40,14 +40,13 @@ import ( // Run implements `pmm-agent run` default command. func Run() { - var cfg *config.Config - 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) @@ -56,75 +55,89 @@ func Run() { s := <-signals signal.Stop(signals) l.Warnf("Got %s, shutting down...", unix.SignalName(s.(unix.Signal))) //nolint:forcetypeassert - if cfg != nil { - cleanupTmp(cfg.Paths.TempDir, l) - } - 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) { @@ -141,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/config/logger.go b/agent/config/logger.go index 570ab0dbfa..781f206c4f 100644 --- a/agent/config/logger.go +++ b/agent/config/logger.go @@ -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) } From 4aa0e240061f1656bc9d2273068ed515a50e8328 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 08:46:24 +0000 Subject: [PATCH 13/14] Bump eslint from 8.48.0 to 8.49.0 in /cli-tests (#2471) Bumps [eslint](https://github.com/eslint/eslint) from 8.48.0 to 8.49.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.48.0...v8.49.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- cli-tests/package-lock.json | 24 ++++++++++++------------ cli-tests/package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cli-tests/package-lock.json b/cli-tests/package-lock.json index be0d701056..a9c7eac9d6 100644 --- a/cli-tests/package-lock.json +++ b/cli-tests/package-lock.json @@ -22,7 +22,7 @@ "@types/shelljs": "^0.8.12", "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", - "eslint": "8.48", + "eslint": "8.49", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-plugin-import": "^2.28.0", @@ -86,18 +86,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.48.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.48.0.tgz", - "integrity": "sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz", + "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==", "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", @@ -936,16 +936,16 @@ } }, "node_modules/eslint": { - "version": "8.48.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.48.0.tgz", - "integrity": "sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", + "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.48.0", - "@humanwhocodes/config-array": "^0.11.10", + "@eslint/js": "8.49.0", + "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.12.4", diff --git a/cli-tests/package.json b/cli-tests/package.json index 58c7a12ff2..79bd81ced2 100644 --- a/cli-tests/package.json +++ b/cli-tests/package.json @@ -26,7 +26,7 @@ "@types/shelljs": "^0.8.12", "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", - "eslint": "8.48", + "eslint": "8.49", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", "eslint-plugin-import": "^2.28.0", From ffc66f09b0af07e8f41ef52b9e1b4618453438a1 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Mon, 18 Sep 2023 13:01:55 +0300 Subject: [PATCH 14/14] PMM-9374 external victoria metrics (#1916) * PMM-9374 support of external victoria metrics. * PMM-9374 update version number of victoria metrics. * PMM-9374 vmalert. * PMM-9374 use pmm-clients vmagent instead of a separate one. * PMM-9374 Fix linters. * PMM-9374 Fix tests. * PMM-9374 Improve work with VM Proxy. * PMM-9374 Fix tests. * PMM-9374 Fix tests. * PMM-9374 Fix tests. * PMM-9374 Fix linters. * PMM-9374 Add new tests. * PMM-9374 use interfaces instead of real object. * PMM-9374 Fix the test. * PMM-9374 Fix the linter. * PMM-9374 Fix the linter. * Update pmm_config.go * Update pmm-db_disabled.ini * PMM-9374 fix supervisord for external VM. * PMM-9374 Fix linters. * PMM-9374 Don't run victoria metrics if it's external. --- docker-compose.yml | 44 ++++++++--- managed/cmd/pmm-managed/main.go | 29 +++++--- ...iametrics.go => victoriametrics_params.go} | 39 +++++++++- ...test.go => victoriametrics_params_test.go} | 35 ++++++++- managed/services/agents/deps.go | 9 +++ managed/services/agents/registry.go | 20 +++-- managed/services/agents/state.go | 18 +++-- managed/services/agents/vmagent.go | 25 +++++-- managed/services/agents/vmagent_test.go | 30 +++++++- managed/services/config/pmm-managed.yaml | 1 - managed/services/supervisord/deps.go | 25 +++++++ .../services/supervisord/devcontainer_test.go | 4 +- managed/services/supervisord/logs.go | 14 +++- managed/services/supervisord/logs_test.go | 9 ++- managed/services/supervisord/pmm_config.go | 1 - managed/services/supervisord/supervisord.go | 37 ++++------ .../services/supervisord/supervisord_test.go | 6 +- .../victoriametrics/victoriametrics.go | 73 ++++++++++++++----- .../victoriametrics/victoriametrics_test.go | 7 +- .../supervisord.d/pmm-db_disabled.ini | 1 - .../testdata/supervisord.d/pmm-db_enabled.ini | 1 - managed/testdata/supervisord.d/vmalert.ini | 8 +- managed/testdata/supervisord.d/vmproxy.ini | 2 +- managed/utils/envvars/parser.go | 12 +++ .../playbook/tasks/files/datasources.yml | 2 +- vmproxy/Makefile | 2 +- vmproxy/proxy/proxy.go | 7 ++ 27 files changed, 349 insertions(+), 112 deletions(-) rename managed/models/{victoriametrics.go => victoriametrics_params.go} (72%) rename managed/models/{victoriametrics_test.go => victoriametrics_params_test.go} (62%) create mode 100644 managed/services/supervisord/deps.go 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/managed/cmd/pmm-managed/main.go b/managed/cmd/pmm-managed/main.go index cd203b2e31..c3d7bf5e86 100644 --- a/managed/cmd/pmm-managed/main.go +++ b/managed/cmd/pmm-managed/main.go @@ -680,9 +680,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() @@ -762,6 +762,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 @@ -782,6 +783,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, @@ -814,12 +824,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) } @@ -833,7 +838,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) @@ -852,7 +857,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, @@ -897,7 +902,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) diff --git a/managed/models/victoriametrics.go b/managed/models/victoriametrics_params.go similarity index 72% rename from managed/models/victoriametrics.go rename to managed/models/victoriametrics_params.go index d8b07caf27..f033b5a4f4 100644 --- a/managed/models/victoriametrics.go +++ b/managed/models/victoriametrics_params.go @@ -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 62% rename from managed/models/victoriametrics_test.go rename to managed/models/victoriametrics_params_test.go index 02ab59b036..b0f55796f6 100644 --- a/managed/models/victoriametrics_test.go +++ b/managed/models/victoriametrics_params_test.go @@ -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/deps.go b/managed/services/agents/deps.go index 0a321d944d..396517c7d1 100644 --- a/managed/services/agents/deps.go +++ b/managed/services/agents/deps.go @@ -17,6 +17,7 @@ package agents import ( "context" + "net/url" "github.com/sirupsen/logrus" @@ -54,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/registry.go b/managed/services/agents/registry.go index 3745044378..d786d2474f 100644 --- a/managed/services/agents/registry.go +++ b/managed/services/agents/registry.go @@ -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/state.go b/managed/services/agents/state.go index ac49fc5768..96f8f0562c 100644 --- a/managed/services/agents/state.go +++ b/managed/services/agents/state.go @@ -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/vmagent.go b/managed/services/agents/vmagent.go index f12d345d36..b5586df710 100644 --- a/managed/services/agents/vmagent.go +++ b/managed/services/agents/vmagent.go @@ -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..43402e56ad 100644 --- a/managed/services/agents/vmagent_test.go +++ b/managed/services/agents/vmagent_test.go @@ -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/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/supervisord/deps.go b/managed/services/supervisord/deps.go new file mode 100644 index 0000000000..8dea19e974 --- /dev/null +++ b/managed/services/supervisord/deps.go @@ -0,0 +1,25 @@ +// 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 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..0110cfb793 100644 --- a/managed/services/supervisord/devcontainer_test.go +++ b/managed/services/supervisord/devcontainer_test.go @@ -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 7eb802fae3..7752a1b97f 100644 --- a/managed/services/supervisord/logs.go +++ b/managed/services/supervisord/logs.go @@ -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 118a42bac1..e7de37dae9 100644 --- a/managed/services/supervisord/logs_test.go +++ b/managed/services/supervisord/logs_test.go @@ -31,6 +31,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/percona/pmm/managed/models" "github.com/percona/pmm/utils/logger" ) @@ -147,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) @@ -190,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/pmm_config.go b/managed/services/supervisord/pmm_config.go index 602b9a5546..581e6de282 100644 --- a/managed/services/supervisord/pmm_config.go +++ b/managed/services/supervisord/pmm_config.go @@ -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/supervisord.go b/managed/services/supervisord/supervisord.go index 29490ff66d..7172bbe8fa 100644 --- a/managed/services/supervisord/supervisord.go +++ b/managed/services/supervisord/supervisord.go @@ -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, @@ -614,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"}} @@ -652,6 +643,7 @@ redirect_stderr = true {{end}} {{define "victoriametrics"}} +{{- if not .ExternalVM }} [program:victoriametrics] priority = 7 command = @@ -659,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 @@ -684,6 +676,7 @@ stdout_logfile = /srv/logs/victoriametrics.log stdout_logfile_maxbytes = 10MB stdout_logfile_backups = 3 redirect_stderr = true +{{end -}} {{end}} {{define "vmalert"}} @@ -694,14 +687,14 @@ 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 --rule=/etc/ia/rules/*.yml - --httpListenAddr=` + interfaceToBind + `:8880 + --httpListenAddr={{ .InterfaceToBind }}:8880 {{- range $index, $param := .VMAlertFlags }} {{ $param }} {{- end }} @@ -723,9 +716,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 @@ -749,7 +742,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 diff --git a/managed/services/supervisord/supervisord_test.go b/managed/services/supervisord/supervisord_test.go index ed6e515ff5..3263efa842 100644 --- a/managed/services/supervisord/supervisord_test.go +++ b/managed/services/supervisord/supervisord_test.go @@ -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/victoriametrics/victoriametrics.go b/managed/services/victoriametrics/victoriametrics.go index 13a468be87..7a70108d67 100644 --- a/managed/services/victoriametrics/victoriametrics.go +++ b/managed/services/victoriametrics/victoriametrics.go @@ -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 995cedf740..90607082fb 100644 --- a/managed/services/victoriametrics/victoriametrics_test.go +++ b/managed/services/victoriametrics/victoriametrics_test.go @@ -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) @@ -814,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/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 e784596bcb..40f61b1d83 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 --rule=/etc/ia/rules/*.yml --httpListenAddr=127.0.0.1:8880 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/envvars/parser.go b/managed/utils/envvars/parser.go index 4bd4fc67f2..7847419984 100644 --- a/managed/utils/envvars/parser.go +++ b/managed/utils/envvars/parser.go @@ -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/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/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/proxy/proxy.go b/vmproxy/proxy/proxy.go index 20fa20f33d..8d7f5ec762 100644 --- a/vmproxy/proxy/proxy.go +++ b/vmproxy/proxy/proxy.go @@ -24,6 +24,7 @@ import ( "net/http" "net/http/httputil" "net/url" + "strings" "time" "github.com/pkg/errors" @@ -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()